A robot obstacle avoidance path planning method based on improved APF-RRT algorithm

By improving the APF-RRT algorithm and combining the obstacle number parameter and the RRT algorithm, the problems of low efficiency and poor path quality in traditional robot obstacle avoidance path planning are solved, and more efficient and smoother robot motion path planning is achieved.

CN115570566BInactive Publication Date: 2024-08-30CHANGCHUN UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211189700.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional robot obstacle avoidance path planning algorithms are inefficient and have poor path quality in six-degree-of-freedom robots. It is difficult to balance speed and optimality, and there are problems such as large running memory usage.

Method used

The improved APF-RRT algorithm combines the number of obstacles parameters, algorithm switching strategy, bilateral nearest node selection strategy, node quadratic expansion strategy, cone subset constrained sampling and target guidance, and uses an improved artificial potential field function and RRT algorithm to remove Redundant nodes and smooth paths using non-uniform rational B-splines.

Benefits of technology

It improves the efficiency of algorithm operation, shortens the path length, improves the smoothness and path quality of robot movement, and reduces memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115570566B
    Figure CN115570566B
Patent Text Reader

Abstract

The present invention discloses a robot obstacle avoidance path planning method based on an improved APF-RRT algorithm. Under the condition that a starting position, a target position and obstacle environment information are known, the improved APF-RRT algorithm is used, and an obstacle number parameter and an algorithm switching strategy are introduced to avoid that a traditional APF algorithm cannot reach a target point and falls into a local minimum. A bilateral nearest node selection strategy, a node twice expansion strategy, a hybrid sampling strategy combining cone subset constraint sampling and target guidance are introduced to accelerate the convergence efficiency of the improved RRT algorithm. The obstacle avoidance path is clipped and smoothed by removing redundant nodes and using a cubic non-uniform rational B-spline curve smoothing strategy. The proposed improved APF-RRT algorithm reduces the path length, improves the algorithm efficiency, and can be well applied to the robot obstacle avoidance path planning problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of robot obstacle avoidance path planning, and in particular to a robot obstacle avoidance path planning method based on an improved APF-RRT algorithm. Background Art

[0002] Robots play an extremely important role in the development of automation and intelligence. As the working environment becomes more and more complex, the requirements for their working accuracy and efficiency are also increasing. Robot obstacle avoidance path planning is an important issue in the industrial application process of robots, that is, given the starting position and target position, a continuous path is planned in the workspace that does not collide with the robot body, obstacles, and the surrounding environment. Traditional path planning algorithms mainly include Dijkstra algorithm, A* algorithm, artificial potential field method (APF), etc. These algorithms have good performance in mobile robot obstacle avoidance path planning, but in the obstacle avoidance path planning of six-degree-of-freedom robots, due to the high spatial dimension, the success rate and operation efficiency of traditional path planning algorithms are seriously reduced. In response to these problems, the commonly used methods in the obstacle avoidance path planning of six-degree-of-freedom robots are: RRT algorithm (rapidly expanding random tree), RRT-Connect algorithm (bidirectionally rapidly expanding random tree), RRT* algorithm (rapid asymptotic optimization), etc. The traditional fast random tree algorithm has a good effect in robot path planning in different dimensions. After continuous sampling, the entire state space will be fully explored and an obstacle avoidance path will be generated. However, the sampling method of the algorithm is completely random. After expanding the new nodes of the search tree in this way, the efficiency of the algorithm and the quality of the path cannot be guaranteed. The traditional RRT-Connect algorithm constructs search trees at the initial position and the target position respectively, and uses the interactive expansion of the two search trees to search for the working path. Compared with the traditional RRT algorithm, the algorithm speed is accelerated, but the exploration direction of the RRT-Connect algorithm is still random, and the path quality has not been significantly improved. The RRT* algorithm optimizes the path quality by reselecting the parent node and rewiring. Compared with the first two algorithms, the RRT* algorithm can obtain a better path, but the amount of calculation will increase accordingly, and the algorithm running time is longer. Therefore, the improved algorithm based on RRT still has problems such as difficulty in balancing rapidity and optimality and large memory usage. Summary of the invention

[0003] In view of the defects and shortcomings of the prior art, the purpose of the present invention is to provide a robot obstacle avoidance path planning method based on an improved APF-RRT algorithm. Compared with the traditional APF algorithm and the traditional RRT algorithm, the scheme organically integrates the obstacle number parameter, algorithm switching strategy, bilateral nearest node selection strategy, node secondary expansion strategy, hybrid sampling strategy combining cone subset constraint sampling and target guidance, redundant node removal strategy, and cubic non-uniform rational B-spline curve smoothing strategy, which can not only improve the algorithm operation efficiency and shorten the path length, but also allow the robot to run smoothly.

[0004] The present invention proposes a robot obstacle avoidance path planning method based on an improved APF-RRT algorithm, which specifically includes the following steps:

[0005] Step 1: Obtain the workspace and obstacle environment information and set the robot's starting position q in the joint space init 、Target position q goal , step length L, path node set S;

[0006] Step 2: Calculate the distance between the current node and the obstacle; if the distance between the current node and the nearest obstacle is greater than twice the step length, execute step 3; if the distance between the current node and the nearest obstacle is less than twice the step length, execute step 4;

[0007] Step 3: Introduce the number of obstacles as a potential field parameter and use the modified artificial potential field function to make q goal For the current node q nearest Generates attraction, making the obstacle nearest Generate repulsive force, q nearest Generate a new node q along the direction of the resultant force of the two forces according to the given step length L new ;

[0008] The improved artificial potential field includes the gravitational field function U att (q) As shown in formula 1, the repulsive field function U rep (q) As shown in Equation 2, the resultant potential field U sum The function is shown in formula 3:

[0009]

[0010]

[0011] U sum =U att (q)+∑U rep (q) (3)

[0012] Among them, ε is the coefficient of the gravitational potential field, σ is the coefficient of the repulsive potential field, d(q,qgoal ) represents the Euclidean distance between the current position and the target position, d(q,q obs ) represents the Euclidean distance between the current position and the obstacle center, d0 is the obstacle influence radius, and n is the number of obstacles. The magnitudes of gravitational force and repulsive force are the negative gradients of gravitational field function and repulsive field function, respectively, as shown in equations (4) and (5). The resultant force F sum As shown in formula (6), the repulsive force F rep1 and F rep2 As shown in equations (7) and (8):

[0013]

[0014]

[0015] F sum (q) = F att (q)+∑F rep (q) (6)

[0016]

[0017]

[0018] in, represents d(q,q goal ), F rep1 The direction is from the obstacle to the current position, F rep2 The direction points from the current position to the target point. When there is an obstacle near the target point, the robot is subject to a larger repulsive force and a smaller gravitational force, and may be unable to reach the target point. Through the improved repulsive field function, when the robot approaches the obstacle, the repulsive force it receives becomes smaller as the distance gets closer, thus avoiding the problem of unreachable targets.

[0019] The improved APF algorithm is used to search and advance under the combined action of the target point and obstacles. (1) The starting position q initThe first step is to calculate the attraction and repulsion of the path point as the initial node, and then generate a new node with a step length L from the current node according to the direction of the resultant force; (2) determine whether the attraction and repulsion of the new node are equal and opposite in direction. If they are equal and opposite in direction, it proves that the new node is trapped in the local minimum. Execute step 4 and use the improved RRT algorithm to generate the next node until a node jumps out of the local minimum. Add the node to the path node set S and re-execute step 3 at the node to search the path; if the attraction and repulsion are not equal and opposite in direction, save the new node to the path node set S and continue to execute steps; (3) calculate the distance between the node and the nearest obstacle. If the distance between the node and the nearest obstacle is less than twice the step length, jump to step 4; otherwise, continue to execute steps; (4) determine whether the current node is close to the target position q goal Is the distance less than the step size L? If the distance between the node and the target position q is less than the step size L, the target position q is moved to the goal Add it to the path node set S, end the algorithm, and save the path node set S; otherwise, re-execute step 3 and continue the path search;

[0020] Step 4: Use the improved RRT algorithm to search for paths; (1) Initialize the random search tree and obtain the starting position q init 、Target position q goal , step length L, path node set S, starting position q init As the root node of the random search tree, there is only one node q in the tree at this time init ; (2) Using uniform sampling, randomly generate probability P in the interval [0, 1] rand , set P = 0.5, if the random probability P rand is less than the target bias rate P, the sampling point q rand Select the target position q goal ; If it is greater than or equal to the target bias rate P, then a randomly generated sampling point q in the workspace rand , sampling point q rand The selection formula of is shown in formula (9);

[0021]

[0022] Bilateral closest node selection strategy: When the sampling point is not the target location q goal When , a sampling point is randomly selected in the workspace, and the line connecting the random sampling point and the node in the random search tree is used as one edge, and the line connecting the random sampling point and the target point is used as another edge. The sum of the bilateral distances is calculated as the cost function for selecting the nearest node. The cost function is shown in formula (10);

[0023]

[0024] λ and μ are scaling factors, respectively, ||q rand -q|| represents the Euclidean distance between the random sampling point and the node on the random search tree, ||qq goal || represents the Euclidean distance between the random sampling point and the target point. Applying the golden ratio division coefficient, we can get λ:μ=1.618, and the nearest node is selected as: q nearest = min(W(q));

[0025] Node secondary expansion strategy: When the new node q new1 After successful sampling, expand the next new node q new2 When the cone subset constraint sampling and target guidance are combined, a hybrid sampling strategy is adopted, that is, the new node q obtained by the first node expansion is new1 Point to the target position q goal The direction of the cone subset is taken as the direction of its height. The radius r of the base of the cone subset is equal to the step length L in the algorithm. The length of the generatrix of the cone subset is also equal to the step length L. The vertex of the cone subset is the node q new1 , the new node q of the secondary expansion new2 Randomly select from the bottom edge M of the cone subset; generate a new node q new2 Then perform collision detection. If q new1 and q new2 If the line collides with an obstacle, the new node q is abandoned. new2 , if there is no collision, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of

[0026] (3) Use the bilateral closest node selection strategy to select the closest node. nearest Point to sampling point q rand Expand in the direction of step length L to obtain a new node q new , perform collision detection to determine whether the line connecting the new node and the nearest node collides with an obstacle. If a collision occurs, discard the new node q new , re-execute (2); if there is no collision, the new node q new Add to the random search tree and add the new node q new The parent node is assigned to the nearest node q nearest ; In the generated new node q new1 On the top, the node secondary expansion strategy is used to generate a new node q new2 , generate a new node q new2 Then perform collision detection. If q new1 and q new2 The line collides with an obstacle and the new node q is discarded.new2 , continue to execute (4), otherwise, if q new1 and q new2 If the line connecting the nodes does not collide with the obstacle, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of the random search tree continues to execute (4); (4) When the node in the random search tree is at the target position q goal When the distance is less than the step length L, the algorithm ends and the target position q goal Add to the random search tree and save the nodes in the random search tree to the path node set S; when the distance between the node in the random search tree and the nearest obstacle is greater than twice the step size, jump to step 3 and execute the improved APF algorithm; otherwise, jump to (2) and continue the path search;

[0027] Step 5: After the improved APF-RRT algorithm is executed, the nodes in the path node set S are connected, and redundant nodes are removed to obtain the processed path S new ;

[0028] Remove redundant nodes: from the starting node q init First, connect the child node of the next node, that is, the third node, and perform collision detection on the connected path. If the path does not collide with the obstacle, delete the middle node, that is, the second node; if a collision occurs, keep the middle node and treat the third node as the initial node q init , repeat the above steps until the path reaches the last path point q end ;

[0029] Step 6: Use the cubic non-uniform rational B-spline curve to smooth the path S, and finally obtain the obstacle avoidance path of the robot; the rational fraction of the non-uniform rational B-spline curve equation is shown in formula (11);

[0030]

[0031] Among them, ω i (i = 0, 1, 2, ..., n) is the weight factor, and the control vertex d i (i=0,1,2,…,n) respectively correspond to weight factors ω0,ω n are all greater than 0, and the rest ω i ≥0, and k consecutive weight factors cannot be zero at the same time; N i,k (u) is the node vector U = [u0, u l ,…,u n+k+1] The k-order canonical B-spline basis function is determined by the DeBoer-Cox recursion formula, i represents the serial number, k is the spline order, for the open curve of the non-uniform rational B-spline curve whose first and last data points are not connected, the repetition degree of the nodes at both ends is usually taken as r = k + 1, that is, u0 = u1 = ... = u k ,u n+1 =u n+2 =……=u n+k+1 ; The end node values ​​are usually 0 and 1, so the domain of the non-uniform rational B-spline curve can be expressed as u∈[u k ,u n+1 ] = [0, 1]; through path S new From the data points in , find the control vertices of the cubic non-uniform rational B-spline curve and use the control vertices to smooth the path.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention provides a robot obstacle avoidance path planning method of an improved APF-RRT algorithm, which improves a traditional APF algorithm by adding the number of obstacles as a parameter in a potential field function, and switching the algorithm when the algorithm falls into a local minimum; improves a traditional RRT algorithm by organically integrating a bilateral nearest node selection strategy, a node secondary expansion strategy, a cone subset constraint sampling, and a hybrid sampling strategy combining target guidance to obtain an improved RRT algorithm; integrates the improved APF algorithm and the improved RRT algorithm to obtain an improved APF-RRT algorithm, removes redundant nodes in the path of the improved APF-RRT algorithm, and uses a cubic non-uniform rational B-spline curve to smooth the path; the proposed improved algorithm reduces the path length and the memory occupied by the algorithm, improves the operation efficiency of the algorithm, and enhances the stability of the robot during movement. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flow chart of a robot obstacle avoidance path planning method of an improved APF-RRT algorithm provided by an embodiment of the present invention;

[0035] Figure 2 is an improved APF potential field diagram provided by an embodiment of the present invention;

[0036] Figure 3 It is a schematic diagram of a node secondary expansion strategy provided by an embodiment of the present invention;

[0037] Figure 4 is a schematic diagram of removing redundant nodes provided by an embodiment of the present invention;

[0038] Figure 5 is a traditional RRT algorithm path diagram provided by an embodiment of the present invention;

[0039] Figure 6 is a P-RRT algorithm path diagram provided by an embodiment of the present invention;

[0040] Figure 7 is a path diagram of the M-RRT algorithm provided by an embodiment of the present invention;

[0041] Figure 8 It is a path diagram of the improved APF-RRT algorithm provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. The embodiments described are only part of the embodiments of the present invention, not all of the embodiments. The protection scope of the present invention is not limited to the following embodiments.

[0043] The present invention proposes a robot obstacle avoidance path planning method based on an improved APF-RRT algorithm, which combines the improved APF algorithm with the improved RRT algorithm to solve the robot obstacle avoidance path planning problem. Figure 1 As shown, it is divided into the following steps:

[0044] Step 1: Obtain the workspace and obstacle environment information, establish the motion model of the six-degree-of-freedom robot, and set the robot's starting position q in the joint space init 、Target position q goal , step length L, path node set S;

[0045] The robot's working space is set as a three-dimensional space of 100cm*100cm*100cm. The obstacle coordinates and radius are (10, 60, 40, 8), (15, 15, 15, 12), (30, 30, 30, 8), (30, 45, 25, 5), (30, 70, 70, 20), (40, 65, 38, 5), (50, 50, 50, 10), (60, 20, 30, 8), (70, 70, 70, 20), (80, 40, 65, 10); the starting position is (5, 5, 5), the target position is (95, 95, 95), the step size is 1cm, and the path node set S = {};

[0046] Step 2: Calculate the distance between the current node and the obstacle; if the distance between the current node and the nearest obstacle is greater than or equal to twice the step length, execute step 3; if the distance between the current node and the nearest obstacle is less than twice the step length, execute step 4;

[0047] Step 3: Introduce the number of obstacles as a potential field parameter and use the modified artificial potential field function to make q goal For the current node q nearest Generates attraction, making the obstacle nearest Generate repulsive force, qnearest Generate a new node q along the direction of the resultant force of the two forces according to the given step length L new ;

[0048] The improved artificial potential field includes the gravitational field function U att (q) As shown in formula 1, the repulsive field function U rep (q) As shown in Equation 2, the resultant potential field U sum The function is shown in formula 3:

[0049]

[0050]

[0051] U sum =U att (q)+∑U rep (q) (3)

[0052] Among them, ε is the coefficient of the gravitational potential field, σ is the coefficient of the repulsive potential field, d(q,q goal ) represents the Euclidean distance between the current position and the target position, d(q,q obs ) represents the Euclidean distance between the current position and the obstacle center, d0 is the obstacle influence radius, and n is the number of obstacles. The magnitudes of gravitational force and repulsive force are the negative gradients of gravitational field function and repulsive field function, respectively, as shown in equations (4) and (5). The resultant force F sum As shown in formula (6), the repulsive force F rep1 and F rep2 As shown in equations (7) and (8):

[0053]

[0054]

[0055] F sum (q) = F att (q)+∑F rep (q) (6)

[0056]

[0057]

[0058] in, represents d(q,q goal ), F rep1 The direction is from the obstacle to the current position, F rep2The direction is from the current position to the target point; when there is an obstacle near the target point, the robot is subject to a larger repulsive force and a smaller gravitational force, and there is a phenomenon that the target point cannot be reached. Through the improved repulsive field function, when the robot approaches the obstacle, the repulsive force it receives becomes smaller as the distance gets closer, avoiding the problem of unreachable targets. The improved APF potential field is as follows Figure 2 As shown;

[0059] The improved APF algorithm is used to search and advance under the combined action of the target point and obstacles. (1) The starting position q init The first step is to calculate the attraction and repulsion of the path point as the initial node, and then generate a new node with a step length L from the current node according to the direction of the resultant force; (2) determine whether the attraction and repulsion of the new node are equal and opposite in direction. If they are equal and opposite in direction, it proves that the new node is trapped in the local minimum. Execute step 4 and use the improved RRT algorithm to generate the next node until a node jumps out of the local minimum. Add the node to the path node set S and re-execute step 3 at the node to search the path; if the attraction and repulsion are not equal and opposite in direction, save the new node to the path node set S and continue to execute steps; (3) calculate the distance between the node and the nearest obstacle. If the distance between the node and the nearest obstacle is less than twice the step length, jump to step 4; otherwise, continue to execute steps; (4) determine whether the current node is close to the target position q goal Is the distance less than the step size L? If the distance between the node and the target position q is less than the step size L, the target position q is moved to the goal Add it to the path node set S, end the algorithm, and save the path node set S; otherwise, re-execute step 3 and continue the path search;

[0060] Step 4: Use the improved RRT algorithm to search for paths; (1) Initialize the random search tree and obtain the starting position q init 、Target position q goal , step length L, path node set S, starting position q init As the root node of the random search tree, there is only one node q in the tree at this time init ; (2) Using uniform sampling, randomly generate probability P in the interval [0, 1] rand , set P = 0.5, if the random probability P rand is less than the target bias rate P, the sampling point q rand Select the target position q goal ; If it is greater than or equal to the target bias rate P, then a randomly generated sampling point q in the workspace rand , sampling point q rand The selection formula of is shown in formula (9);

[0061]

[0062] Bilateral closest node selection strategy: When the sampling point is not the target location q goal When , a sampling point is randomly selected in the workspace, and the line connecting the random sampling point and the node in the random search tree is used as one edge, and the line connecting the random sampling point and the target point is used as another edge. The sum of the bilateral distances is calculated as the cost function for selecting the nearest node. The cost function is shown in formula (10);

[0063]

[0064] λ and μ are scaling factors, respectively, ||q rand -q|| represents the Euclidean distance between the random sampling point and the node on the random search tree, ||qq goal || represents the Euclidean distance between the random sampling point and the target point. Applying the golden ratio division coefficient, we can get λ:μ=1.618, and the nearest node is selected as: q nearest = min(W(q));

[0065] Node secondary expansion strategy: When the new node q new1 After successful sampling, expand the next new node q new2 When the cone subset constraint sampling and target guidance are combined, a hybrid sampling strategy is adopted, that is, the new node q obtained by the first node expansion is new1 Point to the target position q goal The direction of the cone subset is taken as the direction of its height. The radius r of the base of the cone subset is equal to the step length L in the algorithm. The length of the generatrix of the cone subset is also equal to the step length L. The vertex of the cone subset is the node q new1 , the new node q of the secondary expansion new2 Randomly select from the bottom edge M of the cone subset; generate a new node q new2 Then perform collision detection. If q new1 and q new2 If the line collides with an obstacle, the new node q is abandoned. new2 , if there is no collision, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of Figure 3 As shown;

[0066] (3) Use the bilateral closest node selection strategy to select the closest node. nearest Point to sampling point q rand Expand in the direction of step length L to obtain a new node q new , perform collision detection to determine whether the line connecting the new node and the nearest node collides with an obstacle. If a collision occurs, discard the new node qnew , re-execute (2); if there is no collision, the new node q new Add to the random search tree and add the new node q new The parent node is assigned to the nearest node q nearest ; In the generated new node q new1 On the top, the node secondary expansion strategy is used to generate a new node q new2 , generate a new node q new2 Then perform collision detection. If q new1 and q new2 The line collides with an obstacle and the new node q is discarded. new2 , continue to execute (4), otherwise, if q new1 and q new2 If the line connecting the nodes does not collide with the obstacle, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of the random search tree continues to execute (4); (4) When the node in the random search tree is at the target position q goal When the distance is less than the step length L, the algorithm ends and the target position q goal Add to the random search tree and save the nodes in the random search tree to the path node set S; when the distance between the node in the random search tree and the nearest obstacle is greater than twice the step size, jump to step 3 and execute the improved APF algorithm; otherwise, jump to (2) and continue the path search;

[0067] Step 5: After the improved APF-RRT algorithm is executed, the nodes in the path node set S are connected, and redundant nodes are removed to obtain the processed path S new ;

[0068] Remove redundant nodes: from the starting node q init First, connect the child node of the next node, that is, the third node, and perform collision detection on the connected path. If the path does not collide with the obstacle, delete the middle node, that is, the second node; if a collision occurs, keep the middle node and treat the third node as the initial node q init , repeat the above steps until the path reaches the last path point q end , the schematic diagram of removing redundant nodes is as follows Figure 4 As shown;

[0069] Step 6: Use the cubic non-uniform rational B-spline curve to smooth the path S, and finally obtain the obstacle avoidance path of the robot; the rational fraction of the non-uniform rational B-spline curve equation is shown in formula (11);

[0070]

[0071] Among them, ω i (i = 0, 1, 2, ..., n) is the weight factor, and the control vertex d i (i=0,1,2,…,n) respectively correspond to weight factors ω0,ω n are all greater than 0, and the rest ω i ≥0, and k consecutive weight factors cannot be zero at the same time; N i,k (u) is the node vector U = [u0, u l ,…,u n+k+1 ] The k-order canonical B-spline basis function is determined by the DeBoer-Cox recursion formula, i represents the serial number, k is the spline order, for the open curve of the non-uniform rational B-spline curve whose first and last data points are not connected, the repetition degree of the nodes at both ends is usually taken as r = k + 1, that is, u0 = u1 = ... = u k ,u n+1 =u n+2 =……=u n+k+1 ; The end node values ​​are usually 0 and 1, so the domain of the non-uniform rational B-spline curve can be expressed as u∈[u k ,u n+1 ] = [0, 1]; through path S new From the data points in , find the control vertices of the cubic non-uniform rational B-spline curve and use the control vertices to smooth the path;

[0072] Simulation comparison:

[0073] The paths generated by the improved APF-RRT algorithm are compared with those generated by the traditional RRT algorithm, P-RRT algorithm, and M-RRT algorithm. The simulation results are as follows: Figure 5-8 As shown in the figure, it can be seen that the path obtained by the traditional RRT algorithm has many turning points and a long path; the path in the P-RRT algorithm has fewer turning points and a shorter path; the path of the M-RRT algorithm has fewer turning points and a shorter path; the path of the improved APF-RRT algorithm has no turning points, the path is the shortest, and it is more in line with the robot's motion requirements;

[0074] The present invention executes each algorithm 100 times, and records the algorithm's running time, path length and success rate, wherein the success rate refers to the ability to search for a path within 100 seconds and the ability to reach the target location from the starting position. The experimental results are shown in Table 1. The improved APF-RRT algorithm of the present invention improves the search time and path length by 86.72%, 34.19%, 21.43% and 29.61%, 19.19%, 18.21% respectively compared with the RRT algorithm, the P-RRT algorithm and the M-RRT algorithm. The data show that the present invention can significantly reduce the algorithm running time, improve the algorithm convergence speed, and at the same time prove the stability of the present invention.

[0075] Table 14 Algorithm Comparison Results

[0076]

[0077] The above merely illustrates and describes the embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A robot obstacle avoidance path planning method based on an improved APF-RRT algorithm. Features: Under the condition of known starting position, target position and obstacle environment information, the improved APF-RRT algorithm is used to introduce obstacle number parameters and algorithm switching strategies to avoid the traditional APF algorithm from being unable to reach the target point and falling into the local minimum. The bilateral nearest node selection strategy, node secondary expansion strategy, cone subset constraint sampling and target guidance combined hybrid sampling strategy are introduced to accelerate the convergence efficiency of the improved RRT algorithm. The obstacle avoidance path is clipped and smoothed by removing redundant points and using cubic non-uniform rational B-spline curve smoothing strategies to reduce the path length and meet the robot motion requirements. The following steps are involved: Step 1: Obtain the workspace and obstacle environment information and set the robot's starting position q in the joint space init 、Target position q goal , step length L, path node set S; Step 2: Calculate the distance between the current node and the obstacle; if the distance between the current node and the nearest obstacle is greater than twice the step length, execute step 3; if the distance between the current node and the nearest obstacle is less than twice the step length, execute step 4; Step 3: Introduce the number of obstacles as a potential field parameter and use the modified artificial potential field function to make q goal For the current node q nearest Generates attraction, making the obstacle nearest Generate repulsive force, q nearest Generate a new node q along the direction of the resultant force of the two forces according to the given step length L new ; Use the improved APF algorithm to search and move forward under the combined action of the target point and obstacles. (1) Starting position q init The first step is to calculate the attraction and repulsion of the path point as the initial node, and then generate a new node with a step length L from the current node according to the direction of the resultant force; (2) determine whether the attraction and repulsion of the new node are equal and opposite in direction. If they are equal and opposite in direction, it proves that the new node is trapped in the local minimum. Execute step 4 and use the improved RRT algorithm to generate the next node until a node jumps out of the local minimum. Add the node to the path node set S and re-execute step 3 at the node to search the path; if the attraction and repulsion are not equal and opposite in direction, save the new node to the path node set S and continue to execute steps; (3) calculate the distance between the node and the nearest obstacle. If the distance between the node and the nearest obstacle is less than twice the step length, jump to step 4; otherwise, continue to execute steps; (4) determine whether the current node is close to the target position q goal Is the distance less than the step size L? If the node is close to the target position q goal The distance between them is less than the step length L, then the target position q goal Add it to the path node set S, end the algorithm, and save the path node set S; otherwise, re-execute step 3 and continue the path search; Step 4: Use the improved RRT algorithm to search for paths; (1) Initialize the random search tree and obtain the starting position q init 、Target position q goal , step length L, path node set S, starting position q init As the root node of the random search tree, there is only one node q in the tree at this time init ; (2) Using uniform sampling, randomly generate probability P in the interval [0, 1] rand , set P = 0.5, if the random probability P rand is less than the target bias rate P, the sampling point q rand Select the target position q goal ; If it is greater than or equal to the target bias rate P, then a randomly generated sampling point q in the workspace rand ; (3) Use the bilateral closest node selection strategy to select the closest node, at node q nearest Point to sampling point q rand Expand in the direction of step length L to obtain a new node q new , perform collision detection to determine whether the line connecting the new node and the nearest node collides with an obstacle. If a collision occurs, discard the new node q new , re-execute (2); if there is no collision, the new node q new Add to the random search tree and add the new node q new The parent node is assigned to the nearest node q nearest ; In the generated new node q new1 On the top, the node secondary expansion strategy is used to generate a new node q new2 , generate a new node q new2 Then perform collision detection. If q new1 and q new2 The line collides with an obstacle and the new node q is discarded. new2 , continue to execute (4), otherwise, if q new1 and q new2 If the line connecting the nodes does not collide with the obstacle, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of , continues to execute (4); (4) When the node in the random search tree is at the target position q goal When the distance is less than the step length L, the algorithm ends and the target position q goal Add to the random search tree and save the nodes in the random search tree to the path node set S; when the distance between the node in the random search tree and the nearest obstacle is greater than twice the step size, jump to step 3 and execute the improved APF algorithm; otherwise, jump to (2) and continue the path search; Step 5: After the improved APF-RRT algorithm is executed, the nodes in the path node set S are connected, and redundant nodes are removed to obtain the processed path S new ; Step 6: Use a cubic non-uniform rational B-spline curve to align the path S new Smoothing is performed to finally obtain the robot's obstacle avoidance path; The number of obstacles is introduced as a potential field parameter, and the modified artificial potential field function is used to make q goal For the current node q nearest Generates attraction, making the obstacle nearest Generate repulsive force, q nearest Generate a new node q along the direction of the resultant force of the two forces according to the given step length L new ; The improved artificial potential field includes the gravitational field function U att (q) As shown in formula (1), the repulsive field function U rep (q) As shown in formula (2), the resultant potential field U sum The function is shown in formula (3): U sum =U att (q)+ΣU rep (q) (3) Among them, ε is the coefficient of the gravitational potential field, σ is the coefficient of the repulsive potential field, d(q,q goal ) represents the Euclidean distance between the current position and the target position, d(q,q obs ) represents the Euclidean distance between the current position and the obstacle center, d 0 is the obstacle influence radius, n is the number of obstacles; the magnitudes of gravitational force and repulsive force are the negative gradients of gravitational field function and repulsive field function, respectively, as shown in equations (4) and (5), the resultant force F sum As shown in formula (6), the repulsive force F rep1 and F rep2 As shown in equations (7) and (8): F sum =F att (q)+ΣF rep (q) (6) Among them, ▽d(q,q goal ) represents d(q,q goal ), F rep1 The direction is from the obstacle to the current position, F rep2 The direction is from the current position to the target point; when there is an obstacle near the target point, the robot is subject to a larger repulsive force and a smaller attractive force, and there is a phenomenon that the target point cannot be reached. Through the improved repulsive field function, when the robot approaches the obstacle, the repulsive force it receives becomes smaller as the distance gets closer, avoiding the problem of unreachable targets; determine whether the attractive and repulsive forces on the new node are equal and opposite in direction. If they are equal and opposite in direction, it proves that the new node is trapped in the local minimum. Use the improved RRT algorithm to generate the next node until a node jumps out of the local minimum, add the node to the path node set, and use the improved APF algorithm again at the node for path search; Using uniform sampling, randomly generate probability P in the interval [0, 1] rand , if the random probability P rand is less than the target bias rate P (P = 0.5), the sampling point q rand Select the target position q goal ; If it is greater than or equal to the target bias rate P, then a randomly generated sampling point q in the workspace rand , sampling point q rand The selection formula of is shown in formula (9); Use the bilateral closest node selection strategy. The specific process is as follows: When the sampling point is not the target position q goal When , a sampling point is randomly selected in the workspace, and the line connecting the random sampling point and the node in the random search tree is used as one edge, and the line connecting the random sampling point and the target point is used as another edge. The sum of the bilateral distances is calculated as the cost function for selecting the nearest node. The cost function is shown in formula (10); λ and μ are scaling factors, respectively, ||q rand –q|| represents the Euclidean distance between the random sampling point and the node on the random search tree, ||qq goal || represents the Euclidean distance between the random sampling point and the target point. Applying the golden ratio division coefficient, we can get λ:μ=1.618, and the nearest node is selected as: q nearest = min(W(q)); When a new node is expanded, the node secondary expansion strategy is adopted. The specific process is as follows: When the new node q new1 After successful sampling, expand the next new node q new2 When the cone subset constraint sampling and target guidance are combined, a hybrid sampling strategy is adopted, that is, the new node q obtained by the first node expansion is new1 Point to the target position q goal The direction of the cone subset is taken as the direction of its height. The base radius of the cone subset is equal to the step length L in the algorithm. The length of the generatrix of the cone subset is also equal to the step length L. The vertex of the cone subset is the node q new1 , the new node q of the secondary expansion new2 Randomly select from the bottom edge of the cone subset; generate a new node q new2 Then perform collision detection. If q new1 and q new2 If the line collides with an obstacle, the new node q is abandoned. new2 , if there is no collision, the new node q new2 Add to the random search tree and add node q new1 Set as new node q new2 The parent node of After obtaining the robot's obstacle avoidance path using the improved APF-RRT algorithm, the redundant nodes in the path are removed. The specific process is as follows: From the starting node q init First, connect the child node of the next node, that is, the third node, and perform collision detection on the connected path. If the path does not collide with the obstacle, delete the middle node, that is, the second node; if a collision occurs, keep the middle node and treat the third node as the initial node q init , repeat the above steps until the path reaches the last path point q end ; The cubic non-uniform rational B-spline curve is used to smooth the path after removing redundant nodes, and finally the obstacle avoidance path of the robot is obtained.

Citation Information

Patent Citations

  • Mechanical arm path planning method

    CN113084811A