Research on Global Dynamic Path Planning Method Based on Improved A ∗ Algorithm

Aiming at the optimal path and planning efficiency of global path planning for intelligent driving, this paper proposes a global dynamic path planning method based on improved A∗ algorithm. First, this method improves the heuristic function of the traditional A∗ algorithm to improve the efficiency of global path planning. Second, this method uses a path optimization strategy to make the global path smoother. .ird, this method is combined with the dynamic window method to improve the real-time performance of the dynamic obstacle avoidance of the intelligent vehicle. Finally, the global dynamic path planning method of the proposed improved A∗ algorithm is verified through simulation experiments and real vehicle tests. In the simulation analysis, compared with the modified A∗ algorithm and the traditional A∗ algorithm, the method in this paper shortens the path distance by 2.5%∼3.0%, increases the efficiency by 10.3%∼13.6% and generates a smoother path. In the actual vehicle test, the vehicle can avoid dynamic obstacles in real time. .erefore, the method proposed in this paper can be applied on the intelligent vehicle platform. .e path planning efficiency is high, and the dynamic obstacle avoidance is good in real time.


Introduction
As one of the development directions of future automobiles, intelligent driving is receiving more and more attention [1]. In particular, path planning is an important part of intelligent driving. Path planning is an obstacle-free path from the starting point to the target point that the intelligent vehicle plans out based on environmental information [2]. Especially in the dynamic environment, in order to ensure the real-time obstacle avoidance and the efficiency of path planning, it is necessary to improve the path planning algorithm.
In recent years, the most representative and common path planning algorithms in the field are mainly divided into neural network algorithm [3], artificial potential field algorithm [4], rapidly expanding random tree algorithm [5], ant colony algorithm [6], and A * algorithm [7,8]. In particular, the A * algorithm is a heuristic search algorithm; because of its strong global search ability, high search efficiency, and shortest path, it is widely used. Ziang Zhang et al. [9] proposed an improved hybrid path planning method for a spherical mobile robot based on a pendulum, which improves the efficiency of path search, but it is aimed at a spherical mobile robot. Bijun Tang et al. [10] proposed an algorithm that uses an artificial potential field method to optimize the path of the hybrid A * algorithm. e generated path not only is smooth but also maintains a safe distance from obstacles. However, the real-time obstacle avoidance is not good in a dynamic environment. Oleiwi et al. [11] proposed a path planning method for multiobjective mobile robots based on the ant colony algorithm and genetic algorithm which can efficiently select the optimal path for multiobjectives in a static environment, but it is not suitable for dynamic environments. Jikai Wang et al. [12] proposed a global path planning framework based on hybrid mapping, which improved the efficiency of path planning in complex environments, but it cannot guarantee the optimal path. Xiaoru Song et al. [13] proposed a dynamic global path planning method suitable for mobile robots, which can plan a smooth path in a dynamic environment, but the efficiency of path planning still needs to be improved. e A * algorithm based on a grid map is suitable for global path planning. is algorithm has the advantages such as a simple structure and small calculation amount [14]. However, the path planned by the traditional A * algorithm has many folding points, which is not conducive to the driving of the intelligent vehicle. Moreover, if the space of the environment increases, A * algorithm needs large storage space and it has low efficiency and poor real-time performance. e dynamic window method has good obstacle avoidance ability in a dynamic environment, but it is not suitable for global path planning [15].
Aiming at the optimal path and planning efficiency of global path planning for intelligent driving, this paper proposes a global dynamic path planning method based on improved A * algorithm and dynamic window method. e improved path planning method has many advantages. First, the heuristic function of the traditional A * algorithm is improved to make the A * path search more biased. e time of the path planning is reduced, and the efficiency is increased. en, the optimization strategy is used to reduce the redundant turning points and nodes of the path planning. e distance of the path is optimized, and the smoothness of the path is improved. Finally, the A * algorithm global search capability is combined with the dynamic window method local planning capability so that the intelligent vehicle can perform global dynamic path planning, and the real-time performance of dynamic obstacle avoidance is good. e remainder of the paper is organized as follows: Section 2 discusses the improved A * algorithm; Section 3 discusses the dynamic window method; Section 4 discusses the simulation and experimental results; Section 5 discusses the real vehicle test; and Section 6 discusses the conclusions of this research.

The Improved A * Algorithm
e traditional A * algorithm is a heuristic search algorithm, which constantly expands the nodes and calculates the value of each node. Finally, we can find a path with the least value. e use of heuristic function can greatly improve the search efficiency. e formula of traditional A * algorithm is shown as follows: where f (n) is the estimated value from the initial node to the target node, g(n) is the actual value from the initial node to the node of state n, and h (n) is the estimated value from the node of state n to the target node. e selection of h (n) directly affects the performance of the algorithm. Only when the value of h (n) is closer to the actual cost value from the node of state n to the target node, the optimal path can be guaranteed and the efficiency of the algorithm can be improved. erefore, the following improvements have been made.

Improved Heuristic Function h (n).
Assume that d (n) is the actual value from the node of state n to the target node. When the heuristic function h (n) is selected differently, the following three conditions will occur: (1) When h (n) > d (n), the search range of A * algorithm is small and the extended nodes are relatively few. erefore, the algorithm has high efficiency, but the result is not the optimal path.
(2) When h (n) < d (n), A * algorithm has a large search range and a relatively large number of extended nodes. erefore, the algorithm has low efficiency, but the result can get the optimal path. (3) When h (n) � d (n), this is the most ideal choice, so the A * algorithm will search strictly according to the shortest path. erefore, the A * algorithm has the highest search efficiency.
In the traditional A * algorithm, the heuristic function h (n) usually used Euclidean distance [16] h 1 (n), Manhattan distance [17] h 2 (n), or Chebyshev distance h 3 (n): where (M x , M y ) represents the coordinate value of the current node, (G x , G y ) represents the coordinate value of the target node, and D is the actual cost value of the intelligent vehicle moving one grid. In order to make the heuristic function h (n) closer to the actual value d (n), a new heuristic function is designed using Manhattan distance and Chebyshev distance. e heuristic function is then dynamically weighted: where m (n) is the depth of search, R is the expected path length, and K is constant. Other parameters are the same as formulas (2)-(4).

Path Optimization Strategy.
e traditional A * algorithm expands nodes based on the grid, which contains more turning points and redundant nodes [18]. ey are not good for driving intelligent vehicles. In order to solve these problems, this paper proposes a path optimization strategy.
(1) Find redundant nodes and remove them. Assume that the path planned by the A * algorithm is M k | k � 1, 2, 3, . . . , n . First, start from the second node M 2 of the path plan and judge whether the child node M 3 of M 2 and its parent node M 1 are in the same straight line. If it is on the same straight line, M 2 is a redundant node. Delete and update the path list. en, check whether the child node of the next node and its parent node are on the same line. Delete redundant nodes and update the path list. Finally, all nodes are traversed to get a set of points including the starting point, turning point, and target point.

Dynamic Window Method
e dynamic window method can make an intelligent vehicle have a good obstacle avoidance ability in a dynamic environment. e dynamic window method is mainly used to sample multiple groups of velocities in the velocity space (linear velocity v and angular velocity w) and simulate the trajectory of intelligent vehicle in the next time interval. After obtaining multiple sets of trajectories, the multiple sets of trajectories are evaluated according to the evaluation function [19] and the intelligent vehicle will select the speed corresponding to the optimal trajectory for the next step of driving [20].

e Vehicle Kinematics Model.
According to the dynamic window method, it can continuously simulate the trajectory of the intelligent vehicle in a period of time.
erefore, it is necessary to know the kinematics model of the intelligent vehicle [21,22]. e trajectory is represented by ( _ x t , _ y t ). e kinematic model is shown in Figure 1.
Using the fundamental law of dynamics, we can get the dynamic formula: is the projection speed of the intelligent vehicle on the coordinate axis at time t, v is the speed of the intelligent vehicle, θ t is the attitude angle at time t, _ θ t is the angular velocity of attitude at time t, L is the wheelbase of the intelligent vehicle, ϕ t is the front wheel angle at time t, and ρ is the turning radius.
In practical application, considering the omnidirectional motion of the intelligent vehicle and the transformation of the world coordinate system, the new kinematics formula is obtained: 3.2. Design of Speed Sampling. After establishing the kinematics model of the intelligent vehicle, the trajectory can be calculated according to its speed (linear velocity v and angular velocity w). However, there are infinite groups of speed in the speed space. In order to control the speed sampling better, the speed group must be limited in a certain control range according to the limitations of the intelligent vehicle and the environment space.
(1) e linear speed of the intelligent vehicle and its angular speed limit range formula are shown as follows: (2) In practical application, the motor must go through a certain time interval to make the intelligent vehicle reach the corresponding speed and the speed is within a dynamic range under the influence of the motor torque. erefore, the formula is shown as follows: where v d and ω d are the current front linear speed and angular speed of the intelligent vehicle, _ v c and _ v e are the maximum acceleration and deceleration of linear velocity, respectively, and _ ω c and _ ω e are the maximum acceleration and deceleration of angular velocity, respectively.
(3) During the operation of the intelligent vehicle, when an obstacle is detected within a safe distance, the intelligent vehicle needs to slow down or even stop. erefore, it is necessary to further limit the velocity (linear velocity and angular velocity): where dist(v t , ω t ) is the distance between the current position of the intelligent vehicle and the nearest obstacle.

Design of Dynamic Window Evaluation Function.
According to the dynamic window method, we need an appropriate evaluation function to select the optimal trajectory from the final planned multiple trajectories. e priority criterion of the evaluation function is to make the intelligent vehicle avoid obstacles and move toward the target with the shortest track. e formulas are shown as follows: where head(v t , ω t ) is the sampling speed of the robot at time t, dist(v t , ω t ) is the distance between the robot's trajectory and the nearest obstacle at time t, and velocity(v t , ω t ) is the velocity of the robot at time t.

Flowchart of the Algorithm.
e flowchart of the algorithm is shown in Figure 2.
Step 1: the map is initialized and the improved A * algorithm is used for global path planning Step 2: strategy optimization of the planned path Step 3: the kinematics model is established, and the velocity group is sampled Step 4: according to the planned global path and the multiple trajectories simulated by the speed at the next moment, the optimal trajectory is selected by using the evaluation function Step 5: establishing the optimal path

Simulation Experiment and Analysis
In order to verify the effectiveness of the fusion algorithm designed in this paper, MATLAB 2019b is used for simulation experiments to build a grid map scene (20 m × 20 m, grid spacing 1 m) and simultaneously place seven static obstacles of different shapes and sizes and two dynamic obstacles. In the grid map built by the simulation experiment, the starting point coordinates are (1.5 m, 1.5 m) and the target point coordinates are (19.5 m, 19.5 m).

Simulation Experiment of Improved Heuristic Function.
e traditional A * algorithm has many redundant nodes and large search range, which reduces the efficiency of the algorithm. In this paper, the A * algorithm is improved to reduce the scope of search and improve the efficiency of the algorithm. Black is the initial position, green is the target position, red is the optimal path, and yellow is the search area except the optimal path. e experimental results are shown in Figure 3. e experimental image of the improved A * algorithm used in this paper is shown in Figure 3(a). e search area is 128 m 2 , the path length is 28.38 m, and the time is 0.040 s. e experimental image of traditional A * algorithm is shown in Figure 3(b). e search area is 180 m 2 , the path length is 28.38 m, and the time is 0.050 s. e experimental image of the improved A * algorithm using Manhattan distance and Euclidean distance is shown in Figure 3(c). To distinguish, it is named the modified A * algorithm. e search area is 166 m 2 , the path length is 28.38 m, and the time is 0.045 s. e detailed data are shown in Table 1. From the above data, compared with the traditional A * algorithm, the improved A * algorithm in this paper can reduce the search area by 28.9% and increase the efficiency by 20.0%. Compared with the modified A * algorithm, the improved A * algorithm in this paper can reduce the search area by 22.9% and increase the efficiency by 11.1%.

Static Global Path Planning.
In a static simulation environment, the simulation experiments results based on different algorithms will be compared in this section. e simulation experiments in this paper are in the same environment, the maximum speed and acceleration of the intelligent vehicle are the same, and the red line is the actual trajectory of the intelligent vehicle.  Mathematical Problems in Engineering algorithm is 4, the number of turning points is 2, and a total of 128 nodes are expanded. e optimal path length of this algorithm is 26.99 m, and the time is 0.04 s. Working condition 5: the experimental images of the improved A * algorithm and dynamic window method in this paper are shown in the red line in Figure 4(c). Each circle in the figure represents a node, and various polygons are obstacle environments. According to the results of the simulation experiment, the path planned by this algorithm is smooth, the optimal path length is 27.13 m, and the time is 46.69 s. Tables 2 and 3.

Dynamic Global Path Planning.
In the dynamic simulation environment, this section will compare simulation experiments based on different algorithms. e simulation experiment in this paper is in the same environment, the maximum speed and acceleration of the intelligent vehicle are the same, and the red line is the actual trajectory of the intelligent vehicle.      Detailed statistics are shown in Table 3.

Simulation Experiment Results and Analysis.
In the static obstacle environment, compared with the modified A * algorithm and the dynamic window algorithm, the improved A * algorithm and the dynamic window algorithm in this paper reduce the path distance by 5.0% and the time by 9.0%. In the dynamic obstacle environment, compared with the modified A * algorithm and dynamic window algorithm, the improved A * algorithm and dynamic window algorithm in this paper reduce the path distance by 2.5% and the time by 10.3%. Compared with the traditional A * algorithm and dynamic window algorithm, the path distance of the algorithm proposed in this paper is reduced by 3.0% and the time is reduced by 13.6% erefore, the algorithm proposed in this paper is more efficient. e planned path is shorter and smoother, which is conducive to the driving of intelligent vehicle.

Real Vehicle Test
is paper uses an unmanned dual-head driving test vehicle based on the Linux system to verify the improved A * path planning algorithm. e platform supports complete independent development, equipped with 16-line laser radar, millimeter wave radar, binocular vision module, GPS positioning module, and other equipment, with high-precision positioning, automatic navigation, and tracking functions.
e actual vehicle is shown in Figure 8. e static obstacle is a cardboard box, and the dynamic obstacle is a tester. To ensure safety, the test vehicle is equipped with a driver responsible for emergency situations, and the maximum speed is set to 30 km/h. Figure 9 is an image displayed by binocular vision, which shows an obstacle environment. Figure 10 is a lidar image, including the location of obstacles. Figure 11 shows the static obstacle avoidance trajectory. e red trajectory is the trajectory of global path planning and local path planning, the yellow is the obstacle, and the blue is the actual trajectory of the experimental vehicle. e static obstacles are cartons with a large width, so the obstacle avoidance range is large. Figures 12 and 13 are dynamic obstacle avoidance trajectories. e red trajectory is the trajectory of global path planning and local path planning, the yellow is the obstacle, the blue is the actual trajectory of the experimental vehicle, and the dynamic obstacle is the experimental personnel. Figures 14-17 are the obstacle avoidance pictures taken during the real vehicle test at high speed.
e real vehicle test shows that the vehicle can avoid dynamic obstacles in real time. e trajectory is smooth. erefore, the algorithm proposed in this paper can be applied to the practical application of intelligent electric vehicle platform and has practical value of engineering application.

Conclusions
In this paper, a global dynamic path planning method based on the improved A * algorithm is proposed to deal with the optimal path and planning efficiency of global path planning for intelligent driving. is method has high efficiency and smoother path planning, and the real-time performance of dynamic obstacle avoidance is good. e specific contents of this article are summarized as follows: (1) e heuristic function h (n) of traditional A * algorithm is improved, and the dynamic weighting method is used to make h (n) closer to the actual distance d (n). is method reduces the search area in the A * path search, reduces the planning time, and improves the efficiency of the algorithm.
(2) Use optimization strategies to optimize the optimal path, reduce redundant nodes and turning points of the optimal path, and make the path smoother, which is conducive to the driving of intelligent vehicle. e improved A * algorithm is combined with the dynamic window method for dynamic obstacle avoidance. is not only ensures that the improved A * algorithm can efficiently plans the optimal path but also improves the local optimal problem of dynamic window method so that the intelligent vehicle has global dynamic path planning capabilities. (3) In the simulation analysis, the method in this paper shortens the path distance by 2.5%∼3.0%, increases the efficiency by 10.3%∼13.6%, and generates a smoother path. rough the actual vehicle test, the results show that the algorithm proposed in this paper has good real-time performance and good stability for dynamic obstacle avoidance.
e improved A * method can be applied in practice on the intelligent electric vehicle platform, and it has a practical value in engineering application.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this article.

Authors' Contributions
Chuanhu Niu was responsible for methodology and prepared the original draft; Aijuan Li and Chuanyan Xu were responsible for software and validated the data; Xin Huang and Wei Li reviewed and edited the manuscript. All authors have read and agreed to the published version of the manuscript.