Research on Path Planning Algorithm for Driverless Vehicles

: In a complex environment, although the artificial potential field (APF) method of improving the repulsion function solves the defect of local minimum, the planned path has an oscillation phenomenon which cannot meet the vehicle motion. In order to improve the efficiency of path planning and solve the oscillation phenomenon existing in the improved artificial potential field method planning path. This paper proposes to combine the improved artificial potential field method with the rapidly exploring random tree (RRT) algorithm to plan the path. First, the improved artificial potential field method is combined with the RRT algorithm, and the obstacle avoidance method of the RRT algorithm is used to solve the path oscillation; The vehicle kinematics model is then established, and under the premise of ensuring the safety of the vehicle, a model predictive control (MPC) trajectory tracking controller with constraints is designed to verify whether the path planned by the combination of the two algorithms is optimal and conforms to the vehicle motion. Finally, the feasibility of the method is verified in simulation. The simulation results show that the method can effectively solve the problem of path oscillation and can plan the optimal path according to different environments and vehicle motion.


Introduction
With the development of the era of big data, the research and development of driverless technology is also making continuous progress.As an important part of unmanned driving technology, path planning has emerged in recent years with various related algorithms.Common ones are the artificial potential field method and the rapidly expanding random tree (rapidly-exploring random tree, RRT) algorithm.
The RRT algorithm is the most basic global path planning algorithm.Its basic idea is to sample and grow in the environment from the root node until it finds the target.No matter how complicated the environment, it can always find a path.However, this algorithm has a low convergence speed.In order to speed up the convergence speed of the RRT algorithm by gradually changing the sampling area and speeding up the sampling speed, the convergence speed can be improved and an appropriate path can be found quickly [1,2].
Because the randomness of the algorithm is too large, the RRT algorithm samples in the space, which is easy to generate redundant branches.In the process of tree sampling growth, pruning redundant paths can improve the planning efficiency [3].In the movement of the robot and the manipulator, the RRT algorithm is combined with the artificial potential field method and the extended algorithm, which can remove redundant branches, select appropriate nodes and complete the path planning [4,5].
Based on the traditional RRT algorithm, an improved RRT* algorithm is generated which can quickly plan the shortest path in line with the driving of a driverless vehicle by combining it with heuristic double sampling [6].In mobile robot path planning, MOD-RRT* can select the best node in the shortest time and generate the optimal path [7].In the unmanned path planning, the bidirectional RRT is used for sampling and exploration from the target position and the starting point at the same time, and the separation law is added to the collision detection to improve the planning efficiency [8].In the RRT algorithm, the adaptive is added to reduce the randomness of the sampling, and the appropriate node is selected by using the relationship between the angle and the distance, and the path is optimized [9,10].The RRT algorithm is used to help the artificial potential field method escape the local minimum trap, but the path oscillation still cannot be solved and the randomness of the selected virtual target point position is too large, which affects the efficiency of path planning [11].The RRT algorithm is used to help the artificial potential field method escape the local minimum trap, but the path oscillation still cannot be solved and the randomness of the selected virtual target point position is too large, which affects the efficiency of path planning [12].For the RRT algorithm, its sampling and obstacle avoidance functions that are not constrained by the environment can improve the efficiency of path planning to a certain extent.
The artificial potential field method relies on the gravitational field produced by the target and the repulsive force field produced by the obstacle to plan the path.It is often used for path planning of UAV, robots and driverless vehicles.In the braking process of the vehicle, the longitudinal safety distance model and the side-slip angle constraint are added to the potential field function to improve the obstacle avoidance accuracy [13].The artificial potential field theory is added to the vehicle cooperative control model, and on the premise of ensuring safe driving, it also improves driving comfort and improves traffic congestion [14].However, the algorithm suffers from three flaws, namely local minima, target unreachability and path oscillation.In order to solve the local minimum and target unreachable defects existing in the artificial potential field method.In the path planning of the mobile robot, in order to improve the efficiency of the robot, the local minimal value problem can be solved by improving the corresponding potential field function according to the principle of the artificial potential field method [15,16].While improving the repulsion potential field function, a virtual target point is added which can escape in time when the path falls into a defect, which solves the problem of an unreachable target [17].The artificial potential field method is combined with the ant colony algorithm to select the appropriate path point in each iteration until the target is reached, which can effectively solve the target unreachable and local minimum problems [18].In robot obstacle avoidance, the artificial potential field method combined with the D* algorithm is used to reach the dynamic target and avoid the dynamic obstacles [19,20].In UAV obstacle avoidance, a rotational potential field is designed to be added to the artificial potential field to solve the local minima [21].In order to study the working characteristics of complex snake-like robots in water, the IB-LBM method is combined with the improved artificial potential (AF), which can effectively eliminate the local minimum of the artificial potential field method [22].
In the path planning of a driverless vehicle, introducing the relative speed factor and applying a rotating repulsion force with a certain angle can jump out of the local minimum trap and eliminate the unreachable target defect [23][24][25].Based on the vehicle dynamics model, the local minimum value is jumped out by controlling the vehicle steering and setting an appropriate step size [26].Combining the A* algorithm with the improved artificial potential field method, the A* algorithm is used to divide the path delineated by the artificial potential field law into multiple sub-target points which can reduce the probability of the vehicle falling into a local minimum while also switching the path in time to escape from the local minimum trap [27].When the path planned by the artificial potential field method oscillates when approaching an obstacle, the oscillations can be eliminated by improving the repulsive field method, but this method is applicable to simple environments and still generates oscillations when the path is too close to the obstacle [28].In the vehicle driving environment, introducing safe distances into the artificial potential field method and decomposing repulsive forces by redefining the influence range of obstacles allows the vehicle to avoid falling into local minima while avoiding obstacles [29].By adding the angle function and fuzzy control idea to the traditional artificial potential field method to control the stability of the path, the path planned by this method can quickly jump out of the local minima trap and remain stable [30].By discretizing the obstacle boundary in the road, establishing the road boundary potential field and adding relevant constraints to improve the safety of obstacle avoidance, and at the same time add random escape force, so as to jump out of the local minimum [31,32].In the established safety potential field model, a unified function of vehicle potential field based on Lennard-Jones potential is established.The vehicle acceleration parameters are taken into account in the vehicle potential field model to solve the local minimum defect [33].The normal driving environment of the vehicle is often unknown, and the obstacles that appear must be discretized and polynomial curves are added to the artificial potential field to plan a path with the optimal curvature to ensure the vehicle travels [34,35].In the speed control of the vehicle, the desired speed can be obtained by imitating the driver's behavior by adding an artificial potential field to the path planner [36][37][38].When there is an obstacle in front of the road, the planner can control the vehicle to decelerate in time [39].
In the path planning of unmanned vehicles, the primary goal is that the path can safely avoid obstacles and satisfy the vehicle motion.Since the environment is complex and unknown, the thermodynamics and wear state of the tire affect the dynamic characteristics of the tire, thereby changing the vehicle's behavior.Therefore, factors such as the state of vehicle tires should be considered in path planning.Considering changes in systems and boundary conditions on different road surfaces, and learning about tire dynamic limits by developing simulated driver behavior [40].In vehicle simulation tests, the multi-physics Pacejka's magic formula tire model is often used to represent tire characteristics.It reproduces the effects of temperature, pressure and wear on the dynamic behavior of the tire, which provides an idea for planning the optimal path [41,42].
The biggest advantage of linear MPC is that it is simple to calculate and can ensure good real-time performance.The optimal result of nonlinear MPC in each control cycle is not easy to determine; it will fall into local optimum and vehicle dynamics, and physical constraints and obstacles around the environment will greatly affect the trajectory tracking performance of nonlinear MPC [43,44].Using a linear four-wheel vehicle model in the controller can efficiently distribute control work to each actuator.At this time, the use of linear MPC theory can reduce the computational burden of nonlinear MPC [45].Considering the dynamic characteristics of tires in the four-wheel vehicle model, the solution time of linear MPC is reduced under the premise of a stable tracking trajectory.Compared with nonlinear MPC, the real-time performance of linear MPC is significantly improved [46].The road factors are added to the linear MPC steering controller, a fourwheel vehicle model considering vertical loads is established, and the inclination angle and roll angle are used as constraints so that the linear MPC has good robustness on complex roads while meeting the real-time requirements [47,48].
The core of the improvement methods in the above literature is to improve the repulsion potential field function.This improved method can solve local minima and target unreachable defects, but cannot effectively solve the path oscillation problem.Therefore, aiming at the problem of path oscillation, this paper proposes a path planning algorithm that combines the improved artificial potential field method with the Rapidly Exploring Random Tree (RRT) algorithm.This method uses the improved artificial potential field method to plan the path from the initial position, switches the RRT algorithm when approaching the target, uses the sampling function of the RRT algorithm in the environment and the obstacle collision detection method to plan the remaining path, eliminates oscillation and reaches the target.After the MPC trajectory tracking simulation comparison, the path planned by this method is the optimal one.

Traditional Artificial Potential Field Method
The gravitational force generated by the target in the artificial potential field method makes the vehicle move in the target direction.The repulsive force generated by the obstacle causes the vehicle to avoid the obstacle.
In Figure 1, F1 is the repulsion force generated by the obstacle to the vehicle, F2 is the gravitational force of the target on the vehicle, F is the sum of the repulsion force and the gravitational force at the current position, and the direction is the vehicle's forward direction.Among them, the expressions of attraction and repulsion are: In the above formula,   and   represent the attractive force and repulsion force respectively,  1 and  2 represent the attractive force gain coefficient and the repulsion force gain coefficient respectively,  1 is the distance between the target and the vehicle (this paper takes the Euclidean distance) , 2 is the distance between the obstacle and the current position of the vehicle, and  0 is the maximum distance between the obstacle and the vehicle to generate repulsion.

Improved Artificial Potential Field Method
Aiming at the problems of local minimum points and unreachable targets in the path planning of the traditional artificial potential field method, we can start by modifying the expression of the repulsion force.The original repulsion potential field function is multiplied by the relative distance  1  between the target and the current vehicle (n is a positive integer), and when the vehicle reaches the target, its repulsion can be reduced to zero, effectively solving the above defects [49].
Improved repulsion expression: The principle of the improved artificial potential field method is shown in Figure 2. The above improvements work well for a single obstacle or a few obstacles around the target, but the planned path is not optimal.When there are multiple obstacles around the target, the path will generate oscillation when approaching the obstacles.

RRT Algorithm
The rapidly exploring random tree (RRT) algorithm can quickly calculate, avoid obstacles and find targets in complex environments.The basic idea is to sample and grow in the environment from the root node until the target is found.The schematic diagram of the RRT algorithm is described in Figure 3.

RRT Algorithm Collision Detection
Most of the obstacles encountered in path planning in an unknown environment are irregular, and it is very troublesome to perform collision detection.Reference [50] proposes to simplify irregular obstacles into regular circles and divide the path to be detected into equal points and connect them to the centre of the circle for distance judgment to avoid obstacles, as shown in Figure 4.  ) ( ) In the above formula,  = 0, 1, 2, …, represents the bisector point, ( 0 ,  0 ) represents the coordinates of the centre of the circle, and  represents the radius of the obstacle circle.When the distance between a bisector point and the centre of the circle is less than or equal to , the path fails collision detection.

Vehicle Kinematics Model
In order to reflect the real situation of the vehicle during the driving process, a threedegree-of-freedom vehicle dynamics model is selected, as shown in Figure 5.Among them,  is the vehicle mass,  is the distance between the center of mass and the front axle,  is the distance between the center of mass and the rear axle,   is the moment of inertia,   and   are the lateral forces on the front and rear tires of the vehicle,   and   are the longitudinal forces exerted on the front and rear tires of the vehicle,  is the yaw angle of the vehicle, and  is the steering angle of the front wheel of the vehicle.

MPC Objective Function Design
Generally, the MPC controller selects the output variables of the system by optimizing the objective function with constraints [51].To ensure that the objective function can ensure that the unmanned vehicle can track the reference trajectory more stably, the following form is specially adopted [52]: Among them,   is the prediction time domain,   is the control time domain, ,  is the weight matrix,   is the reference output, ∆ is the control increment,  is the weight coefficient and  is the relaxation factor.
To further improve the accuracy and stability of the vehicle following the reference trajectory, it is necessary to constrain the front wheel steering angle and yaw angle of the vehicle [53].this includes the front-wheel steering angle constraint: −25 °≤  ≤ 25 °.
To facilitate the writing of computer language, Formula ( 8) is converted into a quadratic programming form with constraints through matrix operations: Among them,   = [ Θ   Θ  +  0 0  ];   = [2   Θ  0];   is the tracking error in the prediction time domain.

Combination of Improved Artificial Potential Field Method and RRT Algorithm
This paper uses the advantages of the RRT algorithm as a supplement to make up for the shortcomings of the improved artificial potential field method to plan an optimal path and use the MPC trajectory tracking comparison to verify whether the path satisfies the vehicle motion.The algorithm combined with the flowchart is shown in Figure 6, and the specific steps are as follows: Step 1. Firstly, the improved artificial potential field method is used to plan the path from the initial position.Under the interaction of the gravitational field and the repulsion field, the vehicle is allowed to move towards the target direction while avoiding obstacles.
Step 2. The distance threshold is set and the distance between the position of the vehicle and the target every time it travels in the environment is calculated.When the distance is less than or equal to the threshold, the repulsion and gravitational force of the vehicle position are set at zero.
Step 3. When the distance between the path and the obstacle is equal to the threshold, the RRT algorithm is automatically switched to plan the remaining path.Finally, the target needs to be found and a new path needs to be planned.
Step 4. MPC is used to track the trajectory to verify whether the new path conforms to the vehicle's motion.

Results
This simulation sets up a complex environment to compare the two methods.In Matlab, [0 0] was set as the initial position, [100 100] as the target position, and the coordinates of multiple static obstacles were set.At the same time, the key parameters are analyzed and selected to ensure the passage of vehicles.Specific parameter settings are shown in Table 1.The path planned by the combination of the RRT algorithm and the artificial potential field method with improved repulsion function, through the setting of the threshold, the RRT algorithm is switched in time before approaching the last obstacle and finally the target is reached.It can be seen that the path planned by this method is very smooth and without oscillation.
Figure 8 shows that the two paths are tracked by the MPC tracking trajectory method to verify whether the paths planned by the two methods conform to the vehicle motion.The coordinates of the obstacles in Figure 8a remain unchanged.When using MPC to track the path planned by the artificial potential field method with improved repulsion function, the tracking starts from the starting point, and the tracking error is large at the turning position and the oscillating position of the path.When tracking a path where oscillations occur, the vehicle cannot follow the reference path and goes straight through the centre of the obstacle, which does not conform to the motion of the vehicle.As shown in Figure 8b, the MPC tracking trajectory method is used to track the path planned by the combination of the RRT algorithm and the artificial potential field method with the improved repulsion function.It can be seen from the figure that the red path has been completely covered by the MPC tracking track points and that the turn of the path can be precisely tracked until the target is reached.Therefore, the path planned by this method is easier to track and more in line with the vehicle motion.
Figure 9 shows the comparison of the front wheel steering angle and yaw angle generated by MPC tracking two paths under the same speed.Figure 9a When the sampling time is between 5 s and 15 s, the front wheel rotation angle generated by the path planned by the artificial potential field method of vehicle tracking the improved repulsion function fluctuates greatly and the result is within the controllable range.At the same time, the fluctuation of the path planned by the combination of the RRT algorithm and the artificial potential field method with improved repulsion function is significantly smaller, indicating that the vehicle is more stable when tracking the path planned by this method.

Figure 9b
When the sampling time is between 10 s and 15 s, the yaw angle generated by the vehicle tracking the two paths fluctuates greatly and the results are all within the controllable range.Similarly, the path planned by the RRT algorithm combined with the artificial potential field method with improved repulsion function has significantly less fluctuation, which means that the vehicle is more accurate in tracking the path planned by this method.

Experiment 2: Set Up U-Shaped Obstacles in the Environment
The difference between Figures 7 and 10 is that U-shaped obstacles are set near the target and the positions of the obstacles are not on the same line with the target and the target is within the influence range of the obstacle repulsion field.The path is also planned from the starting point.For a U-shaped obstacles environment, the blue path represents the path planned by the traditional artificial potential field method.When passing through the U-shaped obstacle, the path oscillates and falls into the trap of local minima.Although the path planned by the artificial potential field method with improved repulsion function escapes the U-trap and solves the local minimal value problem, the path planned by the artificial potential field method with improved repulsion function oscillates more violently when approaching obstacles near the target than in the multiple obstacles environment.The path planned by combining the RRT algorithm and the artificial potential field method with the improved repulsion function can still effectively avoid U-shaped obstacles and eliminate oscillations to reach the target.Figure 11b Using MPC to track the path planned by the combination of the RRT algorithm and the artificial potential field method with improved repulsion function.It can be seen from the figure that the red path has been completely covered by the MPC tracking track points, while at the turn of the path it can still be accurately tracked until the target is reached.The path planned by this method is easier to track and more in line with the vehicle movement.
Figure 12a When the sampling time is between 0 s and 8 s, the front wheel steering angle generated by the path planned by the artificial potential field method of MPC tracking the improved repulsion function fluctuates greatly during this time period and the result is also within the controllable range.At the same time, the path planned by the combination of the MPC tracking RRT algorithm and the artificial potential field method with improved repulsion function has less fluctuation, which means that the vehicle is more stable when tracking the path planned by this method.Figure 12b The yaw angle generated by the path planned by the artificial potential field method of MPC tracking the improved repulsion function fluctuates greatly between 0 s and 9 s.In the whole sampling period, the overall fluctuation of the yaw angle produced by the path planned by the combination of the RRT algorithm and the artificial potential field method with improved repulsion function is small.It shows that the path planned by this method is more accurate when vehicle tracking is performed.
By simulating in two different environments, it can be seen from the path planning simulation comparison that the artificial potential field method with a single improved repulsion function can avoid obstacles and reach the target position in two complex environments.Although the local minima defect of the traditional artificial potential field method is solved, the path oscillation cannot be avoided, and the planned path of this method does not conform to the vehicle motion and the efficiency is low, which is not the optimal path.Combining the RRT algorithm with the improved artificial potential field method, no matter how complex the environment is, it can always plan an optimal path that conforms to the motion of the vehicle without oscillation.
From the comparative analysis of the trajectory tracking simulation, it can be seen that for the environment with multiple obstacles and U-shaped obstacles, the fluctuation range of the front wheel steering angle generated by the path planned by the method proposed in this paper is 0~0.15° and 0~0.5°, respectively, and the resulting yaw angle fluctuations range from 0~1.5° and 0~0.8°.The fluctuation range of the front wheel steering angle generated by the path planned by the vehicle tracking single improved artificial potential field method is 0~1.2° and 0~0.9°, and the generated yaw angle fluctuation range is −3~+3° and −0.4~1.6°.Although the simulation results of the two experiments are within the specified range, the path planned by the combination of the tracking RRT algorithm and the artificial potential field method with the improved repulsion function generates the smallest fluctuation range of the front wheel steering angle and the yaw angle.This further proves that the path planned by the combination of the vehicle tracking RRT algorithm and the artificial potential field method with improved repulsion function is more stable and the path conforms to the vehicle motion.

Conclusions
Aiming at the problem that the path planned by the improved artificial potential field method oscillates, this paper proposes a path planning method for unmanned vehicles based on the combination of the RRT algorithm and the improved artificial potential field method.The sampling function and obstacle avoidance method of the RRT algorithm can effectively solve the problem of path oscillation.When the path planned by the improved artificial potential field method oscillates, the RRT algorithm is switched in time to complete the remaining path planning.The planned path is smoothed and the MPC method is used to control the vehicle to track the path.Matlab simulation experiments show that in a complex environment, the path planned by this method does not oscillate and is an optimal path, and the vehicle can track the path stably, satisfying vehicle movement.At the same time, the smooth and non-oscillating path can reduce the wear of the tires during the driving process of the vehicle to a certain extent and improve the driving safety.

Figure 1 .
Figure 1.Force analysis of moving vehicle in artificial potential field.

Figure 2 .
Figure 2. Force analysis of moving vehicle in improved artificial potential field.

Figure 4 .
Figure 4. Collision detection schematic diagram of RRT algorithm.Path collision detection formula:

Figure 5 .
Figure 5. Vehicle dynamics model.In the coordinate system, the vehicle dynamics equation is as follows:

Figure 7
Figure 7 shows the comparison of the two path planning methods.Multiple obstacles are placed in the environment and the target is within the influence range of the obstacle's repulsion field.It can be seen from the figure that the path planned by the artificial potential field method with the improved repulsion function oscillates near the obstacle closer to the target, but the path finally reaches the target.

Figure 7 .
Figure 7.The path planned by the two methods.

Figure 8 .
Figure 8.(a) MPC tracks the trajectory planned by the improved APF method; (b) MPC tracks the trajectory planned by the combination of the improved APF method and the RRT algorithm.

Figure 9 .
Figure 9. (a) Front-wheel steering angle generated by MPC tracking trajectory; (b) Yaw angle generated by MPC tracking trajectory.

Figure 10 .
Figure 10.The path planned by the three methods.The coordinates of the obstacles in Figure11aremain unchanged.When the MPC method is applied from the starting point to track the path planned using the artificial potential field method with improved repulsive function, the vehicle generates too much error in tracking the reference path because there are multiple oscillations in the path.The trajectory shown by the tracking has large errors in the steering position and oscillation position of the path.When tracking the path where the oscillation occurs, the trajectory generated by MPC tracking goes directly through the obstacle.After passing through the obstacle, the vehicle stops moving forward and cannot continue to track the trajectory.It can be seen that this path does not satisfy the vehicle motion.

Figure 11 .
Figure 11.(a) MPC tracks the trajectory planned by the improved APF method; (b) MPC tracks the trajectory planned by the combination of the improved APF method and the RRT algorithm.

Figure 12 .
Figure 12.(a) Front-wheel steering angle generated by MPC tracking trajectory; (b) Yaw angle generated by MPC tracking trajectory.
3.1.Experiment 1: Setting Up Multiple Obstacles in the Environment