1. Introduction
Autonomous vehicles can reduce traffic accidents, improve traffic efficiency, reduce the operating burden of drivers and effectively improve the overall security of the traffic system [
1,
2]. In recent years, the research on the technologies related to autonomous vehicles has received extensive attention and concern. Before realizing autonomous driving, we still need to solve the key problems, including real-time dynamic environment perception, complex decision making, dynamic path planning and so on [
3,
4,
5]. Dynamic path planning needs to combine real-time environmental information to plan a real-time, reasonable and collision-free path. It is the key technology for the safe driving of autonomous vehicles. Many scholars have carried out a lot of research on dynamic path planning.
Path planning finds the available trajectory for an autonomous vehicle in an environment with obstacles, so that they can be avoided. Dynamic obstacle-avoidance path planning has the characteristics of time-varying and highly dynamic scenes, which makes it difficult to design an algorithm with real-time capabilities; it is easy for solutions to fall into local optima [
6,
7]. The current path-planning algorithms cannot meet all the working conditions needed and cannot ensure the optimal path selection. There is a certain tension between the real-time performance of the algorithm and the planning performance [
8,
9]. In the research of local path planning for autonomous vehicles, how to use an appropriate planning algorithm according to the information while taking into account the search efficiency, and how to establish a relatively perfect path-planning model for obstacle-avoidance path planning and path optimization for autonomous vehicles in a dynamic environment have become new research hot spots. Common methods for vehicle obstacle avoidance path planning include the intelligent water drop algorithm, the grid method, the artificial potential field method, the rapidly exploring random tree (RRT) algorithm and the probabilistic road maps (PRM) algorithm. Ji et al. used the trapezoidal acceleration method to design the virtual ideal trajectories in lane changes, solved the relationship between the change rate of lateral acceleration and the lane change time and solved the planning problem of finding a lane-change path in a setting with known road parameters [
10]. In order to improve the safety of obstacle-avoidance path planning, Luo converted the planning problem into a constrained optimization problem by using the time and distance involved in a lane change and designed a trajectory-function planning method based on a quantization polynomial [
11]. This method can update the reference trajectory during lane change to avoid potential collisions. Chen proposed a low-speed obstacle-avoidance path-planning method for autonomous vehicles based on the polar coordinate algorithm [
12]. This algorithm has high adaptability in complex scenes, and the real-time performance and application performance of the algorithm still need to be improved. Wang fused the vehicles parameters and the driver’s intention to quickly evaluate the risk level faced by vehicles during driving, and generated a smooth, safe collision-avoidance trajectory based on the improved fast exploration random tree algorithm according to the risk level [
13].
Considering the requirements of safety and real-time performance in dynamic traffic scenario, an obstacle-avoidance path-planning algorithm based on B-spline curves for autonomous vehicles is proposed in this paper. The main contributions of this paper are as follows: firstly, the mechanism of driver path planning is analyzed, and a dynamic risk-identification model based on the support vector machine is proposed. It combines the driver’s risk perception characteristics and a risk model. Then, the B-spline algorithm model is improved based on the risk-identification model. Furthermore, road features, road constraints and dynamic constraints are considered to further optimize the planning algorithm.
2. Risk-Identification Model Based on SVM
According to research by the national highway traffic safety administration (NHTSA), nearly 30% of traffic accidents occur during lane changes [
14]. In a dynamic traffic scenario, vehicles can avoid obstacles by changing lanes. Therefore, the establishment of a quantitative model of lane-changing risk has great influence in the path-planning algorithm design. In order to reduce the property loss and personal injuries caused by traffic accidents, researchers have classified the possible accidents during lane change and established risk-identification models [
15]. The results showed that the severity of a collision during a lane change is related to the speed, motion state and physical characteristics of the obstacle. Therefore, combining the characteristics of the obstacle with the psychological characteristics and operational characteristics of drivers, the researchers believe that performing the obstacle avoidance operation 0.3 to 1 s in advance would effectively improve the safety of the obstacle-avoidance process [
16]. On this basis, a simplified obstacle-avoidance safety model was established by combining the above driving-risk model and driver-behavior characteristics. By analyzing the obstacle-avoidance-operation characteristics of human drivers, it can be seen that the parameters of the obstacle ahead, including the size, type, weight and other factors, have a great impact on the driver’s lane-change decision. When the mass and volume of the obstacles are large, the driver thinks that the risk index of the current lane is high and tends to avoid the obstacle in advance. In addition, when the width of obstacles is large or the obstacle shows a trend of lateral movement, besides changing lane in advance, drivers usually keep larger lateral distance from obstacles to ensure the safety of the ego vehicle.
In actual driving process, the obstacle avoidance strategies of static obstacles and dynamic obstacles are different. Due to the uncertainty of dynamic obstacles, the design of obstacle avoidance strategies and path-planning algorithms is more complex. Therefore, the generated paths of autonomous vehicle obstacle avoidance should not only be collision free; they should also optimize the generated paths with real-time scenario information, which can further improve the availability and safety of generated paths. Human drivers will plan and choose different obstacle avoidance paths through different types of obstacles. One of the key factors of the driver path-planning strategy is to evaluate the ego vehicle collision damage degrees with different obstacles [
17]. The collision loss function describes the loss caused by collision between an ego-vehicle and obstacles when collision is unavoidable. The data show that the collision loss is related to the attributes of the collision object. The damage degree of ego-vehicle increases with the obstacle mass in collision. Therefore, the mass ratio of obstacle and ego-vehicle can be used to describe the impact of mass on collision loss. In addition, higher relative speed will also cause greater collision losses. Similarly, the speed ratio of the obstacle and the ego-vehicle can be used to describe the impact of speed on collision loss. Furthermore, the distance between the obstacle and ego-vehicle should also be considered, and the distance ratio is also used to describe collision losses. Based on the above analysis, the collision loss equation between ego-vehicle and obstacle can be expressed as [
17]:
where
is the speed difference between the vehicle and the object
i. In the determination of type
Ti value, the standard value can be set to one. For other types of objects, the
T value is the ratio of the average loss of this type of object to the average loss of the standard type. When collisions are unavoidable, the types of obstacles that collide with autonomous vehicles can be generally divided into three types [
17]. Additionally, according to the types, the risky level can be divided into three levels.
Based on the above collision loss model, the risk level of obstacles ahead is related to their shape, weight and relative speed. In order to complete the dynamic risk assessment of autonomous vehicles, according to the above risk assessment model, an obstacle risk identification model based on support vector machine (SVM) is proposed. The model is trained with the NGSIM dataset. Various traffic state databases such as vehicle category, size, position, speed, acceleration, space headway, time headway and relationship with surrounding vehicles in the dataset are set as the input of the model. In order to obtain the optimal results, particle swarm optimization (PSO) algorithm is used to optimize the SVM model. The penalty coefficient
C and the Gaussian kernel parameter
g with the highest classification accuracy are selected. The optimization process is shown in
Figure 1.
To verify the performance of the constructed PSO-SVM model, the test datasets are imported for classification verification. The results are shown in
Figure 2. Through comparison with the actual results in the test set, the PSO-SVM model can correctly identify the samples in the test set and complete the identification of the types and the risk identification of obstacles.
3. B-Spline Algorithm
The B-spline curve was proposed by Schoen-berg in the 1940s [
18]. The algorithm generates a curve shape by combining control points with B-spline basis functions. A cubic quasi-uniform B-spline curve is used for path planning in this paper. As the repeatability of the panel point at both ends is k, the curve starts at the first control point and ends at the last control point. In the path-planning algorithm design process, the requirements of remaining collision free and vehicle dynamics constraints should be meet. Then, the control points are selected according to the above constraints. In order to obtain obstacle avoidance paths meeting the application conditions, the selected control points are fused with the B-spline basis function and safety model. The specific relationship among curves, control points and B-spline basis functions is as follows, where
Pi (
i = 0, 1
, 2, …,
n) is the control point, and
n + 1 control points are fused with B-spline curve baseline. The k-order B-spline is:
where
represents the B-spline basis function of the
ith order
k at point
t,
t is the position independent variable,
k is the degree of the basis function and
.
The recurrence formula of B-spline basis function is expressed as follows:
where
i = 0, 1, 2, …,
k − 1;
.
Based on the above two formulas, it can be seen that the spline curve is generated by weighting the control points according to the spline basis function. The shape of the curve can be adjusted by changing the position of the spline control point, and it can synthesize the optimization results and computational complexity. A cubic quasi-uniform B-spline curve is applied to complete path planning in this paper, then:
According to the spline basis function, the cubic B-spline curve can be expressed as:
where
is the control point and
is the starting point, take four points as control points to get the first cubic B-spline curve. Then, starting with
, draw the second curve with the following four control points. The second derivative between curves is continuous.
The local obstacle avoidance path-planning process of autonomous vehicles is composed of obstacle detection, information processing and obstacle avoidance path generation. The autonomous vehicle obtains environment information and vehicle state information through on-board sensors. Based on the environment information and vehicle state information, the obstacle avoidance system of autonomous vehicle analyzes the real-time potential risk, and then the optimal obstacle avoidance path is generated. Additionally, the autonomous vehicle returns to the original lane after obstacle avoidance. The road model is established as shown in
Figure 3. The length and width of the vehicle are
h0 and
m0, respectively. The length of the road is
L and the width is 2
r. During normal driving, the vehicle body shall be in the lane, and it will not cross the road boundary except during lane changes. Then, the selection range of B-spline control point position (
x, y) is:
Local obstacle avoidance path planning is implemented based on global path. When an obstacle appears on the global reference path, the local obstacle avoidance path is planned according to the vehicle information and the surrounding environment information to correct the vehicle driving reference path. When there are obstacles in the original path, autonomous vehicle needs to implement local path planning based on the global path and real-time environment information. The cubic quasi-uniform B-spline algorithm can ensure the smoothness of the generated path, while the parameters of control points have a great impact on path availability. Therefore, in order to further ensure the availability of the generated path, the selection of control points of B-spline algorithm is improved in combination with obstacle avoidance scenarios in this paper. In the process of obstacle avoidance, autonomous vehicles cross lane lines to the target lane. The collision probability during lane change is greater than the other stage. Therefore, it is necessary to analyze the obstacle avoidance process and establish an obstacle avoidance safety model.
In the process of obstacle avoidance, the conditions under which the ego-vehicle does not collide with the moving obstacle in front can be expressed as:
where
indicates the longitudinal displacement of the ego-vehicle during the obstacle avoidance process shown in
Figure 4;
indicates the longitudinal displacement of the obstacle vehicle in the process of obstacle avoidance;
indicates the initial distance between the own vehicle and the obstacle vehicle;
indicates the width of the ego-vehicle;
indicates the included angle between the
X axis of the vehicle coordinate system and the lane; the value of
is related to the lateral speed of the vehicle.
It can be seen in
Figure 4 that the longitudinal displacement generated by the ego-vehicle during the obstacle avoidance process can be expressed by the following formula:
Similarly, the longitudinal displacement of the obstacle vehicle during the obstacle avoidance process shown in
Figure 4 can be expressed by the following formula:
where
is the time period in which the ego-vehicle starts decelerate and reach the critical point of collision. In order to ensure that there is no collision within the time period of obstacle avoidance shown in
Figure 4, it can be inferred from formula (7) that the initial distance
S should meet the following conditions:
Combining the above formula with the vehicle kinematics model in the obstacle avoidance process shown in
Figure 4, the minimum longitudinal safety distance required for the ego-vehicle to complete the obstacle avoidance without collision can be expressed as:
Autonomous vehicle obstacle avoidance and lane changes take a short time in real traffic scenarios. The following assumptions can be made: the ego-vehicle braking deceleration is constant and the speed of the obstacle is stable. The time taken for the ego-vehicle to decelerate to the same speed as the obstacle vehicle can be regarded as the critical time of collision.
In a real traffic scenario, the relative speed of the vehicle is usually low when it overtakes an obstacle vehicle, resulting in errors in the calculation results of formula (11). In order to ensure driving safety, this paper improves the minimum safe distance model in formula (11) by considering the headway and driver behavior characteristics, and the improved model can be expressed as:
where
c represents the headway,
represents the safety breaking distance threshold,
is the hazard characterization coefficient of obstacles, which
.
By considering the drivers’ operation characteristics and combining the real-time obstacle information, the original minimum longitudinal safe distance is improved. The improved safety model can adjust the selection of safety margin in different scenarios according to the type and moving state of obstacles. This improvement can optimize the path-planning algorithm, further improve the safety of the generated paths and ensure the safety of autonomous vehicle obstacle avoidance.
The control points position of the B-spline algorithm should be determined according to the real-time position of obstacles on the road. The rear center point of the obstacle vehicle is selected as (
x0, −
), and the first control point is set as
P0 = (
x0 − min
D, −
). Meanwhile, in order to satisfy that the yaw of autonomous vehicle at the initial time is zero without sudden change, set
P2 = (
x0 +
h0 − min
D, −
). To further strengthen this constraint, set the control point
P1 = (
x0 − min
D, −
). Assuming that the vehicle is driving at the original speed, when the distance from the obstacle vehicle to the collision-free critical position is min
D. At this time, the displacement of the obstacle vehicle can be expressed as:
Therefore, when the obstacle vehicle reaches the critical position, its rear abscissa is x0 + x1. If the head abscissa of the autonomous vehicle is located at x0 + x1, the vehicle can cross the lane line to the target lane. This ensures that the ego-vehicle has enough safety space from the obstacle vehicle and the roadside. In addition, the lateral displacement of the ego-vehicle is small in this period, which ensures that the lateral acceleration takes place within a reasonable range. Therefore, the control point is P3 = (x0 + x1, ).
After entering the target lane, the autonomous vehicle will drive along the center of the target lane. When the ego-vehicle finishes overtaking and reaches a safe distance from the obstacle vehicle, the ego-vehicle will return to the original lane. The time required for the autonomous vehicle to complete the above operations can be expressed as:
where
h0 is the length of the ego-vehicle;
h1 is the length of the obstacle vehicle.
Therefore, the starting abscissa of autonomous driving back to the original lane can be expressed as:
Then, the control point 4 = (0 +1, ), 5 = (2, ) is selected. The path back to the original lane is set to be symmetrical with the obstacle avoidance path. Additionally, the control point 6 = (minD + 2 − 0, −), 7 = (min2 − , −), P8 = (minDx2, −) is selected, respectively.
5. Path Tracking Method Based on LQR
The path-planning algorithm for autonomous vehicles should not only meet the requirements of a collision-free path, but also meets the requirements of path smoothness. The generated paths are smooth and can be tracked by autonomous vehicles. The generated path should conform to the dynamic constraints of the vehicle. Therefore, it is necessary to further verify the availability of the generation paths. The effectiveness of the path generated by the obstacle avoidance path algorithm can be fully verified through real vehicle experiments. However, due to the high cost of real vehicle experiments and the risk of real vehicle high-speed path tracking experiments, most path availability experiments are currently completed through Co-simulation experiments.
In order to verify the path availability, a path tracking model based on a Linear Quadratic Regulator (LQR) approach for autonomous vehicles is established in this paper. This method mainly obtains the optimal control effect by solving the state space equation and performance index function of the system [
19]. The tracking control system in this paper consists of a prediction module, an error calculation module, a feedback coefficient calculation module, a feedforward control module and a front-wheel-angle control module. The tracking system calculates the next vehicle state according to the current vehicle position, speed, yaw angle, yaw rate and other parameters. Then, the calculated vehicle state is compared with the tracking path parameters to obtain the error. Finally, the error is combined with the feedback coefficient and feedforward value obtained from the vehicle steering index to control the front wheel angle of the vehicle.
Combined with the two-degree-of-freedom vehicle dynamics model, the state space of the vehicle error model can be expressed as:
where:
where
is the front wheel steering stiffness,
is the rear wheel steering stiffness,
is the front wheel angle,
is the vehicle mass,
is the vehicle yaw angle and
is the course angle of the vehicle speed at the projection point under the Frenet coordinate system.
is the course angle derivative of vehicle speed at the projection point in the Frenet coordinate system.
is the longitudinal speed of the vehicle.
is the distance from the front axle to the barycenter.
is the distance from the rear axle to the barycenter.
is the lateral error.
is the derivative of lateral error.
is the moment of inertia of the vehicle about the
z-axis perpendicular to the ground.
Due to the discrete LQR control mode in this paper, Equation (16) needs to be discretized. Ignoring
, the formula can be expressed as:
Then, after discretization of the formula, the following formula is obtained:
where:
where
I is the identity matrix.
By establishing the following cost function:
where
Q and
R are the diagonal matrix, the parameter represents the weight coefficient of each variable. By calculating its minimum value under the constraint of Equation (23), then:
where
, it is called the feedback coefficient.
is obtained by the Riccati formula constructed in the solution process through multiple iterations. The Riccati formula is:
when
, the formula of (16) can be converted into:
In this formula,
and
cannot be zero at the same time; that is, the error cannot be kept to zero during vehicle driving. Therefore, it needs the feedforward control part to optimize. The following formula is established:
where
is the feedforward control part.
To satisfy that
is as zero as possible when
is zero, after approximating some values, then:
where
K is the curvature of the curve.
In order to verify the availability of the generated path, a steering control module for autonomous vehicles based on LQR is established in this paper. Then, based on the proposed LQR tracking control algorithm, the MATLAB/CarSim Co-simulation experiments are carried out. For the four obstacle avoidance scenarios in this paper, the scenario of ego-vehicle to avoid dynamic obstacles requires high smoothness of the path. Therefore, a series of co-simulation tests are conducted to verify the availability of the generated paths. In the test scenarios, the speed of the obstacle vehicle is 10 km/h, and the controlled vehicle runs along the planned path at 35 km/h and 70 km/h, respectively. The ego-vehicle detects the obstacle and completes obstacle avoidance, and returns to the original lane after overtaking the obstacle vehicle. The proposed path-planning module generates the obstacle avoidance path according to the obstacle vehicle and environmental information, and the controlled vehicle tracks the generated path based on the proposed LQR algorithm. The simulation parameters of controlled vehicle are shown in
Table 1.
The steering wheel angle curve of the vehicle during the simulation is shown in
Figure 9. The steering wheel angle curve is smooth and continuous without oscillation and sudden change. The simulation results show that the generated path is available and conforms to the operating characteristics of human drivers.
Figure 10 shows the curve of the front wheel angle of the controlled vehicle. As shown in the figure, the front wheel turning angle of the controlled vehicle is between ± 3 deg. The numerical fluctuation range meets the constraint conditions of the front wheel angle, and the front wheel angle curve is smooth, continuous, without oscillation and sudden change.
Figure 11 shows the lateral acceleration curve of the controlled vehicle. As shown in the figure, when the controlled vehicle avoids obstacles at a speed of 70 km/h, the lateral acceleration of the vehicle is large, and the maximum acceleration is 3.65 m/s
2. In this simulation scenario, the vehicle is running on a dry asphalt road. In order to ensure that the vehicle tires are in a linear working area, the maximum lateral acceleration should be less than 3.92 m/s
2 (0.4 times of the gravitational acceleration). The small lateral acceleration ensures the stability and comfort of the vehicle and proves the availability of the path.
Figure 12a,b, respectively, show the yaw angle and yaw rate curves of the controlled vehicle at different speeds. As shown in the figure, when the vehicle speed is 35 km/h and 70 km/h, respectively, the yaw rate of the vehicle is always maintained within the range of ±11.5 deg/s, and the yaw angle of the vehicle is also maintained within the range of ±11.5 deg. The above results show that the vehicle can track the generated path at different speeds to complete obstacle avoidance operation, and the vehicle is stable throughout the process, without sideslip and tail flick.
Figure 13 shows the roll angle of the ego-vehicle. The roll angle is an important parameter to indicate whether rollover accident will occur. As shown in the figure, when the controlled vehicle avoids the moving obstacle at 70 km/h, the roll angle value of the controlled vehicle is large. During the simulation, the roll angle range of the controlled vehicle is −1.37 deg to 0.88 deg at the speed 70 km/h. The result shows that the possibility of vehicle rollover accident is low when the controlled vehicle tracks the generated path at high speed.
The simulation results show that the paths generated by the path-planning module are collision free in both scenarios, and the controlled vehicle can accurately track the generated reference path at speeds of 35 km/h and 70 km/h. The key dynamic parameters of the vehicle in the simulation process are analyzed. The results show that the controlled vehicle can ensure the vehicle handling stability when tracking the generated obstacle avoidance paths. The relatively small lateral acceleration can also ensure the driving comfort of the controlled vehicle, and can meet the vehicle dynamics constraints and lane constraints. All results prove that the proposed path-planning algorithm is consistent with the expected lane change results, and it meets the requirements of autonomous vehicle obstacle avoidance path planning.