1. Introduction
In recent years, autonomous driving technology has undergone considerable improvement. Academic and industrial circles around the world are actively promoting practical commercial applications for this technology, injecting new vitality into the research of autonomous driving technology [
1]. Self-driving cars rely on advanced intelligent control vehicle technology to reduce traffic accidents caused by driver errors, and even reduce the incidence of traffic accidents to zero. Autonomous driving technology must ensure accurate avoidance of pedestrians, so V2P is one of the core technologies in autonomous driving [
2,
3,
4]. It notifies both people and vehicles by analyzing the key information of vehicles and pedestrians; this can prevent collisions between people and vehicles and effectively improve road traffic efficiency, in order to achieve intelligent transportation solutions for vehicle–road coordination.
V2P usually predicts whether there is a risk of collision between people and vehicles, and judges whether an alarm needs to be issued to warn pedestrians and vehicles. A V2X (vehicle-to-everything) collaborative system based on cellular and 802.11p radio is designed in [
5], and the SafeNav Android application is proposed, in which the interface sets a determined collision area, and if multiple traffic participants enter the collision area, the color of the traffic participant changes to red and it produces a visual and audible alarm. In [
3], a mobile application is proposed by Hussein et al. that supports pedestrians and vehicles. When the user interacts with their mobile phone, the screen is activated to detect the location coordinates of the mobile phone. The system calculates the potential collision point and judges whether collision is possible. This application, with its user-friendly operation, increases VRU (Vulnerable Road User)s’ visual situational awareness of locations near automatic- or manual-control vehicles. The above studies all needed to predict the degree of risk, and the vehicles needed to switch frequently to the “stop-go” state. The vehicles did not actively avoid pedestrians, and the degree of intelligence was not high, which may bring certain safety risks [
6]. Trajectory planning can realize active obstacle avoidance for V2P vehicles [
7]. In order to safely and quickly move a vehicle from its current location to the target location, it is necessary to design a robust trajectory planning strategy.
At present, classic trajectory planning includes rule-based methods [
8,
9], graph search methods [
10,
11,
12], and numerical optimization methods [
13]. The rule-based method aims to establish a behavior rule base based on vehicle driving rules and experience information, divide the state according to different environmental information, and determine the vehicle driving trajectory according to the rule logic. In [
14], an autonomous vehicle control system based on the FSM (finite state machine) rule-based method was proposed by Sang-Hyeon Bae et al. The proposed vehicle system can handle six major urban environment driving situations. The system actively recognizes the real-time driving environment, formulates an action plan based on the finite state machine, and activates motion model control. The rule-based method can effectively deal with some typical driving scenarios defined in the rule base, but due to the limited number of added driving scenarios, it cannot handle driving scenarios that have not been added to the rule base; thus, it has certain limitations.
To solve the problem of limited driving scenarios, the graph search method is used for trajectory planning. Dijkstra, BFS (Best First Search), and A* are common graph search planning algorithms [
15]. Dijkstra’s algorithm starts from the initial point where the object is located, visits the adjacent nodes of the initial point in the graph until it reaches the target point, and finally, outputs the shortest path; however, the algorithm runs for a long time and is not in real time. The BFS algorithm quickly guides the target point by introducing a heuristic function, thereby effectively improving the running speed of the algorithm. The heuristic function evaluates the cost from any node to the target node, and selects the node closest to the target instead of the node closest to the initial point. Therefore, there is no guarantee that the shortest path will be found. The A* algorithm combines the advantages of the heuristic algorithm, BFS, and the Dijkstra algorithm; not only can it find the shortest path, but in a simple static road environment, the algorithm running time is also as fast as BFS. This, it can meet the real-time requirements of vehicle trajectory planning [
16]. The graph search method is suitable for situations where obstacles are stationary, while pedestrians cannot be considered static obstacles, similarly to roads, so they cannot be directly applied to V2P scenarios.
The artificial potential field method has become a classic algorithm in numerical optimization methods due to its simple principle, its small amount of calculation, and its high execution efficiency, and is widely used in robot trajectory planning [
17]. The artificial potential field method has a small amount of calculation and fast calculation speed; thus, it meets the high real-time requirements of vehicle trajectory planning, and supports the independent design of the attraction potential field generated by the target position, and the repulsive potential field generated by obstacles, to meet the requirements of different scenarios. In [
18], Lu et al. proposed a method to find a path by fitting the curve of the target point and the critical oscillation point, reducing the path jitter, and making the path smoother. Virtual repulsion was added by Azzabi A et al. [
19] to improve the repulsion potential field function and solve the local optimum of the artificial potential field. However, since the direction of virtual repulsion is uncertain, it may cause new problems. The application of the above-mentioned artificial potential field method does not consider the vehicle’s motion constraints, so it cannot be directly applied to the vehicle trajectory planning problem.
Due to its ability to deal with system multi-constraint problems, the model predictive control (MPC) algorithm in numerical optimization is widely used in the field of automatic driving [
20]. MPC establishes a mathematical model with a cost function and constraints. Constrained optimization problems can be solved using linear programming methods according to the cost and the complexity of the constraint function. The advantage is that the optimal trajectory is not constrained by a predefined pattern. Cost and constraint functions adapt to the driving environment with road geometry, boundaries, and obstacles. This adaptability makes the final trajectory highly adaptable to changes in the environment. A solution proposed by Mekala et al. was to use MPC to control speed for obstacle avoidance, so that the vehicle can accelerate and decelerate smoothly, but obstacles are represented as hard constraints in the optimization process; this may lead to the non-existence of feasible solutions in practice [
21]. An iterative nonlinear model predictive control path planner using a point-mass vehicle model was proposed by Murillo et al., which considered vehicle dynamic constraints but not road boundaries [
22].
This paper proposes an obstacle avoidance trajectory planning algorithm that meets the needs of vehicle path planning. First, pedestrians are ignored and only road boundaries are considered, and the A* algorithm is used to give the shortest path from the initial point of the vehicle to the target point as a reference path. Secondly, pedestrians are regarded as dynamic obstacles, and a linear prediction model is established on the basis of the vehicle model, which is used to predict the future state of the vehicle. Based on the artificial potential field method and the vehicle motion constraints, the input constraints and output variable constraints are jointly controlled to plan the vehicle’s trajectory. Finally, the trajectory planning algorithm proposed in this paper is verified via test verification.
The rest of this paper is organized as follows.
Section 2 describes the preprocessing process of GPS data information.
Section 3 introduces the proposed trajectory planning algorithm and gives the algorithmic framework to safely and efficiently solve the active obstacle avoidance problem in vehicles.
Section 4 outlines the test verification and analyzes the results of the algorithm to verify the validity of the algorithm. Finally, the conclusions are given in
Section 5.
3. Trajectory Planning
Trajectory planning was divided into path planning and speed planning. First, under the environment in which obstacles are ignored, the A* algorithm was used to construct the drivable area, and initial global planning of the path from the initial point to the target point was carried out to produce a reference path. Secondly, the artificial potential field method and MPC were combined for trajectory planning.
3.1. A* Path Planning
The Dijkstra, Best First Search (BFS), and A* algorithms are three typical path planning algorithms. Dijkstra’s algorithm is guaranteed to find the shortest path from the initial point to the goal point, but it runs slowly [
23,
24]. BFS runs faster than Dijkstra’s algorithm, but it cannot be guaranteed to find the shortest path [
25]. The A* algorithm is a heuristic search algorithm that can perform global path planning in a static environment according to a defined evaluation function [
17]. It responds quickly to the environment and searches the path directly, so it is widely used in path planning research. This algorithm can greatly reduce search time and improve path search efficiency while keeping the path as short as possible. Since the static road environment where the vehicle is driving is relatively simple, in simple cases, the A* algorithm runs as fast as BFS. Therefore, this paper uses the A* algorithm to plan the global path and generate a vehicle reference path.
The heuristic function of the A* algorithm contains information on the initial point and the target point at the same time, and the priority of each node is calculated using Formula (7):
where
is the comprehensive priority of the node
. When selecting the next node to traverse, the node with the smallest
value and the highest priority will be selected.
is the cost of the node
from the initial point.
is the heuristic function of the A* algorithm, and is the estimated cost of the node distance from the target point. This paper allowed the vehicle to move in eight directions (namely: front, rear, left, right, right front, right rear, left rear, and left front, corresponding to
values of 1, 1, 1, 1, 1.5, 1.5, 1.5, and 1.5), and the Euclidean distance was chosen as the heuristic function.
3.2. Vehicle and Pedestrian Models
When using MPC for local trajectory planning, the motion states of vehicles and pedestrians are required. Therefore, the monorail vehicle kinematics model and the pedestrian (dynamic obstacle) model were established first, and were used to describe the state of the vehicle and pedestrian, respectively.
3.2.1. Vehicle Model
This paper mainly considers the plane motion of the vehicle, and used a single-track model to describe the vehicle, taking the rear wheel of the vehicle as a reference point, as shown in
Figure 1.
represents the direction of the speed of the vehicle,
represents the wheelbase,
represents the vehicle’s current speed, and
represents the angle between the two speed directions at the front and rear of the vehicle.
The updated formula of each state quantity in the model is as follows:
where
and
are the longitudinal and lateral positions of the vehicle, and
is the acceleration of the vehicle.
3.2.2. Pedestrian Model
The basic aim of the traditional artificial potential field method is to control the robot to find a collision-free path by constructing an artificial force field based on the attraction field of the target point and the repulsive force fields of the obstacles, and using the falling direction of the search potential function. The path planning of the robot does not need to consider the boundary and road environment, but for the vehicle, it needs to consider the constraints of the road, so the model construction is more complicated.
During the driving process of the vehicle, the most common dynamic obstacle is the pedestrian. In this paper, the pedestrian is abstracted as an obstacle point. Since the pedestrian is a dynamic obstacle, the position and velocity of the pedestrian should also be taken into account in the obstacle potential field. According to the space dynamics equation and the Lagrangian equation, the resultant force of the vehicle is the vector superposition of the repulsive force and the attraction force, and the direction of the resultant force is the moving direction of the vehicle. Under the action of the resultant force, the vehicle can bypass obstacles and reach the end point. The resultant force
can be expressed as:
where
is the attraction force generated by the target point on the controlled object, and
is the repulsive force generated by the obstacle on the controlled object. Assuming there are
obstacle points, the attraction function
and repulsion function
are redefined as:
where
are the position coordinates of the vehicle at any time,
are the coordinates of the end position of the vehicle,
is the gravitational potential energy gain coefficient, and
is the Euclidean distance between the vehicle and the nearest obstacle.
is the radius of the obstacle repulsion field. When the distance between the vehicle and the obstacle is less than
, the vehicle will be affected by the repulsion.
is the repulsive potential energy gain coefficient,
are the obstacle coordinates, and
,
is the combination of position and velocity.
3.3. MPC Trajectory Planning
The MPC method is a numerical optimization method. According to the model and the current state quantity output, the deviation between the predicted trajectory and the expected trajectory is calculated, and control quantity input and output constraints are imposed to ensure that the vehicle can meet the corresponding motion constraints and avoid collisions. In the trajectory planning process, the future behavior of the vehicle needs to be predicted within the specified forecast horizon, and the control input at the next moment is calculated by minimizing the error between the predictor and the reference point under various constraints. On the basis of Formula (8), the linear prediction model of the current sampling moment is established as follows:
Since the controlled system in MPC usually adopts a discrete state space model, it is necessary to establish a state space expression under a linear discrete time system, and expand the state space variable
and the control variable
into a new state variable
. The new state space expression is as follows:
where
,
, and
are output variables.
are all related to the four identical variables, and Formula (14) lists the expression for
.
Based on the state space model for predicting the future dynamics of the system, Formula (13) is rewritten as an incremental model as follows:
where
The prediction range of the MPC-based upper decision controller is set to
and the control range is set to
. In addition,
. Assuming that the current moment is
,
. Using the current state information to define the input vector and predicted output vector of the system in the future
, the steps are as follows:
The output vector prediction equation for the next
steps is as follows:
where
In order to ensure that the predicted output variable is as close as possible to the reference trajectory, that is, that the vehicle uses the shortest path as much as possible, the objective function for constructing the optimization solution is as follows:
In the formula, is the weight coefficient, is the relaxation factor, are the weighted matrices of the output error and control input, respectively, and is the reference path, which is the path obtained by the A algorithm. The first item of the objective function represents the planning trajectory, and the reference trajectory should be as close as possible to ensure the shortest planned trajectory. The second item aims to control the incremental size to ensure that there will be no drastic changes in speed, heading angle, or acceleration during the operation of the vehicle, and to ensure the stability and comfort of the vehicle to a certain extent. The third item represents the potential energy value of the vehicle in the obstacle potential field, which ensures that the vehicle can effectively avoid dynamic obstacles. The fourth term is the relaxation factor, which can enhance the solution of the feasible domain, so as to ensure that there is an optimal solution to the programming problem.
To ensure the safety of vehicle obstacle avoidance and reduce the influence of the maneuvering process on the comfort of the vehicle, the control process needs to take into account the corresponding constraints. Through these constraints, the vehicle can avoid accelerating or decelerating too quickly, thereby ensuring driving safety and comfort, and the control input must meet the following constraints [
26,
27]:
where
is the best reference speed. Speeds of 12 m/s and 16 m/s were chosen because they correspond to typical speeds of 40 m/h and 60 m/h.
3.4. Algorithm Framework Description
Figure 2 describes the proposed algorithm framework. The algorithm takes the road environment, pedestrian trajectory, and vehicle running state as inputs, and combines the A* algorithm, the artificial potential field method, and MPC trajectory planning to finally output the vehicle control state and guide the vehicle to avoid obstacles. First, according to the initial point and target point of the vehicle, combined with the road environment, the A* algorithm is used to plan a global path, which will function as the reference path. Secondly, based on the global path, PF processes the position information of pedestrians and vehicles, and uses the artificial potential field method and MPC algorithm to plan a trajectory that satisfies the obstacle model and vehicle motion constraints.