1. Introduction
Unmanned systems are becoming increasingly prevalent in various applications, such as intelligent transportation and emergency search and rescue. Trajectory planning, a core module in unmanned systems, involves generating collision-free, smooth, and optimal (e.g., shortest or energy-efficient) trajectories for controlled objects. While trajectory planning has been extensively studied for various platforms like drones and autonomous vehicles, navigating narrow spaces remains a challenging task. The limited connectivity between feasible states in such environments often leads to reduced planning efficiency and increased risk of collisions. Typical examples include parallel parking for autonomous vehicles [
1] and agile flight through narrow gaps for drones [
2].
Parallel parking poses significant challenges due to narrow terminal constraints. Drivers often need to carefully maneuver their vehicles within limited space to complete the pull-in or pull-out process, increasing the risk of accidents. Autonomous driving technology offers a solution to alleviate the stress of parking and potentially reduce accidents and traffic congestion related to parking.
To effectively improve the computational efficiency and planning success rate of the joint spatial–temporal trajectory planning method in narrow parallel parking scenarios, this work analyzes the dual-stage characteristics of the parking process and designs a novel trajectory planning method. The main contributions are outlined as follows: (1) A trajectory generation method called dual-stage motion pattern tree (DS-MPT) is proposed, which significantly improves the computational efficiency and robustness of initial trajectory generation in narrow scenes. (2) A trajectory optimization method is proposed based on an enhanced driving corridor generation strategy, which reduces the time consumption required to construct driving corridors and improves the success rate of trajectory optimization.
The remaining chapters are structured as follows:
Section 2 reviews the literature on trajectory planning methods applied to narrow spaces, especially parking scenarios.
Section 3 examines the parallel parking trajectory planning problem from a dual-stage perspective and provides a brief explanation of the framework proposed in this article.
Section 4 introduces the proposed DS-MPT method.
Section 5 illustrates the modeling of the trajectory optimization problem.
Section 6 discusses the experimental results.
Section 7 offers a summary and prospects for future studies.
2. Related Works
The core task of trajectory planning is to calculate a sequence of geometric poses, along with their corresponding temporal profiles. Current methods can be divided into two categories: spatial–temporal coupling and spatial–temporal decoupling. In the former approach, trajectory planning is modeled as two sequential optimization problems: path generation and speed planning, as in [
3]. Path generation methods are categorized into curve-based, sampling–searching-based, and machine learning-based approaches. Curve-based generation methods offer rapid generation and customizable path shapes through a parametric configuration. Arc curves and straight lines, widely used in the generation of parking paths [
3], often encounter issues of discontinuity in curvature. Therefore, smoother curve forms such as polynomial curves [
4], clothoid-like curves [
5,
6,
7,
8], and spline curves [
3,
9,
10] are used to improve trajectory tracking accuracy in parking planning. Typically, sampling-searching-based methods formulate path generation as a tree-search problem. Common methods include A*-based [
11,
12,
13,
14] and rapid-exploring random tree (RRT)-based [
10,
15,
16,
17] methods. Sampling–searching-based methods have the characteristics of high flexibility and strong generalizability. Therefore, they are frequently used to provide initial estimates for optimization-based methods. Learning-based methods learn mapping functions to match the corresponding paths in a path library with different parking tasks [
18,
19] or predict a path based on a parking scenario description [
17]. Learning-based methods possess extensive parameters and a higher theoretical potential for algorithmic performance [
20]. However, the actual generalizability of these methods remains unconfirmed due to the complexity of real-world parking scenarios. Once the initial path is established, speed planning is required to derive a trajectory with temporal data. Speed planning is typically modeled as an optimization problem [
21,
22,
23,
24]. Current speed planning research is mainly oriented towards structured road scenarios, with less emphasis on the parking process.
The spatial–temporal decoupling approach simplifies the original problem, making it easier to solve. However, since the trajectory essentially represents a manifold in three-dimensional space, the solution derived from decoupling might only achieve local optimality. In contrast to related works in on-road scenarios [
25,
26], which typically considers dynamic interactions between agents, existing parking trajectory planning methods often simplify the problem by assuming a static environment. However, the vehicle’s non-holonomic kinematics constraints imply that decoupling overlooks the integral relationship between path and speed. Therefore, employing a decoupling strategy may result in trajectories that fail to meet the vehicle’s kinematic constraints. In narrow parking scenarios, such trajectories can lead to tracking challenges and potential parking failures.
Therefore, many scholars have studied methods for joint spatial–temporal trajectory planning. Such methods typically model trajectory planning as an optimal control problem (OCP) and use optimization methods for solutions. Li et al. [
27] proposed a lightweight iterative framework that contains a comprehensive initial trajectory generation method and simplifies the complexity of obstacle constraints by constructing corridors. Addressing the non-convexity problem of obstacle constraints, Liu et al. proposed the convex feasible set (CFS) algorithm [
28] that transforms a problem with non-convex constraints into a sequence of convex optimization problems. Guo et al. [
29] proposed a lightweight initialization strategy based on CFS, facilitating faster optimal trajectory identification by gradient-based solvers. In constructing obstacle constraints, Zhang et al. [
30] proposed the optimization-based collision avoidance (OBCA) method, offering precise expression of obstacle constraints based on hyperplane segmentation. This approach avoids the approximation errors caused by constructing safe corridors, which improves the accuracy of obstacle constraint expressions. Generally, an OCP is discretized and converted into Non-Linear Programming (NLP) for solution [
31,
32]. While the discretized model brings solution convenience, it can result in potential collision violations between adjacent trajectory points. To address this issue, Zhang et al. [
33] used a visual protection frame and a magnification parameter in optimization modeling, ensuring the effectiveness of discretized obstacle constraints on continuous trajectories. Li et al. [
34] proposed an embedded-footprint theoretical model, where the embedded footprint of finite collocation points guarantees collision-free intervals between adjacent collocation points. Learning-based methods [
35,
36,
37,
38,
39,
40,
41] have also been applied to spatial–temporal coupled trajectory planning problems.
The weak connectivity of narrow spaces presents challenges for trajectory planning tasks. In recent years, much literature has focused on the issue of parking trajectory planning in narrow scenarios [
42,
43,
44]. Generally, optimization-based methods are considered more suitable for trajectory planning in narrow spaces. These methods can directly apply explicit constraints on obstacle avoidance and vehicle dynamics, providing strong interpretability and stability. However, the obstacle avoidance constraints often result in a non-convex constraint for the optimization problem, making the solution highly dependent on the quality of the initial guess. Obtaining a high-quality initial solution in narrow spaces is not an easy task and can be even more challenging than solving the optimization problem itself. For instance, common sampling–searching-based warm-up methods exhibit polynomial increases in computational complexity as the space scale grows. In narrow scenarios, only a sufficiently high spatial discretization resolution can ensure a successful solution, leading to high initial trajectory computation times. Moreover, poorly designed heuristic functions can incur additional computational costs. In existing research, the multi-stage characteristics of the parking process have received some attention [
5,
6,
18,
35,
45]. Current findings indicate that parallel parking involves two stages: merging into the parking space and adjusting posture near it. Yang et al. [
6] identified scenarios that require repeated posture adjustments based on the width of the parking space. Vorobieva et al. [
5] divided parallel parking into three different maneuver categories and specified path planning strategies. Liu et al. [
18] divided trajectory planning into two sub-processes, employing different resolutions for trajectory sampling. Li et al. [
45] used this objective knowledge to simplify the obstacle constraints in the posture adjustment stage. Tang et al. [
35] introduced a segmented parking training framework, decomposing the parking process into posture adjustment and parking tasks. This approach enhanced the algorithm’s ability to navigate crowded and confined spaces effectively. However, current approaches often neglect the potential presence of unstructured obstacles in the environment, limiting the applicability of multi-stage strategies in more complex scenarios.
3. Problem Formulation
In this section, we begin by analyzing the dual-stage nature of trajectory planning under narrow terminal constraints. We then present the proposed computational framework.
3.1. Analysis of Merging Stage and Posture Adjustment Stage
The parallel parking process of human drivers can be divided into two stages: merging and posture adjustment, as shown in
Figure 1. Taking the pull-in process as an example, during the merging stage, vehicles primarily maneuver outside the parking spot, and the main task is to move the vehicle near the parking spot. During the posture adjustment stage, the drivable space near and inside the parking spot is primarily utilized, with the main objective of parking the vehicle in the desired posture. During this process, the vehicle needs to make precise adjustments in the limited space. The same principle applies to the pull-out process. Drawing inspiration from the dual-stage characteristics, we contemplated the factors that hinder the efficiency and success rate of trajectory planning methods in tight parking spaces, as summarized in the following three points.
Firstly, we define a candidate node (
) and the target node (
). Current sampling–searching-based trajectory generation methods usually employ the Minkowski distance, as indicated in (1), as the heuristic information.
When
,
is also referred to as Euclidean distance. When
,
is also known as Manhattan distance. In the merging stage, this heuristic design can offer valuable guidance. However, during the posture adjustment stage, the expansion of the trajectory tree does not always prioritize proximity to the target node. Potentially optimal nodes may deviate from or move away from the target node because they provide a larger space for maneuvering. Using the distance from the target pose as heuristic information cannot accurately capture this process, leading to reduced efficiency in trajectory tree expansion during the posture adjustment stage. As shown in
Figure 2, the candidate states in (a) and (b) are generated by moving straight backward or executing a right turn behind. If the heuristic function calculates the Euclidean distance between the target state and the candidate state, then (a) is considered superior. However, during the posture adjustment stage, the candidate state in (b) can lead to faster convergence of the trajectory tree.
Secondly, in terms of speed profile planning, there are distinctions between the merging stage and the posture adjustment stage. The speed planning during the merging stage resembles that of on-road scenarios, primarily focusing on longitudinal kinematics. The maximum operating speed is a crucial component of the objective function to ensure efficient completion of the maneuver. During the posture adjustment stage, the trajectory comprises frequent forward and backward movement switches. We define as a single traveling-direction trajectory segment in the posture adjustment phase. Its length is , and the front wheel-angle change that needs to be completed is , where refers to the distance from to and refers to the difference from to . Under the premise of satisfying vehicle kinematic constraints, the time required to complete may be longer than the time required to complete .
To the best of our knowledge, in current research, velocity planning primarily considers longitudinal kinematics and curvature constraints. However, the aforementioned issues have not been adequately considered.
Thirdly, during the trajectory optimization stage, modeling obstacle constraints in terms of driving corridors offers several advantages. On one hand, the driving corridor effectively separates the feasible space from obstacles, and the scale of obstacle constraints remains independent of the number of obstacles in the environment. As a result, the number of obstacle constraints is only related to the number of optimization variables, which improves the stability of the solution time. On the other hand, expressing obstacle constraints as box constraints within the driving corridor reduces the nonlinearity of the constraints. However, it is important to note that constructing driving corridors requires additional time. Typically, to ensure the integrity of obstacle constraints, a driving corridor needs to be created for each trajectory point. In narrow parking scenarios, many trajectory points are in close proximity to each other in space, particularly during the posture adjustment stage. Calculating drivable corridors individually for each trajectory point would result in unnecessary computational overhead.
We incorporated the above considerations into the design of our method. Firstly, we design the DS-MPT method, in which different heuristic functions are designed for the merging stage and posture adjustment stage. Secondly, a trajectory resampling strategy is designed that considers the time required for steering angle changes.. Thirdly, an improved driving corridor generation method is designed to improve computing efficiency. The overall computing framework is described as follows.
3.2. Framework
The goal of trajectory planning is to find a state variable sequence
and control variable sequence
between the starting state and target state without collision with obstacles. These state and control variable sequences must adhere to the vehicle’s kinematic constraints. Here,
denotes the midpoint along the rear-wheel axis,
denotes the heading angle with respect to the
x axis,
v represents the velocity of
,
a refers to the acceleration,
represents the steering angle of the front wheels,
refers to the corresponding angular velocity, and
represents the time sequence corresponding to each trajectory point. The total number of trajectory points is denoted by
n. Some geometric and kinematic parameters of the vehicle are illustrated in
Figure 3, in which
L denotes the vehicle length,
denotes the length of the front overhang,
denotes the length of the rear overhang,
denotes the length of the wheelbase, and
W denotes the vehicle width.
The framework of the trajectory planning method proposed in this article is shown in
Figure 4, which includes two modules: trajectory generation and trajectory optimization. The trajectory generation module uses the DS-MPT method to calculate the trajectory, including full state variables with a fixed time resolution. Subsequently, the trajectory resampling module fine-tunes the trajectory in the time dimension, leaving enough time for forward and backward movement switching and steering-angle transformation. At the same time, the initial value of the control variable
is calculated through time differentiation. Finally, we design a trajectory optimization module with an improved driving corridor generation method. The trajectory generation method is described in
Section 4, and the details of the trajectory optimization method are described in
Section 5.
4. Dual-Stage Motion Pattern Tree
In this paper, we propose a joint spatial–temporal trajectory generation method called dual-stage motion pattern tree (DS-MPT). In DS-MPT, the trajectory generation problem is modeled as a multi-step motion pattern decision problem. A discrete state variable set () and action variable set () are used to represent the trajectory of the vehicle from the initial state to the target state. represents the pose of the vehicle at the end of each decision-making step. represents the action performed during and , which is set to six fixed motion patterns.
In the solution process, the first step is to standardize the problem by primarily converting the coordinates of the map elements and aligning the target state with the coordinate origin [0, 0, 0], thereby improving data stability. Secondly, irrespective of the pull-in or pull-out process, DS-MPT leverages the end posture within the parking lot as the initial state. This choice offers several advantages. Firstly, it facilitates the definition of the transition from the posture adjustment stage to the merging stage. Additionally, the collision probability of the Reeds–Shepp curve in the merging stage is lower, which is beneficial to improve the solution efficiency. However, in the case of the pull-in process, this approach leads to a reversed trajectory. Nevertheless, we can rectify this by reversing the order of trajectory nodes and adjusting the direction of to obtain the correct trajectory.
The complete algorithm flow is illustrated in Algorithm 1. The algorithm consists of two stages: lines 1–10 for the posture adjustment stage and lines 11–21 for the merging stage. The trajectory expansion in each stage includes three main functions: optimal node selection (lines 3 and 14), motion pattern pruning (lines 4 and 15), and trajectory tree extension (lines 6 and 17).
Algorithm 1: Dual-Stage Motion Pattern Tree |
![Electronics 13 05041 i001]() |
4.1. Trajectory Tree Extension via Motion Pattern
We define
as the set of motion patterns that the vehicle may choose at each step (
), representing moving straight forward, moving straight backward, left turning forward, right turning forward, left turning backward, and right turning backward, respectively. Each movement pattern (
) is given a unique speed (
) and front-wheel angle value (
). The state transition function (
) for the trajectory generation problem is shown in (2). In order to prioritize solution efficiency, the constraints of acceleration (
a) and angular velocity (
) are disregarded in this process.
In each decision-making step, the execution time of each
can be calculated by
. Where
is a preset hyperparameter that specifies the maximum expansion time of the motion pattern and
refers to the minimum time required to collide with an obstacle when expanding under
. It is important to note that this method does not add a node to the trajectory tree after each forward simulation step via
. Instead, it only adds the final expanded node within each motion pattern via
, as shown in
Figure 5. When a node is selected as an expansion node, the intermediate nodes are re-introduced into the trajectory to enhance its time resolution. Unlike the interpolation encrypted method, the intermediate nodes undergo collision detection, providing a stronger safety guarantee. In this article,
is set to 1 s, and
is set to 0.05 s.
Another important consideration during the expansion process is determining the criteria for exiting the posture adjustment stage. This article provides a determination formula based on the difference between the heading angle of the extended node (
) and the heading angle of the terminal state in the parking space (
):
where
is a predefined hyperparameter that refers to the angle threshold used to switch the planning stage. The trajectory tree is expanded with the terminal state in the parking space as the initial node, so
in initial. In the posture adjustment stage, we select the node whose heading angle is biased towards the direction of the
-normal vector as the expansion node. As a result, the difference between
and
gradually increases until it surpasses the specified threshold (
). At that point, the extension process is considered to have completed the posture adjustment stage and transitioned into the merging stage. In this article,
is set to
.
The selection range for expansion nodes in each round does not include the entire trajectory tree but only the children nodes expanded in the previous round. Additionally, the relationship between children and parent nodes is determined strictly based on the expansion steps.
4.2. Node Evaluation
This paper introduces two heuristic cost functions for evaluating motion patterns in the merging stage and posture adjustment stage. In the merging stage, the heuristic calculates the non-holonomic kinematic distance to the end state, which is approximated using the length of the RS curve [
46]. In the posture adjustment stage, the heuristic is determined by the angle between the current vehicle heading and the normal vector of the target-state heading.
where
represents the Reeds–Shepp curve between
and
,
represents the length of the curve,
represents the unit direction vector corresponding to
, and
represents the normal vector of
I.
4.3. Tree Pruning Strategy
As shown in
Figure 6, this paper prunes the trajectory tree by removing invalid motion patterns. Three situations are considered. Firstly, when
is extended from
and
, the optimal motion pattern in
is extended until it collides with an obstacle. If
continues to expand in motion mode
, it will be invalid. Secondly, the motion patterns in
M are opposite movements to each other,
and
are opposite movements to each other, and
and
are opposite movements to each other, as are
and
. Let
represent a pair of reverse motion patterns. If state
is expanded from
via
, then
has a greater probability returning to
if it continues to expand via
. The trajectory tree pruning strategy is expressed by the following formula:
Thirdly, during motion pattern tree expansion in the merging stage, each step expansion attempts to establish a connection with the end node using the RS curve. If the connected curve does not result in a collision, the initial trajectory is considered successfully generated.
4.4. Collision Detection
The geometric space is denoted as
, the obstacle space as
, and the available geometric space as
. In the trajectory generation process, obstacles are expressed in the form of a grid map, and the obstacle constraints are expressed as follows:
where
represents the grid occupied by the vehicle envelope at time
.
In the parallel parking task, the vehicle envelope’s corner points are prone to collisions. Using an approximate representation that ignores the corner points (e.g., inscribed circles) reduces computational complexity but simultaneously compromises the quality of the solution. Considering calculation efficiency and detection accuracy, this paper combines two envelope forms, namely disk approximations and an oriented bounding box (OBB), to simplify the representation of the vehicle shape. we sampled the four corner points of the OBB and the three disk center points. As shown in
Figure 7,
A,
B,
C, and
D perform collision detection in the original obstacle grid map, and
E,
F, and
G perform collision detection in the dilated grid map.
represents the radius of the inscribed circles. The coordinate calculation formula for each detection points is expressed as follows:
The above text presents the core content of the DS-MPT algorithm. Once the trajectory tree is constructed for each stage, the initial trajectory can be obtained through backtracking, and the final trajectory can be obtained by concatenating the trajectories from both stages.
4.5. Trajectory Resample
The trajectory computed by DS-MPT incorporates state quantities ( and ). However, due to the omission of acceleration and angular velocity constraints, abrupt changes occur in both and . To mitigate this issue, we employ a trajectory resampling strategy. The central approach of resampling is re-planning of the velocity profile. We formulate the issue as a quadratic programming (QP) problem.
The initial trajectory is divided into several segments according to the gear switching. Each segment of the initial trajectory is represented by the following multi-segment n-order polynomial:
In the formula,
m is the number of segments of the trajectory curve, and
is the parameter vector of the
n-th polynomial curve. Then, the velocity (
), acceleration (
), and jerk (
) of the trajectory point can be expressed as follows:
and
are given by the initial trajectory. Since the vehicle switches gears at the end of the trajectory segment,
and
are set to zero. The continuity of
,
,
, and
constitutes equality constraints. At the same time,
and
must meet the vehicle motion restrictions in (22). Based on the above analysis, this paper models speed planning as a QP problem:
where
,
,
,
,
is the parameter of the equality and inequality constraints proposed above.
In solving the aforementioned problem, it is necessary to provide the predetermined execution time (
T) for each trajectory segment. As described in
Section 3, in the posture adjustment stage, the trajectory segments are typically short in distance, and adjusting the steering wheel angle can be more time-consuming than longitudinal travel. Therefore, we use the following function to schedule execution time:
where
represents the time required for longitudinal movement and
represents the time required to complete front-wheel angle adjustment.
represents the total steering-angle change during the trajectory segment.
and
are relaxation factors.
7. Discussion
This paper investigated the problem of trajectory planning under narrow terminal constrains. A novel trajectory generation approach called DS-MPT was structured to plan parking maneuvers with higher computational efficiency and robustness. Subsequently, a trajectory optimization method was introduced, along with an enhanced driving corridor generation strategy.
Based on the experimental simulation results, we found that trajectory planning under narrow terminal constrains has dual-stage characteristics. The heuristic functions designed for the two stages better guide the expansion of the trajectory tree, thereby improving the calculation efficiency. At the same time, the speed re-planning method and the driving corridor generation strategy based on the dual-stage characteristics further improve the trajectory quality, reduce the time consumption of optimization, and improve the success rate of trajectory optimization.
In future work, we will explore strategies to enhance the algorithm’s generalization capabilities, such as by incorporating dual-stage strategies and learning-based techniques. We will also investigate more efficient trajectory optimization methods to reduce computational cost. Furthermore, we aim to develop a general-purpose trajectory planner for unmanned systems operating in narrow, unstructured environments.