Path Planning Research Based on An Improved A* Algorithmfor Mobile Robot

With the development of technology, the path planning technology of mobile robots has received extensive attention. The principle and process of A* algorithm are outlined. Because there are many break points in the A* algorithm, the path is not smooth and there are too many problems in searching for grid points. So we need improve the A-star algorithm. Firstly, in order to reduce the number of search grid points, a threshold value N is added to the openlist. If the number of search times is greater than N and the first node inserted is not expanded, the node is set to the highest priority. Secondly, we use the path planning based on the combination ofFloyd algorithm and A* algorithm to remove redundant nodes and reduce the sharpness of the breakpoints. Finally, the geometric optimization process results in a smooth path. Simulations verify that the improved A* algorithm reduces the path length and the path is smoother, more suitable for robot navigation.


Introduction
Path planning technology is a hot topic in the research of mobile robots, which lays a foundation for the control of autonomous driving of robots [1]. The definition of path planning can be expressed as: after the starting point and target point are set, search for an optimal route that can avoid obstacles from the starting point to the target point according to the planning algorithm.According to the environmental conditions of the robot, the motion path is divided into two categories: One is the global path planning based on the known map information, and the information in such path planning environment includes all the known obstacles and drivable areas; The other is local path planning that can obtain real-time information based on the camera, inertial navigation, odometer, etc., and the local path planning is in the environment where the obstacle information is unknown [2].Common global path planning algorithms are [3]: A* algorithm, Dijkstra algorithm,particle swarm optimization, genetic algorithm, etc. The A* algorithm is a heuristic algorithm first proposed by Nilsson. Continuouslysearchingfor target point to obtain the obstacle avoidance path of the robot is the core of A* algorithm. By evaluating the search points in the state space, the optimal node is obtained, and then the search continues according to the location node until the target point is found. This algorithm has the characteristics of relatively simple programming method, less parameter setting and high efficiency of searching path [4].

A* algorithm
A* algorithm is an effective search method to obtain the shortest path, and it is also a typical heuristic algorithm [5]. A* algorithm is generally used for static global planning, and its core expression is: 2 Where: f(n)represents the path length from the starting node through the current node to the target node;g(n) represents the path length from the starting node to the current node n, and g(n)is the shortest distance from the starting node to the current node; h(n) is the estimated cost function distance from the state node n to the target state. Sinceg(n) is the actual distance, in order to search for the optimal solution in the static map, the selection of cost type h(n)is very important, and the value off(n) depends on the size ofh(n). The green grid represents starting point position, the red grid represents target point position, and the eight points around the blue grid represent the candidate points of the child nodes that can be set as the current state space. Let one side length of the grid be 10, and formula (1) be abbreviated asF=G+H,where Grepresents the Manhattan distance from the starting point to the current state, and His the estimated cost function value from the current state node to the target node using Euclidean distance. TheF

A* algorithm flow
The algorithm flow of A* will be describedin form of pseudocode. First, set the parameters.start: The starting point of robot path planning;goal1: The target point of robot path planning;g(n)：The actual movement distance of n node to start point;h(n): The theoretical travel distance of n node to the target point; openlist: a list of undetected nodes while searching for nodes;closelist: nodes that have been detected; comaFrom:save the child and parent nodes, the resulting path is saved in this list. Replace its parent node with the current node, calculate the f(n)h(n)value of current node } } save the parent node with comaFrom }while(target node is not in openlist) if openlist is empty, there is no path to search. At last connect all parent node from start point,this path is result of A* algorithm. The path planning program structure of traditional A* algorithm is shown in figure 2.

A* algorithm improvement
Although the traditional A* algorithm has become a widely used path planning algorithm in the navigation of mobile robots, the path planned by this algorithm has many problems such as multiple inflection points and turning times, which is not conducive to the running of the robot in the actual environment [6]. Therefore, based on the study of A* algorithm, An A* algorithmimprovement is proposed which is suitable for robot driving.
In order to solve the problem that A* algorithm cannot find the shortest path in the actual path planning, Anthony Stentz proposed the D* method [7] based on interpolation method to make the path smooth.But the interpolation method increased the calculation amount and made the real-time performance worse. Intelligent algorithms such as genetic algorithm and neural network algorithm are also used for path planning, but for static map, intelligent algorithm takes more time. In order to optimize the planning path of A* algorithm and reduce the length of the path, three aspects of A* algorithm are improved:

Set the openlist access time threshold
In the traditional A* algorithm, when the current node expands the child nodes, all candidate nodes will be extended every time.This method may have some invalid searches in complex environments, which cost some time.On the basis of traditional A * algorithmanimprovement is proposedto avoid getting into the local minimum and solve the problem of not being able to plan the global path.This improvement can be described as that every time the first inserted node in the openlist table is detected to determine whether it has been extended after passing a certain time threshold of N, and if not, this node will be regarded as the highest priority extension

Floydalgorithm optimization
Floyd algorithm refers to the idea of dynamic programming to search for the shortest path, which is used to solve the optimal distance problem between two points [8]. The combination of Floyd algorithm and A* algorithm is used to reduce the path length, which meets the actual application requirements. The principle of Floyd algorithm is shown in figure 3.   R(A,D).By adopting Floyd algorithm to optimize the path planned by A* algorithm, redundant points can be removed, which is more suitable for mobile robot driving.

Path smoothing
There are many sharp inflection points in the path planned by A* algorithm, which do not conform to the smooth movement of the mobile robot. In order to make the mobile robot move smoothly on the planned path, the planned path needs to be smoothed [9], Use smooth curves to replace sharp points. The principle is shown in figure 4.
Through the above methods, Floyd algorithm can be adopted to remove the redundant points at the inflection point and the folding point to shorten the robot's driving path, and then the smoothing algorithm can be used to process the path, so as to reduce the degree of bending at the inflection point, which is conducive to the robot's steering and driving and obstacle avoidance operation [10]. A* program block diagram after algorithm improvement is shown in figure 5.

Simulation experiment and analysis
To verify the effect of the improved A* algorithm, MATLAB2016b was used for simulation programming. A* algorithm is designed using the GUI in MATLAB graphical interface, as shown in figure 6, inside the guide set two buttons, one named A * algorithm for path planning, another name for generating obstacles, they will be automatically generated .m file. Use GUI editable text to set starting point coordinates and target point coordinates, import related code in the .m file of A* algorithm for path planning and obstacle button generated. modify the parameters of the corresponding Function, to generate the figure 7 GUI interface, click the generate obstacles button, there will be a 32 x 32 map with some obstacles around. A grid unit on a map has a length of 1 Figure 6. GUI design of simulation interface. Figure 7. A* algorithm verification interface design. The simulation environment map was constructed, and obstacles were randomly set in the map. At the same time, the starting point was randomly set at (3,3) and the target point was randomly set at (29,22) in the GUI editing text. The simulation function is to find an optimal path from the starting point (3,3) to (29,22). In experiment 1, the traditional A* algorithm was used for path planning, and the simulation results were shown in figure 8 (a). Experiment 2 only sets the openlist access time threshold for path planning, and the path simulation results are shown in figure 8      The analysis and comparison of experimental results show that the improved algorithm shortens the total length of the path, reduces the number of inflection points and fold points, improves the smoothness of the path, and is more suitable for the motion of mobile robots. The statistical experimental data are shown in table 1: the improved planning time is slightly increased, which is due to the addition of Floyd algorithm and smoothing algorithm. However, the planning time difference is not too large, which is within the acceptable range. This is due to the improvement of the algorithm, adding a threshold value N in the openlist to improve the efficiency of finding child nodes.

Conclusion
On the basis of A* algorithm research in static environment, a method is designed to improve the real-time performance of the path planning and reduce the search node number. In this method, openlist in the A* algorithm is proposed to join judgment threshold N, if the search node is more than N, judge whether the node of the first to join extension, not extend it as the highest extension node. Then, Floyd algorithm is used to optimize the traditional A* algorithm for the problems of multiple inflection points and high degree of path bending in the search path, and then the path smoothing process is carried out: the arc curve is used to replace the broken point to make it suitable for robot movement. The MATLAB simulation results of the improved A* algorithm and the traditional A* algorithm show that there is little difference in the planning time between them, but the improved path is smoother and shorter, which is more conducive to the running of the robot.