Abstract
For the autonomous parking problem of the tractor-semitrailer vehicle, a piecewise Gauss pseudospectral method is proposed as a trajectory planning scheme in this paper. Firstly, the trajectory planning problem is transformed into an optimal control problem by establishing a vehicle kinematics model for the low-velocity scene, the dynamic constraints including the physical constraints, the collision avoidance constraints, and the endpoint constraints. The optimal control problem are discretized into a nonlinear programming problem by piecewise Gauss pseudospectral method according to the movement area during parking process. The shortest time to complete parking is taken as the objective function. The Gauss pseudospectral method is further adopted to solve the nonlinear programming problem in the two parking stages. Three parallel parking conditions with different lengths of parking spaces and three vertical parking conditions with different widths of parking spaces are set for simulation verification based on Matlab/Simulink. The simulation results show that the proposed method can uniformly and effectively solve the trajectory planning problem of the tractor-semitrailer vehicle. Compared with the traditional pseudospectral method, a shorter parking time and a significantly higher convergence rate can be got with the method, which further indicates that the proposed method has good effectiveness and robustness.
Keywords
Introduction
Trucks with large cargo capacity occupy a major position in the freight transport industry. Tractor-semitrailer are more and more widely used because of their large carrying capacity and low transportation cost. Due to the large outline size of the tractor-semitrailer and the hinge joint constraint between the tractor and the semitrailer, the tractor-semitrailer has higher requirements for the driver’s experience and driving technology in the parking condition. Therefore, the development of autonomous parking systems is very important to improve driving safety and parking efficiency. An autonomous parking system mainly includes three layers: the perception layer, decision-planning layer, and execution layer. Motion planning belongs to the decision-planning level and its main role is to generate the best route for vehicles from the starting point to the destination, including path planning and trajectory planning.
Generally speaking, the current motion planning methods can be roughly divided into four categories. The first is the graph search method, which includes two steps: graph construction and path search. For an unstructured environment, literature 1 proposed a graph-based search algorithm and a discrete kinematic vehicle model to find a primitive path that is non-holonomic, collision-free, and safe. Literature 2 redesigned the Dijkstra algorithm to tackle situations in which the parameters of the networks may be uncertain by the form of special picture fuzzy numbers. Literature 3 presented Morphological Dilation Voronoi Diagram Roadmap (MVDRM) algorithm to address unsafe path computation accompanied by high time and space computation complexity problems of roadmap path planning methods in complex environments for mobile robots. The graph search method can quickly obtain the driving path and is widely used in global path planning. However, the planning results are relatively rough. The graph search method is usually used as a preprocessing for other methods.
The second kind is the random sampling method. The PRM method proposed in the literature 4 make full use of terrain and threat information, so that the UAV’s route map can not only avoid terrain and threat, but also automatically track the terrain. A modified RRT* algorithm named Quick-RRT* was proposed in the literature, 5 which can generate better initial solutions and converge to the optimal solution faster than RRT*. Further, to improve the algorithm efficiency, many kinds of literature proposed some improvement strategies, such as PBG RRT, 6 EBG-RRT, 7 RRT-Connect, 8 Extend RRT, 9 etc. Compared to graph search methods, random sampling methods are more efficient and can be found as long as the solution exists. However, the shortcomings of the random sampling method are also obvious, that is, the solutions generated each time have a certain degree of randomness and may not be the same.
The third category is the geometric line construction method. The Dubins curve in literature10,11 and the Reeds-Shepp curve in literature12–14 are typical geometric line construction methods, which can obtain the shortest path but cannot deal with complex collision avoidance constraints. Literature 15 adopted a Clothoid curve, while the literature 16 used a S-shaped curve to generate smooth and continuous paths. Simple combinations of circles and straight lines can also be used to generate paths, such as in literature.17,18 The parking paths obtained by the spline curves, cubic spline interpolation, and polynomial fitting curves used in literature19–21 are smoother and collision-free. The advantages of this method are low computational complexity and easy path tracking of the output path.
The fourth category is the one based on machine learning or numerical optimization methods. In literature,22,23 the Random Forest (RF) model and neural network algorithms was applied to learn the mapping relationship between control parameters and trajectories, and the trained model is used for parking trajectory planning. Literature 24 presented a path planning approach for robot social navigation by making use of Fully Convolutional Neural networks (FCNs) to learn from experts’ path demonstrations. The use of FCNs allowed us to overcome the problem of manually designing/identifying the cost-map and relevant features for the task of robot navigation. Literature 25 realized path planning of mobile robot based on Q-learning algorithm of Markov decision process. Machine learning methods have fast computational speed, but are highly dependent on sample size and quality. In terms of numerical optimization methods, a search-resampling-optimization (SRO) framework is proposed in literature. 26 A hybrid A* algorithm is employed to generate a coarse path and a resampling process is implemented to pave a series of safe dispatch corridors (SDCs) along the coarse path. The resampled result is further fed into the optimization stage to facilitate the numerical solution. Literature 27 proposed a two-stage hierarchical method for trajectory planning of unmanned surface vehicle. This method included coarse path generation based on hybrid A* and trajectory solving based on numerical optimization. Literature 28 proposed an efficient hierarchical initialization technique based on the Dubins curve method when using numerical optimization methods for trajectory solving, which effectively improves convergence efficiency. In literature, 29 a homogenization layer was proposed to reduce the dimension and nonlinearity of the formulated optimal control problem in the planning layer and consequently improves the robustness and efficiency of the solution process. Literature 30 adopted Reeds-Shepp curve to provide initial guesses for trajectory planning of the entire system in the second layer. The above literatures used different initialization techniques to accelerate the convergence rate of trajectory solving process, which provides a high academic reference value. Literature 31 proposed a Successive Linearization in Feasible Set (SLiFS) algorithm to address the nonconvex collision avoidance constraints and the nonlinear vehicle dynamic constraints. For the trajectory planning of heavy mining trucks near the loading/dumping site of open-pit mines, literature 32 established a coarse to fine framework. Under the rough planning by an enhanced hybrid a* search algorithm, a small-scale nonlinear programming was used to obtain the optimal trajectory. Literature 33 proposed a parallel stitching strategy to solve the replanning problem caused by dynamic obstacles during the parking process and the proposed replanner also supported switching to a better homotopy class online. In literature, 34 a method of reconstructing corridors in an iterative framework is proposed to quickly solve the lightweight optimal control problem with only box constraints. An iterative computation framework is proposed to accumulatively handle the collision avoidance constraint and nonconvex kinematics constraint in curve trajectory planning task in literature. 35 In literature, 36 an optimization-based trajectory planning method is proposed to solve the motion planning problem of tractor-trailer vehicle in a curvy and tiny tunnel. This method has significant advantages over popular sampling and search-based algorithms in solving high spatial dimensions or harsh constraint conditions. In the literature,37,38 Li et al., divided the parallel parking process of a single car into two stages. Interior-point method is used to solve the trajectory planning problem of parallel parking in each stage. Piecewise solution can effectively improve the success rate of solving single car parking trajectory. The numerical optimization method can directly and accurately describe the vehicle motion planning problem, and the solution process can be combined with the various intelligent optimization algorithms. Therefore, it has been favored by academic circles at home and abroad in recent years and it is also a research hotspot. However, in the numerical optimization method, as the number of state/control variables and constraints increases, the solution maybe unsuccessful or convergence rate is slow. This is also one of the focuses of research.
The above studies have made a positive contribution to the solution of the motion planning problem of unmanned vehicles. As a numerical optimization method, Gauss pseudospectral Method (GPM) has many advantages, such as a fast convergence rate and low sensitivity to the initial value, which make this method much more suitable for autonomous parking trajectory planning. However, due to extremely narrow parking environments relative to the larger body size of the tractor-semitrailer vehicle, more contour vertex than that of the ordinary vehicle, and complex constraints, the traditional GPM often has the phenomenon of non-convergence or slow convergence rate in the solution of parking trajectory.
In this paper, a trajectory planning method based on piecewise GPM is proposed to solve the problem of autonomous parking of the tractor-semitrailer vehicle. In order to improve the convergence success rate and efficiency of the algorithm when solving the trajectory, the parallel parking and vertical parking of the tractor-semitrailer vehicle are divided into two stages according to the parking area. The piecewise algorithm can automatically filter a suitable intermediate configuration as the connection point of the two stages. Reasonable constraints are set at the end of the first stage and the beginning of the second stage to ensure that the state variables and control variables of the two stages remain numerically continuous. Taking the shortest parking time as the optimization goal at each stage, the vehicle kinematics model, dynamic constraints, collision avoidance constraints, and endpoint constraints of two stages are established, and the autonomous parking trajectory planning problem is further described as the optimal control problem. By linearizing and discretizing the optimization problem, the above optimal control problem is transformed into a nonlinear programming problem within the framework of GPM. The optimal trajectory can be obtained by using piecewise GPM to solve the nonlinear programming problem. The simulation results of trajectory planning under vertical and parallel parking conditions indicate that this method can obtain an effective parking trajectory for the tractor-semitrailer vehicle, and the convergence success rate and efficiency are significantly improved.
Mathematical model of parking motion planning
Simplified kinematics model of the tractor-semitrailer vehicle
The outline of the tractor-semitrailer is simplified, and the tractor and semitrailer are equivalent to rectangular rigid bodies that can be rotated. The hinged joint is located at the center of the rear axle of the tractor. Under the condition of autonomous parking on a flat road, the dynamic characteristics such as sideslip caused by tire lateral force can be ignored due to the low driving velocity. The established tractor-semitrailer autonomous parking kinematics model is shown in Figure 1.

Kinematics model of the tractor-semitrailer vehicle.
The golden rectangular block represents the tractor, the front axle is the steering axle, and the rear axle adopts the form of a double-axle arrangement. The pink rectangular block represents the semitrailer, the rear axle adopts the form of a triple-axle arrangement.
Where (x, y) refers to the mid-point of the rear-wheel axis of the tractor (see point
As a result,
The coordinate values of the tractor contour vertexes ABCD can be calculated by the center point
The relationship between the rear-axle center points
Similar to the tractor, the coordinate values of the semitrailer contour vertexes EFGH can be obtained from the coordinate value of the center point
Constraint conditions
Physical constraints
The tractor will be constrained by its own kinematic and dynamic characteristics during the parking process. Consequently, inequality constraints are defined for some state variables and control variables of the tractor-semitrailer vehicle as follows:
Where
Collision avoidance constraints
The process of autonomous parking is actually the process in which the vehicle avoids collision near the parking space and finally enters the target parking space. In the whole parking time domain [

Taking the following situation as an example: the tractor contour vertex A and the semitrailer contour vertex G do not collide with the obstacle parking space
Where
Where,
In addition to meeting the above collision avoidance constraints, the vehicle should always be within the road during the entire parking process and cannot exceed the road boundary.
Endpoint constraints
Based on the above kinematic model and constraint conditions, the tractor-semitrailer vehicle can complete collision-free parking from the start time
Where

Schematic diagram of the autonomous parking area: (a) vertical parking and (b) parallel parking.
Optimal trajectory solution of autonomous parking based on piecewise GPM
Description of autonomous parking problem of the tractor-semitrailer vehicle
Without losing generality, the Bolza problem of nonlinear optimal control includes the following aspects:
The differential equation of system dynamics is:
The path constraints are:
Boundary constraints are:
The objective function is:
Where:
Autonomous parking technology is to help drivers improve parking efficiency, reduce road occupation time, and avoid traffic congestion on the premise of absolute safety. Hence, the shortest autonomous parking time is set as the objective function of the optimal control problem in this paper, that is,
Piecewise GPM for solution
GPM can transform the above optimal control problem into a nonlinear programming problem through variable discretization, and then solve it by numerical optimization method. The advantages of GPM such as being insensitive to initial values, high accuracy, and fast convergence make it very suitable for the solution of trajectory planning. However, due to extremely narrow parking environments relative to the larger body size of the tractor-semitrailer vehicle, more contour vertex than that of an ordinary vehicle, and complex constraints, the traditional GPM often has the phenomenon of non-convergence or slow convergence rate in the solution of parking trajectory. Piecewise GPM is proposed to solve the above-mentioned problems. The algorithm is derived as follows:
Time-domain transformation
The time-domain of the optimal control problem of trajectory planning is
Since the interval of discrete points selected in the GPM is
After transformation, the Bolza problem of each subinterval is transformed into a standard objective function problem, which is described as follows:
Where
Discretization of variables
The control variables and state variables in GPM need to be discretized at the position of the configuration points. Then the Lagrange interpolation function is constructed based on the configuration points to approximate the original function. In the interval
After discretization, the state variables can form
The basic function of the Lagrange polynomial in equation (23) is:
However, the control variables can be approximated by
Constraints and objective function transformation
GPM can convert differential equation constraints into algebraic constraints. The derivative of the state variable at
Combined with equations (22) and (28), the algebraic constraints of the kinematic equation can be obtained as follows:
The path constraints and boundary constraints after discretization in each time domain are expressed as:
In addition, the objective function can be approximately transformed into the following equation by Gauss integration:
Where
The piecewise GPM in autonomous parking of the tractor-semitrailer vehicle
Compared with the single vehicle parking, the parking process of the tractor-semitrailer has the following characteristics: the addition of semitrailer leads to a longer overall vehicle body, the more contours, and the more calculation of the trajectory solution. The kinematic constraint between the tractor and semitrailer, and the collision avoidance constraints of the semitrailer make the constraints more complicated. The traditional Gauss pseudospectral method for solving the parking trajectory may not converge or converge slowly. Li et al.,36,37 divided the automatic parking process of a single vehicle into two stages for extremely small parking space conditions, and used the interior point method to solve the optimal trajectory in each stage. The simulation results show that the method can effectively improve the success rate and efficiency of the solution. Referring to the division of single car parking area in different stages in the literature,36,37 this paper divides the autonomous parking process of a tractor-semitrailer into two stages according to the parking area. At each stage, the pseudo spectral method is used to solve the optimal collision-free trajectory with the goal of minimizing the parking time. Corresponding endpoint constraints need to be added at the boundary between the two stages to maintain continuity in the values of vehicle state variables and control variables. The advantage of the segmented solution is that the one-time solution of the original complex whole parking trajectory can be divided into two stages of relatively simple parking trajectory solution. The reason is that the collision avoidance constraint and the endpoint constraint are simplified in the process of piecewise solution, so as to improve the success rate and convergence efficiency of the trajectory solution of the autonomous parking of the tractor-semitrailer.
The first stage is the movement of the vehicle from the initial position to the vicinity of the parking space, while the vehicle position and heading angle will be adjusted to facilitate further entry into the parking space. During this phase, the vehicle runs longitudinally without boundary constraints, so the driving area of the vehicle corresponding to this stage is called the free motion region. At the end of this stage, part of the semitrailer body may has entered the parking space. The second stage is that the vehicle moves until the vehicle body is fully into the parking space and the heading angle reaches the target attitude. At this stage, the vehicle has a range limit in the longitudinal direction and strictly meets the collision avoidance constraints during the movement. Therefore, the vehicle needs to continuously adjust its position and attitude to meet the final goal, and the corresponding allowable driving area is called the adjustment region. Two parking phases correspond to two parking areas, as shown in Figure 4.

Schematic diagram of autonomous parking area division.
The state variables at the junction of the two stages shall be further constrained to ensure its continuity. At the same time, the position of the contour vertices of the tractor and semitrailer also shall be constrained according to the parking area. The constraint equations are as follows:
The pseudo-code of the piecewise GPM to solve the autonomous parking of the tractor-semitrailer vehicle is shown in the Table 1 below:
The pseudo-code of the piecewise GPM.
Simulation and validation
According to the autonomous parking kinematics model of the tractor-semitrailer vehicle, the trajectory solving program based on piecewise GPM was written on the Matlab platform. Taking an actual tractor-semitrailer vehicle as the simulation object, the tractor-semitrailer vehicle parameters and physical constraints are shown in Table 2.
Vehicle parameters and physical constraints.
The simulation of the vertical parking condition
Three vertical parking spaces with different widths are designed to verify the robustness and universal applicability of the piecewise GPM. The width of parking space is 3.14, 3.90, and 4.68 m, respectively, that is, 1.2, 1.5, and 1.8 times the vehicle width. The length of the parking space under three working conditions is 16 m. The rear-axle center point of the tractor is regarded as the observation point of the parking process and the initial state is set to

Planning results of longitudinal and lateral displacement for autonomous vertical parking in three parking spaces:

Planning results of state parameters and control parameters for autonomous vertical parking in three parking spaces: (a) Lp = 4.68m, (b) Lp = 3.90m, and (c) Lp = 3.14m.
As can be seen from Figure 5 and the partially enlarged figure, in the case of three parking spaces, there is no collision between the vehicle and the road boundary, or between the vehicle and the obstacles during the parking process. There is no in situ steering under the three parking conditions. The heading angle of the vehicle at the beginning and completion time of parking meets the constraints. When the width of the parking space is 1.8 times that of the vehicle, the vehicle can complete the parking process with one reverse, as the curve of the rear-axle center is shown in Figure 5(a). In the parking space, the vehicle makes a small adjustment in the left and right directions, so that the termination position is in the center of the parking space, and the total time is 19.59 s. When the width of the parking space is reduced to 3.90 m, the vehicle completes parking by adjusting the body posture before entering the parking space through a forward-backward maneuver. The sign of velocity in Figure 6(b) changes once, which is consistent with the maneuver, and the total time is 26.62 s. When the width of the parking space is only 3.14 m, the vehicle completes parking after fine-tuning the body attitude through 13 times of forward-backward maneuvers, and the total time is 139.93 s. With the gradual reduction of the width of the parking space, the vehicle completes the attitude adjustment by increasing the number of forward-backward maneuvers, and finally parks into the parking space, which is consistent with the actual situation of manned driving. However, the parking time increases accordingly. It can be seen in Figure 6 that the planning results of state parameters and control parameters are strictly limited in the constraint range of Table 2, which indicates that GPM strictly implements the constraints in the solution process.
The simulation of the parallel parking condition
Similar to the vertical condition, the length of parking spaces is set to 1.2 times, 1.5 times, and 1.8 times the total length of the tractor-semitrailer vehicle respectively in parallel parking conditions, that is, 25.58, 21.32, and 17.10 m. The width of the parking space is 3.5 m, and the road width is also 3.5 m according to relevant legal standards. The initial position is set to

Planning results of longitudinal and lateral displacement for autonomous parallel parking in three parking spaces:

Planning results of state parameters and control parameters for autonomous parallel parking in three parking spaces: (a) Lp = 25.58m, (b) Lp = 21.32m, and (c) Lp = 17.10m.
The completion time of parking under the three parallel conditions is 24.31, 37.17, and 148.87 s. When the length of the parking space is large and medium, the vehicle stops in the center of the parking space through a forward-backward maneuver. As can be seen from Figure 7(a) and (b), the signs of speed have changed once, as shown in Figure 8(a) and (b). However, when the length of parking spaces becomes extremely small, the vehicle also adjusts its posture through a large number of forward-backward maneuvers for collision-free and finally stops in the center of the parking space. With the decrease in parking space length, the number of forward-backward maneuvers and parking time increase.
The vertexes of the vehicle contour in the planning result diagram seem to be in contact with the edge of the parking space or the road boundary, but in fact, the vehicle and the obstacle have been expanded, so there is enough distance between them to ensure no collision, and the value of the safety distance can be adjusted by the expansion coefficient
The GPM method can be successfully and effectively applied to the trajectory solution of autonomous parking of tractor-semitrailer vehicle. Meanwhile, the advantages of the piecewise GPM method in the convergence success rate, CPU calculation time, and optimal goal can be demonstrated through comparative analysis. The comparison results of the two methods are shown in Figures 9 and 10. When the parking space is large or medium, both methods can converge. The difference is that the piecewise GPM can obtain a shorter parking completion time. However, when the length or width of the parking space is extremely small, the traditional GPM fails to converge, and the piecewise GPM can still converge. Piecewise GPM is superior in terms of calculation time. With the increase in parking space width, the vertical parking time of piecewise GPM is 51.36% and 41.13% of the traditional GPM. With the increase in parking space length, the parallel parking time of piecewise GPM is 48.40% and 39.27% of the traditional GPM. This is mainly because the number of constraints in the divided parking area is reduced by the piecewise GPM to improve the convergence rate.

Comparison of

Comparison of
A numerical animation demonstration video of the planned trajectory can be obtained at the following website:
Conclusions
In this paper, an autonomous parking trajectory planning method using piecewise GPM in different parking areas for the tractor-semitrailer vehicle is proposed. By establishing the tractor-semitrailer vehicle kinematics model, physical constraints, endpoint constraints, and obstacle avoidance, the parking trajectory planning problem are transformed into an optimal control problem. Taking the shortest parking completion time as the optimal objective function, the reasonable initial value of the problem is obtained by the solution without constraints. The constraints are reset according to different parking areas, and the final trajectory is obtained by a faster convergence rate.
The vertical parking conditions of three parking spaces with different widths and the parallel parking conditions of three parking spaces with different lengths are selected for trajectory planning simulation. The results show that the obtained trajectory meets the constraints in the process of autonomous parking. Compared with the traditional GPM, the proposed method has a faster convergence speed.
Footnotes
Acknowledgements
Thanks very much to Professor Li Bai’s research team of Hunan University. The research achievements, literature37–39 provide great inspiration for the study of our research and the literature26–31 have very high academic guidance significance for our subsequent research.
Handling Editor: Chenhui Liang
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was funded by the Anhui Provincial Development and Reform Commission 2020 New Energy Vehicle Industry Innovation Development Project “Key System Research and Vehicle Development for Mass Production Oriented Highly Autonomous Driving” (No.wfgcyh2020477), two Key Projects of University Natural Science Foundation of Anhui Province, China (No.KJ2019A0959 and No.KJ2020A1065), and was also funded by 2020 Talent Research Fund Project of Hefei University (No.20RC08) and Scientific Research Development Fund Project of Hefei University (No.20ZR02ZDB).
