Background
The path planning technology is a core part of the autonomous navigation technology of the robot, and the path planning technology refers to that a collision-free feasible path is generated from a starting position to a target position in a given environment. Common path planning methods are heuristic algorithms and sampling algorithms. The rapid expansion random tree (RRT) is a classical sampling algorithm, a communication path can be obtained by searching space uniformly, the expansion of the random tree in the algorithm is prone to be an exploration area in the environment space, the random points are generated in the environment, tree nodes closest to the random points in the random tree are searched, the two connecting line directions are used as new node growth directions, new nodes are generated by expansion with fixed step length, and the expansion process is repeated until target points are added into the random tree, so that a complete path is obtained. The RRT algorithm has two unavoidable problems, one is that the generated tree may have found nodes very close to the target, but not connected to the target due to the randomness of such sampling, and one is that this increases calls to the node generator, adding more unnecessary branches to the tree. To improve these two drawbacks of the RRT algorithm, a gol-biasRRT algorithm based on a probabilistic target has been proposed, and the running speed of the algorithm is accelerated by randomly selecting a target point as an expansion point with a certain probability.
The Goal-biasRRT can guide the random tree to grow towards the target by taking the target point as the sampling point according to a certain probability, and has the characteristic of preferentially growing a branch, which is beneficial to quickly planning a path. The probability P of gol-biasRRT to pick a target point as a sampling point is fixed, however, when the random tree falls into a local minimum, the extension of picking a target point as a sampling point is generally ineffective, which wastes a lot of computational resources.
The complete path planning algorithm can meet the requirements of path quality and algorithm performance, a short and smooth enough path needs to be obtained on the path quality to meet the requirements of robot tracking, the algorithm performance is embodied in the length of program running time, the algorithm performance is obviously improved by the Goal-biasRRT algorithm based on probability compared with the RRT algorithm, the path quality generated by the Goal-biasRRT algorithm is mostly inferior to that of the RRT algorithm, and the random tree of the Goal-biasRRT algorithm falls into local minimum values under certain scenes, so that the algorithm performance is greatly influenced.
Disclosure of Invention
In order to solve the problems in the prior art, the invention designs a robot path planning sampling method for adding candidate expansion queues, which can improve the algorithm performance and meet the path quality requirements.
In order to achieve the above purpose, the basic idea of the invention is that a group of candidate expansion queues (including target points) are selected in the vicinity of the target points according to a certain rule, each time an expansion point is reselected, a certain probability P is provided for selecting a head node in the candidate expansion queues as an expansion point, then the node is inserted into the tail of the queues, and correspondingly, each expansion has a certain probability 1-P for taking a random point as an expansion point.
The robot path planning sampling method for joining the candidate expansion queue comprises the following steps:
A. obtaining candidate expansion queues according to the position relation between the starting point and the target point
The black solid line frame is assumed to represent a given environment, the large dot at the lower left corner represents a starting point Qstart, the large dot at the upper right corner represents a target point Qgoal, the length of a line segment L connecting the starting point and the target point is m, the line segment is expanded outwards at intervals of an angle alpha at two sides of the line segment L by taking the target point Qgoal as an end point, four line segments L1, L2, L3 and L4 are expanded totally, R1 and R2 are taken as circles by taking the target point Qgoal as circle centers, R1 and R2 are taken as radiuses, and the two circles intersect with the line segments L1, L2, L3 and L4 to generate 8 intersection points totally, and the 8 intersection points are taken as candidate expansion points to form candidate expansion point queues Q11, Q12, Q13, Q14, Q21, Q22, Q23, Q24 and Qgoal with the target point Qgoal;
the coordinates of the candidate expansion point are expressed as follows, assuming that the abscissa of the target point Qgoal in the natural coordinate system is Xg and the ordinate is Yg, the abscissa X1n and the ordinate Y1n of the candidate expansion point Q1n are expressed as follows:
the abscissa X2n and the ordinate Y2n of the candidate expansion point Q2n are expressed as follows:
n=1、2、3、4
B. initializing a random tree
And B1, initializing a task map, expanding the obstacle to generate a map model, and defining points except the obstacle and the obstacle expansion area as a feasible area. The search random tree Ts is initialized, the starting point Qstart and the target point Qgoal are initialized, and the starting point is added to the search random tree Ts.
B2, setting the expansion step length as Lp, setting the candidate expansion selection probability as P0, and setting the target point connection judgment distance as r0;
C. forming a guide path for the target point
And directly connecting all candidate expansion nodes generated by the same interval angle alpha to form guide paths, removing points from the target points to the points except between the obstacles through pruning if the connected paths collide with the obstacles, directly connecting when a random search tree Ts grows to any node distance of the guide paths to be shorter than r0, generating an initial path, and then carrying out reverse pruning optimization paths. The specific method is that the connection between nodes generated by the same interval angle alpha is checked to see if the connection collides with an obstacle according to the sequence of the interval angle alpha from small to large from a target point, if the connection does not collide, the node is reserved, the obstacle collision check is carried out on the node and the previous node, and if the connection collides, all nodes except the node reserved by the collision check are deleted.
The method for determining the Qexp for the expansion point by using one random probability check is as follows:
Generating random numbers Prand in the range of 0-1, comparing the random numbers Prand with candidate expansion selection probability P0, randomly generating an expansion point Qexp in the barrier-free area if Prand > P0, selecting a queue head node from a candidate queue as the expansion point Qexp if Prand < = P0, and simultaneously removing the point from the queue and inserting the point into the queue tail.
D. Searching a node Qnearest closest to the expansion point in the random tree;
The random tree Ts is searched in a traversing mode, and the node closest to Qexp in the random tree is calculated to be Qnearest.
E. Generating new nodes
Expanding the step length Lp from the node Qnearest to the node Qexp direction to generate a new node Qnew;
F. judging whether collision occurs between the node Qnear and Qnew and the obstacle
Judging whether the nodes on the connecting lines of the nodes Qnew and Qnearest collide with the obstacle and the expansion area thereof, judging that the collision occurs if the connecting lines of the nodes intersect with the expansion layer of the map, and otherwise judging that the collision does not occur. C, if collision occurs, discarding the node Qnew, and returning to the step C, otherwise, adding the node Qnew into the search random tree;
G. determine whether to reach the target point Qgoal or any node in the guidance path
And (C) sequentially checking the relative distance between the new node Qnew searching the random tree and the point on the candidate expansion queue, judging that the new node reaches the target point if the relative distance is smaller than r0, sequentially checking the nearest node from the target point to generate an initial path, and otherwise, returning to the step (B). The relative distance is calculated by using the Euclidean distance calculation method, and if the abscissa of the node Qnew is Xnew and Ynew respectively and the ordinate of the node Qopt to be checked in the candidate expansion queue is Xopt and Yopt respectively, the relative distance between Qnew and Qopt is:
Further, the interval angle alpha=10-20 degrees, R2 is 2-4 times of R1, and R1 is 0.1-0.2 times of m.
Compared with the prior art, the invention has the following beneficial effects:
1. because a new candidate expansion queue is added, probability expansion is not limited to the target point any more, and the problem that the original Goal-basedRRT is easy to fall into local optimum when approaching the target point is solved;
2. the invention adds a new target point guiding path, which can generate an initial path faster and ensure the path quality.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Fig. 1 shows a generation rule of candidate expansion queue nodes, wherein a black dot at the lower left corner in the diagram represents a starting point position, the abscissas and ordinates thereof are respectively represented as Xstart and Ystart, a black dot at the upper right corner in the diagram represents a target position, the abscissas and ordinates thereof are respectively represented as Xgoal and Ygoal, a target point Qgoal is used as an endpoint, a line segment is expanded outwards at intervals of an angle alpha at two sides of a line segment L, n line segments L1, L2 and L3 are expanded according to scene and performance requirements, and alpha is selected as 15 deg. Taking the target point Qgoal as a circle center, taking R1 and R2 as radiuses to make circles, wherein the values of R1 and R2 are related to the distance L of Qstart and Qgoal, R1 = L/8 and R2 = L/4 in figure 1, the two circles intersect with L1, L2, L3 and L4 to generate 8 intersection points, taking the 8 intersection points as candidate expansion points, and forming candidate expansion point queues Q11, Q12, Q13, Q14, Q21, Q22, Q23, Q24 and Qgoal with the target point Qgoal.
Fig. 2 is an overall flow of the present invention, and fig. 3 is a specific flow supplement of Qexp generation in fig. 2.
Fig. 4 is a method for pruning candidate expansion queue nodes, in fig. 4, an obstacle is added, and it is calculated and determined that the connection lines between Q13 and Q23 and Q14 and Q24 pass through the obstacle area, and at this time, Q23 and Q24 are removed from the candidate expansion queue.
The present invention is not limited to the present embodiment, and any equivalent concept or modification within the technical scope of the present invention is listed as the protection scope of the present invention.