Robot side-by-side operation method
Technical Field
The invention relates to the technical field of robot travel path planning, in particular to a method for running a robot alongside.
Background
With the development of mobile robot technology, robots can move flexibly and autonomously indoors, but are less frequently used outdoors, and currently, robots mainly run outdoors by two methods, namely, a traditional shortest path-based trajectory planning method is used, so that the shortest trajectory from the robot to a target point can be obtained, and whether the planning along a road is considered or not can not be considered. As shown in fig. 1, assuming that the robot needs to reach a point B on one side of the road from a point a on the other side of the road, according to the conventional shortest distance-based trajectory planning method, a straight-line trajectory from a to B is obtained, as shown in fig. 1 (a), such a trajectory has a larger proportion in the center of the road, and if the robot runs along such a trajectory, the robot will run in the center of the road for a long time, which affects the traffic order of the road; in order to minimize the influence on the safety and order of the road, it is necessary to travel along the road edge to the point C opposite to the point B and then traverse the road, as shown in fig. 1 (B). Note that the shaded portions in the drawing are all buildings or obstacles in the map, and the blank is a road.
In order to solve the above problems encountered when the robot is operated outdoors, the influence of the robot on the traffic order is reduced, and a current main method is to make the robot travel along a fixed track along a roadside by previously setting the track. The method comprises the following steps:
1. after the robot is deployed, a map of a scene is obtained, two tracks running along the road side are manually set according to the road in the map, and if the robot runs right, one track is needed in each of two directions, as shown in fig. 2, the two curves are set fixed tracks, and a black arrow indicates that the robot runs right.
2. At the road intersection, the junction points of the side tracks of different roads need to be manually set, the number of the junction points set at the road intersection is the same as the number of the junction points of the roads, then the junction points at the same road intersection are mutually connected, as shown in fig. 3, four roads are intersected at one intersection, curves are respectively fixed tracks set by roads 1, 2, 3 and 4 junction points are set at the intersection, each junction point is connected with the two fixed tracks which are set, and the junction points are also connected, so that the junction points are connected in a unidirectional way for limiting running near the right, and the connection mode is shown in fig. 3.
3. And storing the junction points at the intersections of different roads and the fixed track set between the junction points by using a graph structure in a computer.
4. When the robot receives the target point, planning is performed by using a stored graph structure to obtain a junction point which the robot should pass through in the process of reaching the target point, and then a series of trajectories between the junction points are connected to obtain a fixed trajectory to the target point, as shown in fig. 4, the robot starts from the point A and goes to the point B, the robot firstly finds the closest point from the current position to the fixed trajectory and the closest point from the target point to the fixed trajectory, and then planning is performed according to the shortest path of the graph structure to obtain the trajectory of the robot, as shown by a thick curve in fig. 4, so that the effects of driving by the side to the maximum degree and not obstructing traffic are realized.
If the conventional map-based shortest path trajectory planning method is used, the planning effect is as shown in fig. 5, and the planning effect is that the vehicle travels in the center of the road for a far longer time than in fig. 4, so that the traffic is greatly hindered.
However, the existing method for driving the robot along the road has the following disadvantages:
1. the engineering quantity of the fixed track along the roadside is set to be large, the number of roads is large in a large-scale scene due to different scene scales of the robot operation, each road needs to be set to be the fixed track along the roadside, and the connection mode of the tracks among different roads needs to be designed at the road junction, so that the robot has large workload and is not beneficial to rapid deployment of the robot in a new scene.
2. The fixed track along the roadside is set by manual operation, the track set by different operators can be different, the distance from the edge of the road is different during running, the effect of the side running is correspondingly affected, and the side running function is not beneficial to generalization and modularization.
3. The fixed track setting based on the map needs manual operation, and needs manual calibration whether the track meets the requirement or not, and needs adjustment, so that interactive software among the map, the track and a user needs to be developed, and the development cost is increased.
In order to solve the above-mentioned problems, it is necessary to develop a new approach to the side, which can effectively and rapidly plan the motion track of the robot, and shift the track to the roadside, so that the robot moves along the track close to the roadside.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method for running a robot by side.
In order to achieve the above object, the present invention is specifically as follows:
a method for robot side by side operation, comprising the steps of: s1, generating a road network; s2, track planning is carried out based on a road network; s3, shifting the planned track to the road edge, so that the robot runs along the road edge.
Preferably, the method for generating a road network in step S1 includes the steps of:
a1: traversing the scene by the robot so as to establish a map and generate a map establishing track;
a2: performing curve fitting on the map-building track to form a map-building track curve;
a3: taking a point on the graph track curve at intervals as a node of the road network;
a4: and connecting each node according to a certain method to obtain a road network.
Preferably, in the method for generating the mapping track in the step A1, the position of the robot is recorded at regular intervals when the robot traverses the scene, so as to form the mapping track composed of a series of first discrete points.
Preferably, in the method for forming the map track curve in the step A2, a map track of a road through which a certain section of the robot repeatedly passes is subjected to curve fitting by using a least square method, and a complete map track curve is formed after the fitted part and the part which does not need to be fitted are combined.
Preferably, in the step A3, the method for obtaining the node is that the map is divided into a plurality of grids with the same size, the map-building track in each grid is taken as an average position coordinate, and each average position coordinate is the node.
Preferably, the method for obtaining the road network in step A4 is to take a certain node as a central node in a certain range, connect all nodes in the range with the central node, if the connecting line of the certain node and the central node passes through a building on a map, then not take the node, otherwise take the node as an effective node, and connect each node with the effective node in the same range of the node to obtain the road network.
Preferably, in the method for track planning based on the road network in step S2, the track to be planned is provided with a start point and an end point, the start point is connected with a node closest to the start point, the end point is connected with a node closest to the end point, and the shortest path between the two nodes is planned in the road network, so that the planned running track is obtained and recorded as the first track.
Preferably, in step S3, the method for shifting the planned track to the road edge is to project the first track to the same side of the road to the vicinity of the building, and the specific steps are as follows:
b1: on a first track, taking the midpoint of a track line segment between every two nodes as a starting point, sending out rays to the same side in the direction perpendicular to each track line segment, and taking a building or map boundary intersected with each ray for the first time after each ray is sent out as a projected building;
b2: and dispersing the planned track in the road network into a series of second discrete points, searching the point closest to each second discrete point on the boundary with a certain distance from the projected building, marking the point as a projection point, and sequentially connecting each projection point to obtain a second track, wherein the second track is the roadside track along which the robot finally runs.
The technical scheme of the invention has the following beneficial effects:
the invention mainly aims at the defects of large engineering quantity of fixed track setting and difficult general modularization, obtains a road network automatically generated by a computer program when acquiring a map of a scene, avoids manual operation, and ensures the universality and modularization of functions; when the robot needs to plan the track, the track is planned according to the road network, the track is drawn towards the road edge, the whole process is completely controlled by the computer program, manual intervention is not needed, the efficiency is high, the error is effectively reduced, the development of interaction software necessary for setting the fixed track is avoided, and the development cost is saved.
Drawings
FIG. 1 is a basic schematic diagram of a prior art shortest path planning-based system;
FIG. 2 is a basic schematic diagram of a prior art vehicle traveling along a roadside fixed track;
FIG. 3 is a schematic diagram of a roadside fixed-track junction in the prior art;
FIG. 4 is a diagram of a prior art track following a roadside fixed track;
FIG. 5 is a trajectory graph based on shortest path planning in the prior art;
FIG. 6 is a schematic diagram of a mapping trace according to the present invention;
FIG. 7 is a schematic diagram of a map track curve according to the present invention;
FIG. 8 is a schematic diagram of a map grid of the present invention;
FIG. 9 is a schematic diagram of nodes of the road network of the present invention;
FIG. 10 is a schematic view of an active node of the road network of the present invention;
FIG. 11 is a schematic view of a road network according to the present invention;
FIG. 12 is a schematic view of a first track of the present invention;
FIG. 13 is a schematic view of a first trajectory projection of the present invention;
FIG. 14 is a schematic view of a proxel according to the present invention;
fig. 15 is a schematic diagram of a second track of the present invention.
Detailed Description
The invention will be further described with reference to the drawings and the specific examples.
Referring to fig. 11, 12 and 15, the present invention provides a method for robot to run alongside, comprising the steps of: s1, generating a road network; s2, track planning is carried out based on a road network; s3, shifting the planned track to the road edge, so that the robot runs along the road edge.
The method of generating a road network in step S1 comprises the steps of:
a1: traversing the scene by the robot so as to establish a map and generate a map establishing track;
a2: performing curve fitting on the map-building track to form a map-building track curve;
a3: taking a point on the graph track curve at intervals as a node of the road network;
a4: and connecting each node according to a certain method to obtain a road network.
Referring to fig. 6, in step A1, the method for generating the mapping track includes that the robot traverses the entire scene from point a to point B, the traversed track is shown as a thin curve in the figure, and when the robot traverses the scene, the position of the robot is recorded at regular intervals (for example, 0.1 second), so as to form the mapping track composed of a series of first discrete points.
Referring to fig. 6 and 7, in the method for forming the map-building track curve in step A2, some roads may pass more than once in the process of traversing the map by the robot, a plurality of segments of map-building tracks repeatedly passing through one road are proposed, a plurality of segments of discrete points are fitted into one line segment by a straight line fitting method, the straight line fitting method is a least square method, and the specific steps are as follows:
(1) A series of discrete points were taken out as fitting data, the data being (x 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n )
(2) The fit equation given for the assumption is:
y=ax+b
(3) Summing the squares of the distances of the points to the line:
(4) The fitted straight line is to satisfy the condition that the square sum of the distances from each point to the straight line is minimum, so the partial derivatives of a and b are calculated by the equation and are set as 0:
(5) The parameters a and b in the fitting equation are calculated as:
by the method, a plurality of segments of map-building track points which are close to each other are taken out for fitting, as shown in fig. 7 (a), the map-building track points which are close to each other are removed from the original map-building track, the curve fitting treatment is performed to obtain a thick line segment, other thin curves are the original map-building track which is remained after the removal, and then the two map-building track points are combined to obtain a complete map-building track curve which is shown in the curve in fig. 7 (b).
Referring to fig. 8 to 9, the method for obtaining the nodes in step A3 is to divide the map into a plurality of grids with the same size, as shown in fig. 8, average position coordinates are obtained for the map building track in each grid, and each average position coordinate is a node, as shown in fig. 9, and one node is in each grid on the road.
Referring to fig. 10 to 11, the method for obtaining the road network in step A4 is to take a certain node as a central node in a certain range, connect all nodes in the range with the central node, search in a circle with a dark node as a center and a grid side length of 1.5 times as a radius as shown in fig. 10, make the searched light node as a possible node to be connected, if a line segment (a broken line segment) between the light node and the dark node passes through a building, make no connection, connect the light node (an effective node) with the dark node, where the line segment (the solid line segment) does not pass through the building, and make the above operation on each node, so as to obtain the road network schematic diagram shown in fig. 11.
Referring to fig. 12, in step S2, a method for planning a trajectory based on a road network includes setting a start point a and an end point B on a trajectory to be planned, connecting the start point a with a node 1 closest to the start point a, connecting the end point B with a node 2 closest to the end point B, and planning a shortest path between the node 1 and the node 2 in the road network, thereby planning a trajectory from the start point a to the end point B, and recording the trajectory as a first trajectory.
Referring to fig. 13 to 15, in step S3, the method for shifting the planned trajectory to the road edge is to project the first trajectory to the same side of the road to the vicinity of the building, and specifically includes the following steps:
b1: referring to fig. 13, the first trajectory is a broken line, the trajectory between every two nodes is divided into 9 segments, the midpoint of each segment is taken as a starting point, a ray is emitted to the same side (for example, uniformly right side or uniformly left side) in a direction perpendicular to the segment, the ray direction is shown by an arrow, and a building or map boundary intersected with each ray for the first time after the ray is emitted is taken as a projected building, such as building 1, building 2 and building 3 in fig. 13.
B2: referring to fig. 14, the first track is discretized into a series of second discrete points, the distance between every two second discrete points can be 0.1 meter, the point closest to each second discrete point is searched on the boundary with a certain distance from the projected building and is recorded as a projection point, each projection point corresponds to each second discrete point one by one, as shown in fig. 15, each projection point is sequentially connected to obtain a second track (thick solid line in the figure), and the second track is the roadside track along which the robot finally runs.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structural changes made by the description of the present invention and the accompanying drawings or direct/indirect application in other related technical fields are included in the scope of the present invention.