Research on Path Planning of Mobile Robot based on A* Algorithm

— Path planning is one of the core issues in the field of intelligent robots, and it is also an important aspect in the study of artificial intelligence in robotics. The typical path planning problem refers to how to find the moving path from the starting point to the ending point for the robot in the working environment with obstacles, so that the robot can pass all obstacles safely and without collision during the movement. Firstly, the paper expounds the concept of mobile robot path planning and introduces the current research situation of mobile path planning. Then it introduces the steps of A* algorithm and A* algorithm implementation, and carries out MATLAB simulation experiment. The experiment proves that the A* algorithm can plan the global optimal path and ensure the fastness and accuracy of the path. It has certain reference significance for the future research of path planning.


INTRODUCTION
In recent years, people attach great importance to artificial intelligence technology, and the field of mobile robots has gradually become a research hotspot [1]. Intelligent mobile robots are one of the most active areas in the development of artificial intelligence. Path planning technology is one of the key technologies for mobile robots to achieve autonomous positioning and path navigation [2], and is an important research direction in the field of mobile robots. The path planning of the mobile robot mainly realizes three tasks: one is to plan the feasible path of the robot from the starting point to the target point; the other is to plan the feasible path of the robot from the starting point to the target point. The other is to make the path of the robot run around obstacles in space. The third is to optimize the robot's motion path to achieve shorter, smoother requirements [3].
A* algorithm, A* algorithm is a heuristic search algorithm in artificial intelligence [4]. It can omit a large number of unnecessary search paths and improve search efficiency. It is the most effective way to solve the shortest path by static path planning. The algorithm can make the robot seek a robot motion path trajectory from the starting point position to the target point position without any obstacles in the environment, which is a better effective path.

I. A* ALGORITHM PRINCIPLE
The A* algorithm is a very effective path optimization algorithm. It is faster than the Djkstas algorithm. It first appeared in 1968. The overall framework of the algorithm is a graph traversal search algorithm, but it is different from most graph search algorithms. A heuristic function is used to estimate how close any point on the map is to the target point. Through this heuristic, you can coordinate the selection of the best direction search. If the process fails, you can also choose another path search until you find the most optimized path. The A* algorithm is a typical heuristic search algorithm in artificial intelligence, and the inspirational valuation is expressed by the valuation function: ( ) ( ) ( ) f n g n h n =+ Where () fn is the valuation function of node n; () gn is the actual cost from the initial node to the n-node in the state space; () hn is the estimated cost of the best path from the node to the target node. The correct selection of the valuation function will directly affect the success of the A* algorithm, and the determination of the function is closely related to the actual situation. Therefore, it is very important to choose the valuation function. An inappropriate heuristic function will slow down the A* algorithm and cause it to produce a bad path. The closer the valuation value is to the actual value, the better the valuation function is achieved. For geometric path planning, the Manhattan distance between the two nodes can be taken as the valuation value, ie: In this case, the valuation function will be more or less restricted by the valuation value. The node is close to the target point, the h value is small, and the f value is relatively small, which ensures that the shortest search is performed in the direction of the end point. If A* is required to give a "perfect" path, then the value of the heuristic function should be a low estimate (less than the actual cost) of the actual cost from one point to the end, ie, The first node is the lowest valuation value. Node. Only the first node in the queue is the node that will be accessed; the closed list records the nodes that have been visited. Starting from a point to test the neighboring nodes, if you can move and the current move is the starting point to the historical best method of that node, then the node is inserted into the open list according to the valuation value from small to large, and the trial ends in several directions. After taking the node with the lowest valuation value, put it into the closed list, and then try to test several adjacent nodes from the point with the lowest valuation value, and also open the list [120, 121].

II. A* ALGORITHM IMPLEMENTATION STEPS
Suppose the starting point is dark green square A and the end point is red square B. The A* algorithm is initialized as shown in Figure 1, and the middle blue is the obstacle. It may or may not be, this is a list of squares to be checked. List. Although there is only one element in the list, it will be added later. "Before you open it and treat it as a special point in the "open". The list is like a square that the path of the week may pass through.
2) Find all accessible or passable squares around the starting point, skip obstacles or other unreachable squares, and add them to the list. Save point A as the "parent square" for all of these squares.
3) Remove point A from the open list and add it to a "close list" that holds all the squares that do not need to be checked again.
As shown in Figure 2, the dark green square is the starting point, and its outer frame is bright blue, indicating that the square is added to the close list. The black squares adjacent to it need to be checked, and their frames are bright green. Each black square has a gray pointer to their parent node.  (1): The path selected by A* is generated by iterating through the open list and selecting the square with the lowest f value. g represents the cost of movement along the path from the starting point to the current point, so that the horizontal and vertical movements make the horizontal and vertical movements cost 10, and since the diagonal distance is 2 times the horizontal or vertical distance, in order to simplify the calculation and improve the search speed, The cost of moving diagonally is 14. Calculate the g value along a specific path to a square. The method of evaluation is to take the g value of its parent node, and then increase it by 14 or 10 according to whether it is diagonal or right angle to the parent node. H is calculated by the Manhattan method, which calculates the sum of the horizontal and vertical squares from the current cell to the destination cell, and then multiplies the result by 10, where the obstacles in the path are ignored, and the values of f are g and h. with. The result of the first step is shown in Figure 4  In the first 9 squares, after the start point is switched to the close list, 8 left in the open list. Among the 8 squares, the lowest value of f is the grid immediately to the right of the starting grid, so select this grid as the next grid to be processed, and select the best as shown in Figure 4-3.
Take this grid out of the open list, put it in the close list, and then check the adjacent grid around it. The three grids on the right are walls, so skip it, the grid on the left is in the close list, skip it, the other 4 The grid is already in the open table, so it is determined by checking the value of g, if the path is better through this grid. After checking the four grids, it was found that none of the paths can be improved by using the current grid, so no changes are made.
Continue to search the open list, now there are only 7 grids, still choose the lowest value of f, but now there is a minimum value of the grid value, select the last one to open the grid in the list can increase the search speed, in fact, which one to choose All the same, if the first choice is wrong, you will definitely choose another one. Here you select the grid at the bottom right of the starting grid, and select f as shown in Figure  4.  Note that the parent node of the grid below the starting grid is different from the previous one. Before it has a g value of 28 and points to the upper right grid, its g value is now 20, pointing to the grid above it. Moving from point B to the parent node in the direction of the arrow will eventually lead back to the starting grid, which is the path required.

III. A* ALGORITHM SIMULATION EXPERIMENT
The A* algorithm is simulated in MATLAB to verify its feasibility. Design a 30x30 rectangular space, set the coordinates of the starting point to (3,3), and the coordinates of the target point to (29, 23). The simulation results are shown in Figure 4.4. The black dots in the figure indicate obstacles, the blue dots represent the starting points, the red dots represent the target points, and the green dots are the trajectory points generated according to the A* algorithm. The generated trajectory points are extracted and optimized by fitting to obtain a smooth trajectory as shown in Figure 6.

IV. CONCLUSION
Mobile robot path planning technology has always been one of the research hotspots in the field of artificial intelligence. The ultimate goal is to plan an optimal path for mobile robots to avoid obstacles from the starting point to the end point. This paper briefly introduces the definition of mobile robot path planning and the tasks that need to be completed. Then it introduces the steps of A* algorithm and A* algorithm implementation. Finally, the MATLAB simulation experiment of A* algorithm is carried out to verify the effectiveness of the algorithm. It has certain reference significance for the future research on path planning.