Mobile robot path planning method based on improved A-star algorithm
By improving the A-star algorithm and combining the DWA and MPC algorithms, the deficiencies of the A* algorithm in path planning in unknown obstacle environments are solved, effective planning and dynamic adjustment of robot paths in unknown obstacle environments are achieved, and path search is improved. Speed and control optimization.
Patent Information
- Application Number
- CN202410651128.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-27
AI Technical Summary
The A* algorithm is difficult to generate excellent paths in an unknown obstacle environment and cannot flexibly adjust to adapt to environmental changes, resulting in path planning failure.
The improved A-star algorithm increases the weight coefficient and bidirectional search, and combines the DWA and MPC algorithms to obtain the global path and adjust local path planning to dynamically avoid unknown obstacles.
Effectively plan robot paths in unknown obstacle environments, improve path search speed and accuracy, and achieve dynamic adjustment and optimized motion control.
Smart Images

Figure CN118550299A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of path planning, and in particular to a mobile robot path planning method based on an improved A-star algorithm. Background Art
[0002] In the field of path planning, the A* algorithm is a classic heuristic search algorithm used to find the best path between two points. The algorithm searches for the optimal path by comprehensively considering the actual cost and the estimated cost, and has been successful in many practical applications. However, the A* algorithm has some shortcomings in known environments, mainly in that it fails to effectively handle unknown obstacles.
[0003] In a static environment, if unknown obstacles appear, the A* algorithm cannot adapt and handle them well, which may result in the generated path being not good enough or planning failure. The A* algorithm does not consider the impact of unknown obstacles on the path when planning the path, so it cannot flexibly adjust the path to adapt to environmental changes. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art.
[0005] To this end, the present invention provides a mobile robot path planning method based on an improved A-star algorithm, which can be used to plan the path of the robot and control the movement of the robot in an environment with unknown obstacles.
[0006] According to a first aspect of the present invention, a mobile robot path planning method based on an improved A-star algorithm is provided, comprising the following steps:
[0007] S1. The robot obtains the environmental information around the current map and establishes a grid map, establishes an obstacle-free state area and an obstacle state area in each grid, and plans the starting node and the target node according to the established grid map;
[0008] S2. Improve the traditional A-star algorithm to obtain extended paths in more directions, and perform bidirectional search through the improved A-star algorithm to obtain the optimal path;
[0009] S3, add weight coefficients to the cost function in the improved A-star algorithm to make the entire cost closer to the actual cost;
[0010] S4. Based on the global path obtained by the A-star algorithm, the global path is discretized into multiple path points, and the DWA algorithm is used to adjust the local path planning. The multiple path points are used as reference points for local path planning and control, so that the local planning can follow the optimal path of the global planning;
[0011] S5. Perform local path planning control through the MPC algorithm to control the robot to move along the optimal path planned globally and avoid unknown obstacles on the planned path.
[0012] The beneficial effects of the present invention are that the A-star algorithm can be used to plan the path of a robot and control the movement of the robot in an environment with unknown obstacles, and the improved A-star algorithm is used to search for the shortest path between two points, and the DWA algorithm is used to dynamically adjust the path, while the MPC algorithm is used to predict and optimize the movement of the robot, so that the robot can be planned and controlled in an environment with unknown obstacles.
[0013] Preferably, the improved A-star algorithm searches for neighboring nodes from at least eight surrounding directions.
[0014] Further preferably, the improved A-star algorithm performs a bidirectional search, wherein the bidirectional search includes searching from the start node to the target node and searching from the target node to the start node at the same time.
[0015] Preferably, the search starting from the starting node is defined as a forward search, and the search starting from the target node is defined as a reverse search. The positions of the starting node and the ending node are determined at the same time. The current nodes of the forward search and the reverse search both use the other party's current node as the target node to calculate the cost value and search. If the same node exists in the nodes expanded in the forward and reverse directions, it indicates that a shortest path has been found.
[0016] Further preferably, the total cost calculation formula for the forward search and reverse search directions is: Among them G 1 is the actual cost from the current node to the starting node during forward search, H 1 is the estimated cost from the current node to the target node during forward search, F 1 is the total cost of the forward search. Similarly, G 2 is the actual cost from the current node to the end node during reverse search, H 2 is the estimated cost from the current node to the target node during reverse search, F 2 is the total cost of the reverse search.
[0017] Preferably, the improved cost function is:
[0018] Where r refers to the actual cost from the current node to the target node, and R refers to the actual cost from the starting node to the ending node (regardless of the direction, the actual cost from the current node to the target node is the same, so the same letter r is used). It refers to the ratio of the actual cost from the current node to the target node to the actual cost from the start node to the end node.
[0019] More preferably, And when we first set out, The larger the value, the faster it can approach the target node. The closer it is to the target node, The value will gradually decrease to make the overall cost closer to the actual cost.
[0020] Preferably, in the improved DWA algorithm, the evaluation function is:
[0021] G(v,ω)=σ(αhead(v,ω)+βdist(v,ω)+γvel(v,ω)+μDist(v,ω)),
[0022] Among them, σ represents the smoothing coefficient, α, β, γ, and μ are all weighting coefficients; head(v, ω) represents the azimuth evaluation function, that is, the azimuth deviation between the end position direction of the simulated robot trajectory and the target node at the current speed; dist(v, ω) represents the shortest distance between the trajectory and the static obstacle; vel(v, ω) represents the evaluation function of the current simulated speed; Dist(v, ω) represents the shortest distance between the local unknown obstacle and the simulated trajectory.
[0023] Further preferably, when the local path planning control of the robot is performed by the MPC algorithm, the robot state is first predicted, and the state equation of the robot is: n =(I+TA)X n-1 +TBu n-1 +TO, for the prediction of the MPC algorithm, this process is simulated by setting three rolling time domains, assuming that the input is u 0 ,u 1 ,u 2 , then the estimate of the future pose is Among them, X 0 Indicates the current position of the robot.
[0024] Preferably, the deviation between the robot's predicted posture and the path is determined by selecting a path point X with a control cycle length interval ref1 , X ref2 , X ref3 As a reference point, calculate the deviation:
[0025] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0026] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0028] Figure 1 The overall framework flow chart of the mobile robot path planning method based on the improved A-star algorithm of the present invention;
[0029] Figure 2 A flowchart of the creative resource review of the mobile robot path planning method based on the improved A-star algorithm of the present invention;
[0030] Figure 3 The figure is a schematic diagram of a mobile robot model based on the improved A-star algorithm of the present invention.
[0031] Figure 4 A schematic diagram of the expansion direction of the mobile robot path planning method based on the improved A-star algorithm of the present invention relative to the traditional expansion direction;
[0032] Figure 5 The figure is a specific flow chart of the mobile robot path planning method based on the improved A-star algorithm of the present invention. Figure 6 The mobile robot path planning method of the present invention is based on the improved A-star algorithm. Figure 5 A schematic diagram of a moving path further optimized based on the path; Figure 7 The mobile robot path planning method of the present invention is based on the improved A-star algorithm. Figure 6 Schematic diagram of the optimized moving path based on the path to further avoid obstacles. DETAILED DESCRIPTION
[0033] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0034] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "top", "bottom", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0035] See also Figure 2 ,The figure uses a Cartesian coordinate system to describe the position information, where the XOY coordinate system is the world coordinate system, representing the position of the map environment, the xoy coordinate system is the Kobuki chassis coordinate system of the Turtlebot2 mobile robot, o is the chassis center of the mobile robot, and x is the dot pointing to the direction of the driving wheel.
[0036] The robot is a two-wheel differential mobile robot. Its linear velocity v(t) and angular velocity ω(t) can be used to represent the motion state of the mobile robot. θ(t) represents the azimuth at time t. After a short time interval Δt, each arc path can be approximated as a straight line path. Assuming a straight line motion, the motion model of the simulation robot can be expressed by the formula:
[0037] x(t+1)=x(t)+v(t)Δtcosθ(t)
[0038] y(t+1)=y(t)+v(t)Δtsinθ(t)
[0039] θ(t+1)=θ(t)+ω(t)Δt
[0040] Where x(t), y(t) are the coordinate values of the mobile robot at time t, θ(t) is the azimuth of the mobile robot at time t, x(t+1), y(t+1) are the coordinate values of the mobile robot at time y(t+1), θ(t+1) is the azimuth of the mobile robot at time (t+1), v(t) is the linear velocity of the mobile robot at time t, and ω(t) is the angular velocity of the mobile robot at time t.
[0041] See also Figure 1 A specific implementation of the present invention is a mobile robot path planning method based on an improved A-star algorithm, which uses the improved A-star algorithm to search for the shortest path between two points, and uses the DWA algorithm to dynamically adjust the path, and uses the MPC algorithm to predict and optimize the robot's motion, specifically including the following steps:
[0042] S1. The robot obtains the environmental information around the current map and establishes a grid map, establishes an obstacle-free state area and an obstacle state area in each grid, and plans the starting node and the target node according to the established grid map;
[0043] S2. Improve the traditional A-star algorithm to obtain extended paths in more directions, and perform bidirectional search through the improved A-star algorithm to obtain the optimal path;
[0044] S3, add weight coefficients to the cost function in the improved A-star algorithm to make the entire cost closer to the actual cost;
[0045] S4. Based on the global path obtained by the A-star algorithm, the global path is discretized into multiple path points, and the DWA algorithm is used to adjust the local path planning. The multiple path points are used as reference points for local path planning and control, so that the local planning can follow the optimal path of the global planning;
[0046] S5. Perform local path planning control through the MPC algorithm to control the robot to move along the optimal path planned globally and avoid unknown obstacles on the planned path.
[0047] See also Figure 3 to Figure 4 , and in S2, the search neighbor node of the improved A-star algorithm in the present application is improved to 8 directions from the traditional 4 directions of up, down, left and right, and the sequence number on the direction table is so as to be easy to understand. Adopt this expansion mode as long as there is a path on the map, no matter how complicated the map is, the final path can be found, and the search speed is faster than the search of four directions. And the two-way search mode used by the improved A-star algorithm is: when searching from the starting node to the target node, also search from the target node to the starting node. During search, it is defined as forward search from the starting node, and it is reverse search from the target node, and the position of the starting node is determined. The current node of each forward and reverse direction is used as the target node to calculate the cost value and search, if there is the same node in the node expanded from the positive and negative directions, then it is explained that a shortest path has been found, and the nodes expanded from the positive and negative directions are connected to be this shortest path, which greatly reduces the search time.
[0048] The total cost of the forward and reverse search directions is calculated as: Among them G 1 is the actual cost from the current node to the starting node during forward search, H 1 is the estimated cost from the current node to the target node during forward search, F 1 is the total cost of the forward search. Similarly, G 2is the actual cost from the current node to the end node during reverse search, H 2 is the estimated cost from the current node to the target node during reverse search, F 2 is the total cost of the reverse search.
[0049] At the same time, in order to improve the search speed and ensure the accuracy of the path, a weight coefficient is added to the cost function. And for the initial path extending outward from the starting node or the target node, it is more important to reach the destination quickly, and the closer to the target node, the more important the best path to the destination is. Therefore, the improved cost function is: in r refers to the actual cost from the current node to the target node, and R refers to the actual cost from the starting node to the ending node (regardless of the direction from which the actual cost from the current node to the target node is the same, so the same letter is used r ), It refers to the ratio of the actual cost from the current node to the target node to the actual cost from the start node to the end node. And when we first set out, The larger the value, the faster it can approach the target node. The closer it is to the target node, The value will gradually decrease to make the entire cost closer to the actual cost, which not only speeds up the search but also ensures the accuracy of the path.
[0050] In addition, after obtaining the global path through the A-star algorithm, it is also necessary to plan and adjust the local path. Here, the DWA algorithm needs to be used for planning. Through the complementarity between global planning and local planning, the global planning can avoid obstacles well when encountering unknown obstacles, and the local planning can travel along the best route of the global planning. The evaluation function is:
[0051] G(v,ω)=σ(αhead(v,ω)+βdist(v,ω)+γvel(v,ω)+μDist(v,ω)),
[0052] Among them, σ represents the smoothing coefficient, α, β, γ, and μ are all weighting coefficients; head(v, ω) represents the azimuth evaluation function, that is, the azimuth deviation between the end position direction of the simulated robot trajectory and the target node at the current speed; dist(v, ω) represents the shortest distance between the trajectory and the static obstacle; vel(v, ω) represents the evaluation function of the current simulated speed; Dist(v, ω) represents the shortest distance between the local unknown obstacle and the simulated trajectory.
[0053] Furthermore, after planning the global path and the dynamic adjustment of the local path, the robot's motion is controlled and predicted through the MPC algorithm. The goal is to achieve stable and optimal control of the system under certain performance indicators by optimizing the solution of the problem. Therefore, when controlling the robot, the robot mathematical model formula is rewritten as the general form of the state equation: The solution is obtained by optimizing the computer and linearized using the first-order Taylor formula: where x r ,y r ,θ r , v r ,ω r is the current state of the mobile robot, have to In order to obtain the posture state of the mobile robot, the state equation is processed by first-order difference: T is the control period, and we can get: X n =(I+TA)X n-1 +TBu n-1 +TO.
[0054] Then the MPC algorithm is used to predict the state of the robot's motion. Here, three rolling time domains are used to introduce this process. The input is set to u 0 ,u 1 ,u 2 The estimate of the future pose is Where X 0 Indicates the current position of the mobile robot.
[0055] The purpose of the MPC algorithm is to control the robot to follow a given path. To this end, the deviation between the robot's predicted posture and the path should be calculated. Here, a path point X with a control cycle length interval is selected. ref1 , X ref2 , X ref3 As a reference point to calculate the deviation: make
[0056] have to
[0057] In order to achieve a good control effect, an objective function needs to be defined as an indicator. During the movement process, the closer the robot's movement trajectory is to the planned path, the better, which is related to the deviation Y, and the smoother the robot runs, the better, that is, the smaller the speed change, which is related to the output U. Therefore, the objective function J = Y can be briefly defined T QY+U T RU, the constraint condition is m≤gU≤n, and we can get The constraint condition is m≤gU≤n. Solve the above equation and replace the first term u 0 It should be noted that some of the letters in the calculation process in the above formula are only used for temporary representation to facilitate writing and calculation, and have no specific meaning.
[0058] See also Figures 5 to 7 , Therefore, the improvement process of the algorithm is as follows:
[0059] 1. Initialize the improved expansion direction, evaluation function, etc., and create 4 lists: open1, open2, colse1, close2.
[0060] 2. Set the starting node start to the current node S of the forward search 1 And put it into the open1 list.
[0061] 3. Set the target node target to the current node S of the reverse search 2 And put it into the open2 list.
[0062] 4. Forward search for the current node S 1 Add the expandable points to the open1 list. Set the start node start as the parent node of the newly added node. Delete the start node start from the open1 list and add it to the close1 list.
[0063] 5. Reverse search for the current node S 2 Add the expandable points to the open2 list. Set the target node as the parent node of the newly added node. Delete the target node from the open2 list and add it to the close2 list.
[0064] 6. Repeat the following steps:
[0065] ①: Traverse the open1 list and find the evaluation function F 1 The node with the smallest value is set as the forward node S 1 .
[0066] ②S 1 Delete from the open1 list and add to the close1 list.
[0067] ③ Check S 1 The nodes that can be reached around the point are searched, and the nodes or obstacles that are already in the close1 list are ignored. If the reachable node is not in the open1 list, it is added to the open1 list, and S 1If the reachable node exists in the open1 list, the node is called x node, and the calculation is done through S 1 Point to the G of the x node 1 Value, if the G 1 The value is smaller than the original G 1 value, then S 1 Point as the parent node of the x node, update the F in the open1 list 1 and G 1 .
[0068] ④Traverse the open2 list and find the evaluation function value F 2 The node with the smallest value is set as the reverse current node S 2 .
[0069] ⑤S 2 Delete from the open2 list and add to the close2 list.
[0070] ⑥ Check S 2 The nodes that can be reached around the point are searched, and the nodes or obstacles that are already in the close2 list are ignored. If the reachable node is not in the open2 list, it is added to the open2 list, and S 2 If the reachable node exists in the open2 list, the node is called the y node, and the calculation is done through S 2 Point reaches the G of the y node 2 Value, if the G 2 The value is smaller than the original G 2 value, then S 2 Point is the parent node of the y node, and the F in the open1 list is updated 2 and G 2 .
[0071] Termination conditions:
[0072] 1) When the open1 list contains points in the close2 list or the open2 list contains points in the close1 list, the preliminary path planning is successful and the shortest path is backtracked.
[0073] 2) When either the open1 list or the open2 list is empty, path finding fails and a path planning failure prompt is output.
[0074] 7. Use the DWA algorithm to optimize the path on the above shortest path. The DWA algorithm calculates the maximum speed and maximum turning range that the robot can perform based on the dynamic constraints of the robot and the obstacles in the environment, and then calculates the cost of each speed and turning angle, and selects the speed and turning angle with the minimum cost as the control instruction of the robot, that is, the DWA algorithm is performed based on the path points of the shortest path to generate dense trajectory points with speed.
[0075] 8. Input the control instructions into the MPC algorithm to predict the robot's future trajectory and control instructions. The MPC algorithm uses the robot's dynamic model and obstacle information in the environment to predict the robot's trajectory and control instructions in the future and calculate the cost function of the trajectory.
[0076] 9. Draw the improved bidirectional A* path and DWA trajectory on the map and dynamically update the MPC results in real time. The termination condition is: draw to the end point.
[0077] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or multiple embodiments or examples in a suitable manner.
[0078] The above description is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A mobile robot path planning method based on improved A-star algorithm, It is characterized in that The following steps are involved: S1. The robot obtains the environmental information around the current map and establishes a grid map, establishes an obstacle-free state area and an obstacle state area in each grid, and plans the starting node and the target node according to the established grid map; S2. Improve the traditional A-star algorithm to obtain extended paths in more directions, and perform bidirectional search through the improved A-star algorithm to obtain the optimal path; S3, add weight coefficients to the cost function in the improved A-star algorithm to make the entire cost closer to the actual cost; S4. Based on the global path obtained by the A-star algorithm, the global path is discretized into multiple path points, and the DWA algorithm is used to adjust the local path planning. The multiple path points are used as reference points for local path planning and control, so that the local planning can follow the optimal path of the global planning; S5. Perform local path planning control through the MPC algorithm to control the robot to move along the optimal path planned globally and avoid unknown obstacles on the planned path.
2. The mobile robot path planning method based on the improved A-star algorithm according to claim 1, It is characterized in that The improved A-star algorithm searches for neighboring nodes from at least eight surrounding directions.
3. The mobile robot path planning method based on the improved A-star algorithm according to claim 1, It is characterized in that The improved A-star algorithm performs a bidirectional search, which includes searching from a starting node to a target node and from a target node to a starting node at the same time.
4. The mobile robot path planning method based on the improved A-star algorithm according to claim 3, It is characterized in that Define the search starting from the start node as forward search and the search starting from the target node as reverse search. At the same time, determine the positions of the start node and the end node. The current nodes of the forward search and the reverse search use the other party's current node as the target node to calculate the cost value and search. If the same node exists in the nodes expanded in the forward and reverse directions, it means that a shortest path has been found.
5. The mobile robot path planning method based on the improved A-star algorithm according to claim 4, It is characterized in that The total cost calculation formula for the forward search and reverse search directions is: Among them G 1 is the actual cost from the current node to the starting node during forward search, H 1 is the estimated cost from the current node to the target node during forward search, F 1 is the total cost of the forward search. Similarly, G 2 is the actual cost from the current node to the end node during reverse search, H 2 is the estimated cost from the current node to the target node during reverse search, F 2 is the total cost of the reverse search.
6. The mobile robot path planning method based on the improved A-star algorithm according to claim 3, It is characterized in that The improved cost function is: in r refers to the actual cost from the current node to the target node, and R refers to the actual cost from the starting node to the ending node (regardless of the direction from which the actual cost from the current node to the target node is the same, so the same letter is used r ), It refers to the ratio of the actual cost from the current node to the target node to the actual cost from the start node to the end node.
7. The mobile robot path planning method based on the improved A-star algorithm according to claim 5, It is characterized in that And when we first set out, The larger the value, the faster it can approach the target node. The closer it is to the target node, The value will gradually decrease to make the overall cost closer to the actual cost.
8. The mobile robot path planning method based on the improved A-star algorithm according to claim 5, It is characterized in that In the improved DWA algorithm, the evaluation function is: G(v,ω)=σ(αhead(v,ω)+βdist(v,ω)+γvel(v,ω)+μDist(v,ω)), Among them, σ represents the smoothing coefficient, α, β, γ, and μ are all weighting coefficients; head(v, ω) represents the azimuth evaluation function, that is, the azimuth deviation between the end position direction of the simulated robot trajectory and the target node at the current speed; dist(v, ω) represents the shortest distance between the trajectory and the static obstacle; vel(v, ω) represents the evaluation function of the current simulated speed; Dist(v, ω) represents the shortest distance between the local unknown obstacle and the simulated trajectory.
9. The mobile robot path planning method based on the improved A-star algorithm according to claim 1, It is characterized in that When the MPC algorithm is used to control the local path planning of the robot, the robot state is first predicted. The state equation of the robot is: n =(I+TA)X n-1 +TBu n-1 +TO, for the prediction of the MPC algorithm, this process is simulated by setting three rolling time domains, assuming that the input is u 0 ,u 1 ,u 2 , then the estimate of the future pose is Among them, X n Indicates the current position of the robot.
10. The mobile robot path planning method based on the improved A-star algorithm according to claim 9, It is characterized in that The deviation between the robot's predicted pose and the path is determined by selecting a path point X with a control cycle length interval ref1 , X ref2 , X ref3 As a reference point, calculate the deviation:
Citation Information
Cited By
Mechanical arm collision detection method based on low-difference sequence uniform sampling
CN119458346A
Security-enhanced trajectory planning method based on Astar algorithm
CN120779970A
A safety-enhanced trajectory planning method based on Astar algorithm
CN120779970B
Path planning method for autonomous mobile device, autonomous mobile device, and readable storage medium
WO2026227559A1
