1. Introduction
With the development of an intelligent transportation system (ITS), parking technology has gone through three stages: semi-autonomous parking, autonomous parking, and autonomous valet parking (AVP) [
1]. The semi-autonomous parking system and autonomous parking system are used to help drivers park safely. Moreover, a shorter parking time can effectively reduce the negative impact of a parking process on road traffic. In addition, the last-mile transportation of autonomous driving can be achieved with an AVP system since users can send instructions through terminal devices to park or retrieve their cars [
2]. In this context, parking technology is an indispensable part of the autonomous driving system.
Among the key technologies of AVP, researchers focus on the platforms, sensor setups, perception, environment model, maps, and motion planning [
3]. As the basis for the realization of AVP, environmental perception is mainly realized by a fusion of ultrasonic radars and cameras [
4]. On this basis, a parking guidance system (PGS) based on visual recognition is built, and environment information is shared between the vehicle and the infrastructure system [
5]. Furthermore, the tracking control is utilized to move the vehicle along the planned target path by the lateral and longitudinal motion controls [
6,
7].
Considering that the effects of environment perception and tracking control mainly depend on the accuracy of the sensors, path planning plays an important role in the entire system as a decision-making part. Thus, vehicle path planning is a research hotspot in the intelligent AVP technology. In the early days, curves composed of straight lines and arc joints, like Dubins curve and Reeds–Shepp curve, were used to solve planning problems by setting the shortest path as the goal [
8,
9]. Additionally, the geometric construction method of a straight line combined with arc joints has been widely used in the path planning of parallel parking [
10]. However, the curvature of the path is discontinuous despite that the path can be easily obtained by this method. Therefore, methods such as clothoid curve, B-spline, and polynomial curve are applied to optimize the curvature of the path, but these methods are difficult to apply in path planning with a complicated constraint model [
11,
12,
13].
In subsequent development, the path planning algorithms of motion planning are mainly divided into the following four categories: graph-search, sample-based, interpolation, and numerical optimization [
14]. Considering the simplicity of practical application, graph-search methods are more efficient than traditional path planning strategies [
15]. For example, classical graph-search algorithms like the Dijkstra and A* algorithms are both widely used to search the shortest path [
16,
17,
18]. Moreover, compared with the Dijkstra algorithm, heuristic guidance is combined with the A* algorithm to reduce search work. However, they are not efficient enough to obtain the shortest path in a complicated environment. On the contrary, both the Probabilistic Roadmap Method(PRM) and Rapid-exploration Random Tree(RRT), which are based on random sampling points for planning the best path in a space, can effectively deal with a path planning problem with complicated constraints [
19,
20]. The above methods are all effective in global planning. However, for local path planning, the artificial potential field (AFK) for obtaining the path along the direction of the field drop is more suitable [
21].
Compared with the traditional algorithms mentioned above, heuristic algorithms (e.g., machine learning, neural network, fuzzy control, genetic algorithm, particle swarm optimization, and colony algorithm [
22,
23,
24,
25,
26,
27]) are more widely applied in solving path planning problems. In a complex dynamic environment, bio-inspired planning algorithms are effective for collision-free planning [
28,
29]. Additionally, in an actual urban environment, a motion planning method based on a layered strategy is more suitable for the application of autonomous driving [
30]. Moreover, scholars tend to combine traditional algorithms with heuristic algorithms to obtain better planning results. For example, the model predictive control method is used for real-time path planning [
31]. Furthermore, the path planning problem is described as an optimal control problem based on optimal control theory [
32,
33,
34].
In general, the key to developing AVP technology is the cooperation between trajectory planning and parking management systems [
35]. Problems such as complex environment models and low computational efficiency are common in existing trajectory planning methods. To solve these problems, a method that obtains the optimal trajectory of AVP by solving the optimal control problem is proposed. The vehicle kinematics model, obstacle avoidance constraints, and endpoint constraints are established. The shortest overall parking time and travel distance are set as the cost function of the optimal control problem, which are established to describe the parking trajectory planning problem. On this basis, the contribution of this paper has two main components: (i) A homotopic method is utilized to transform the obstacle avoidance constraint in each iteration, and the optimal solution is set as the initial guess of the next new problem. The purpose of this step is to increase the success rate of offline planning with less cost. (ii) An online calculation method of vertical parking trajectory is proposed, where the starting points are decided in the initial area of vertical parking to build a matrix. Additionally, the parking trajectory of each starting point is obtained by offline calculation and stored. To improve the real-time performance of online calculation, in the vertical parking phase, the appropriate trajectory data are selected as the initial guess of online calculation according to the actual starting position of parking. Then, the Gauss pseudospectral method (GPM) is used to obtain the vertical parking trajectory.
A small parking lot is selected as the scenario of AVP, and the parking trajectory planning is separated into two phases. In this context, the trajectories of the two phases are simulated and analyzed. On this basis, the vertical parking trajectory is calculated online to verify the effectiveness of the proposed algorithm.
The remainder of the paper is organized as follows. The AVP scenario and the optimal control problem for parking, including kinematics models and various constraints, are described in
Section 2. The optimal control problem is discretized as the nonlinear programming (NLP) problem through the GPM, and the solution strategy of the NLP problem through the homotopic method is described in
Section 3. The simulation results and discussion of parking trajectory are in
Section 4, and an online planning method of vertical parking is proposed. Finally, the conclusion and future works are discussed in
Section 5.
3. Homotopic Method for Solving Optimal Control Problem
In
Section 3, a unified trajectory optimization framework for the parking problem is presented. The GPM is utilized to discretize the above optimal control problem into a nonlinear programming problem for solving [
37]. Here, the location of the collocation point is determined at first, and the state variables and control variables are discretized into unknown parameters at the collocation points. Then, Lagrange interpolation polynomials are constructed from these collocation points to determine the continuous state variables and control variables. By deriving the above Lagrange interpolation polynomials, the parking kinematics equation is transformed into algebraic equations at the collocation points, and the integral part of the cost function is discretized by the Gauss integral. Compared with the traditional collocation method and direct shooting method, the GPM, a kind of global collocation method, has better solving accuracy and convergence speed [
38,
39]. However, for nonsmooth problems, the convergence speed of the GPM is slower. To this end, a homotopic method is used to change the boundary of the obstacle avoidance constraint in the optimal control problem, and the solution of the last optimal control problem is used as the initial value of the next solution. The detailed framework is described as follows:
Step 1. Time domain transformation
The time domain of parking trajectory planning
is transformed into a time domain of the GPM in [−1,1]:
Step 2. Discretization of variables
Lagrange interpolation and Gauss quadrature equations are used to discretize the optimal control problem at a series of Legendre–Gauss (LG) points. The discrete points of the GPM include N+1 points composed of NLG points and
. State variables and control variables are approximated at each configuration point as follows:
where
and
stand for state variables and control variables, respectively.
and
refer to discrete variables, and
denotes Lagrange interpolation basis functions.
Step 3. Transformation of state equation and constraint equation
After the derivation of Equation (11), the obtained derivative of a state variable at collocation point
can be approximated as follows:
where
denotes a differential state matrix, which represents the differential value of the Lagrange interpolation basis function at each collocation point. Through Equation (13), a state equation can be transformed into equality constraints, as follows:
The obstacle avoidance constraints and endpoint constraints in parking trajectories are also discretized at the collocation points. The obtained equality constraints are as follows:
where
and
denote the obstacle avoidance constraint and endpoint constraint, respectively.
Step 4. Transformation of cost function
The integral term in the cost function can be approximated by the Gauss integral method. In this way, the cost function is transformed as follows:
where
stands for the integral weight.
Step 5. The homotopic transformation of constraint equation
The optimal control problem of parking trajectory planning becomes unsmooth with the increase of environment complexity, which makes it difficult to solve the original problem by directly using the GPM. Thus, this paper proposes a homotopic method to improve the smoothness of the original problem. In the proposed method, the bounds of obstacle avoidance constraints in the original problem are taken as homotopic parameters to make the original problem of parking trajectory planning smoother. In this way, the unsmooth original problem is directly solved without changing the form of the original problem. In addition, the optimal solution is used as the initial value of the next calculation. To this end, Equation (15) is transformed as follows:
where
denotes the homotopic parameter vector. To improve the convergence of the generated new problem,
is added, releasing the constraint boundaries. Therefore, when
evolves into 0, the problem becomes the original problem. Equation (18) can also be transformed as follows:
It is worth noting that Equation (19) has the same form as Equation (15). Therefore, the solution of the original problem can be obtained by constant iteration with a homotopic method. Moreover, the result of the last optimal control problem is taken as a better initial value, which reduces the difficulty of the next solution. As a result, the convergence speed of the solution is effectively improved.
After the five steps above, the optimal control problem of parking trajectory planning is transformed into a discrete NLP problem by the GPM, and SNOPT is adopted as the software package in this paper. The overall flowchart of the proposed GPM-based methodology is demonstrated in
Figure 6.
4. Simulation Results and Discussion
The trajectory planning of AVP is separated into two phases. Two obtained optimal trajectories of corresponding phases are spliced into a complete trajectory of the whole AVP. The code is executed on a laptop running Windows 7 with an Intel(R) Core(TM) i5-3210M 2.50 GHz processor and 8 GB RAM, written in MATLAB. The vehicle parameters and physical constraints used in the simulation are shown in
Table 1.
4.1. Trajectory of Parking Space Searching Phase
In the first phase of the parking process, the vehicle moves from the entrance of the parking lot to the initial area of vertical parking. In this phase, it is assumed that there are no other dynamic obstacles, such as vehicles and pedestrians, but only some constraints of road boundary and parking space. The position of the vehicle at the entrance and the initial area of vertical parking are defined as follows:
According to the above-mentioned algorithm, the trajectory planning problem of the first phase is solved without constraints, and the trajectory of the vehicle (see
Figure 7a) is a circular arc. The termination condition is that all the vertices of the vehicle fall in the initial parking area. In this context, the vehicle reaches the top, rather than the middle, of the initial parking area to optimize the cost function, which is shown in
Figure 7a. It is also found out that the trajectory intersects with the parking spaces in the middle of the parking lot, instead of those at the bottom or top of the parking lot. Therefore, by using the above-mentioned homotopic algorithm, the constraints of the middle parking spaces are gradually approximated to the constraints of the original optimal control problem. Then vehicle trajectories from the entrance to the initial area of parking are obtained by iterative solution, which are shown in
Figure 7b,c.
4.2. Trajectory in Vertical Parking Phase
In the second phase of the parking process, the convenience of passengers in getting on and off has to be considered. To this end, the minimum width of the space on both sides of the vehicle when the parking ends is set to 0.3. Therefore, the minimum parking length min
is set to 2.3, and the parking width
is set to 5.0. Additionally, based on the range of the initial parking area, the road width
is set to 4.5 (see
Figure 5). For the convenience of calculation, the upper-left vertex of the vertical parking space is set as the origin of the coordinate system, that is,
. Furthermore, the coordinate of the central point of the rear axle at the starting position is
. In addition, the termination condition of parking completion is required to meet the constraints in Equation (8), and the equation of
to ensure that the vehicle is in the middle of the parking space at the ending moment.
According to the above-mentioned homotopic algorithm, the parking space
gradually decreases from 3.5 to the minimum value. In other words, the homotopic parameter
, where the step length
. Hence, the problem is solved with 61 times of iteration, and there is only a difference of
Lp between each iteration process. Then, four vertical parking processes with different
Lp values are selected for analysis and discussion. The values of
Lp in Cases 1–4 are set as 3.50, 3.12, 2.72, and 2.30, respectively. The optimized trajectory, control variables, and state variables are illustrated in
Figure 8,
Figure 9,
Figure 10,
Figure 11,
Figure 12,
Figure 13,
Figure 14 and
Figure 15.
First of all, all vehicles can complete vertical parking and meet the above-mentioned termination constraints in Cases 1–4, which means that the vehicle is in the middle of the parking space when the parking ends. The control variables all present the feature of the bang–bang control (see
Figure 9,
Figure 11,
Figure 13, and
Figure 15) because time is required to be optimal in cost function. That is to say that the state variables are continuous and smooth despite that the control variables are oscillated.
As shown in
Figure 8 and
Figure 10, the trajectories in Cases 1 and 2 are similar. The adjustment of the vehicle occurs outside the parking space rather than inside, even if the parking space is relatively larger in Cases 1 and 2. This phenomenon is similar to our daily manual vertical parking process because the narrow parking space is not conducive to the adjustment of the vehicle posture.
As shown in
Figure 10,
Figure 11,
Figure 12,
Figure 13,
Figure 14 and
Figure 15, parking time
shows a growing trend with the gradual decrease of
Lp. Furthermore, the
of Case 4 is the longest, and the reason is obvious. It is because of the narrow parking space resulting in six times of direction changes in Case 4, compared with only four times in Cases 1–3.
The traditional GPM takes a long time to directly solve the optimal parking problem, and even ends with nonconvergence when the parking space is narrow. Thus, this paper adopts a homotopic method to select a rational initial guess, which can solve this problem effectively. As depicted in
Figure 16, the iteration time is less than 1 s in more than 90% of the cases. And the longest calculation time does not exceed 2 s. Longer iteration times occur at the beginning and end of the calculation for two reasons: (i) In the first iteration, the constraint is set to the calculation for the first time, and the increase of the constraint condition leads to the extension of the calculation time. (ii) At the end of the iteration, the rear space is narrow, so the process of trajectory optimization becomes difficult.
4.3. Online Computing Method for Vertical Parking Trajectory Planning
The offline calculation method of vertical parking trajectory planning is illustrated above. In the process of approaching the original optimal control problem by homotopic parameters, the overall calculation time is long even if the time cost of each iteration is short. At this time, real-time requirements will not be met. Thus, an online planning method of parking trajectory is proposed. Let us assume that the trajectories calculated by each iteration in the second phase are stored as a table. If the starting position and parking space size in practice are the same as in any case stored, the trajectory can be obtained directly from the stored trajectories by looking up the tables without any calculation. However, these ideal situations barely happen in practical applications. Considering this problem, the stored trajectory is used as an initial guess rather than an actual trajectory. The complete process is as follows: First, a parking space is found, and the vehicle is parked in its initial area. In this context, an optimal control problem for parking trajectory planning is formed. Then, the most similar set of trajectories is found from the stored data based on actual parking space size and the starting position, and used as the initial guess of the actual optimal control problem, which is solved by the GPM. The advantage is that the solving speed can be effectively improved by the proposed method. This is because the corresponding original problem of the found trajectory is similar to the current problem, which makes this trajectory similar to the current solution, being a good initial guess.
To verify the above method, a working condition with
,
is assumed, and its parking trajectory, used as the initial guess of the subsequent optimal control problem, is stored in the data table. Cases 5 and 6 are set up according to the distance from the actual parking starting position to point R. In each case, there are four vehicles whose start locations
R’(
x,
y) are in the circles that take
R(
x,
y) of the initial guess as the center and 0.2 and 0.5 as radii (as shown in
Table 2). The GPM is also taken to solve the new optimal control problem for vertical parking trajectory planning.
As shown in
Figure 17a,b, the new optimal control problems in Cases 5–6 can be solved quickly, and the solving speed of Vehicle 4 is the quickest, followed by that of Vehicle 2. For Vehicles 2 and 4, the vertical positions are the same as those in the initial guess, that is,
, despite differences in the horizontal position. Therefore, their trajectories at the beginning phase of the parking are closer to the optimal ones. In contrast, the vertical positions of Vehicles 1 and 3 are different from those in the initial guess despite the same horizontal positions, which leads to a large deviation of the trajectories at the beginning phase. Therefore, the calculation time increases.
In Case 5, the maximal calculation time of all the vehicles is 1.87 s, which is acceptable in real-time parking applications. However, in Case 6, the calculation time of Vehicles 1 and 3 is more than 3 s. Comparing Case 5 and Case 6, it can be noted that the large deviation, especially horizontal deviation, of vehicle trajectory from the initial guess leads to a greater impact on calculation time. Therefore, the calculation time of the optimal control problem increases. In contrast, the deviation of the horizontal position has less effect on the calculation speed.
To verify the effectiveness and real-time performance of the proposed homotopic strategy, the calculation results of the two initialization methods are selected for comparison. The CPU time and
tf of Cases 1–4 are recorded, and fail means nonconvergence in the calculation process. As presented in
Table 3, the simulation costs of the proposed homotopic strategy are much lower than those of the other two strategies. Especially in conditions with small space (Cases 3 and 4), the calculation costs of the incremental strategy and the spatiotemporal decomposition strategy increase significantly, and the calculation may fail. We cite the following reasons to explain the excellent real-time performance of the proposed strategy: In the iterative solution process, only the width of the parking space changes according to the calculation step. Thus, optimal control problems of two adjacent calculations are very similar. In the homotopic strategy, the optimal solution of the previous calculation is used as the initial guess for each solution. And the calculation is guided by a high-quality initial guess. It is worth noting that since there is no initial guess stored when solving the problem of Case 1, the calculation time is slightly longer than that of other cases. This result is consistent with the conclusion in
Figure 16.
As a summary, the processes of the online calculation of vertical parking trajectory are as follows: (i) A matrix, whose size is , is formed with starting points selected in the initial area of vertical parking. The optimal parking trajectories of these starting points are obtained by an offline method and stored. (ii) The starting point with the minimum deviation from the actual location is obtained by looking up the table of stored data. Note that the vertical deviation minimum takes higher priority than the horizontal one. Finally, the trajectory with the minimum deviation is taken as the initial guess of the optimal control problem. This optimal control problem is solved by the GPM, and an optimal trajectory of the actual parking is obtained.