Path-planning Algorithms for Self-driving Vehicles Based on Improved RRT Connect
Path-planning Algorithms for Self-driving Vehicles Based on Improved RRT Connect
DOI: 10.1093/tse/tdac061
Advance access publication date: 21 December 2022
Research Article
Keywords: path planning; rapidly-exploring random tree (RRT); double tree expansion; autonomous driving; curvature constraint
1. Introduction tion index of path cost. Each new node re-selects the parent node
and re-arranges the path line of the child node, so as to realize
As a key technology in the field of autonomous driving, path plan-
planning of the shortest asymptotic path.
ning plays an important role. Applied to autonomous vehicles,
Autonomous vehicles belong to nonholonomic kinematic con-
the path-planning algorithm is based on the motion planning
straints mobile robots, but existing algorithms such as the RRT,
of robots. Representative path-planning methods include the ar-
RRT-Connect and RRT∗ algorithms do not take vehicle kine-
tificial potential field method, the graph search-based method,
matic constraints into consideration when dealing with path-
the sampling-based method, the discrete numerical value-based
planning problems, so it is difficult for autonomous vehicles to
method, optimized methods and intelligent bionic algorithms [1–
move according to the path obtained by RRT algorithms. Focusing
10]. The sampling-based method does not need to process state
on the above problems, this paper proposes an improved path-
space in advance, so the search is fast, and it can effectively
planning method based on the RRT-Connect algorithm. Firstly,
solve the problem of motion planning in a complex environ-
considering the vehicle steering motion constraint, a cost func-
ment, the most representative of which is the rapidly-exploring
tion which considers path angle and path length is proposed.
random tree (RRT) algorithm. The RRT algorithm uses a start-
Secondly, in order to speed up path planning and improve path
ing point as the root node of the tree, continuously simulates
safety, an adaptive dynamic step search method and adaptive
tree growth with a certain step size and gradually explores the
obstacle expansion method are proposed. Finally, the path post-
state space until it connects to the target point [11]. However,
processing method is used to obtain the planned path that
due to the randomness of sampling, the RRT algorithm exhibits
satisfies the steering curvature constraint of the autonomous
blindness during the process of exploration, leading to a tor-
vehicle.
tuous and jittery path. Meanwhile, due to its insensitivity to
map information, shortcomings are particularly obvious in com-
plex maze maps or slit channels. And it is easy to cause local 2. Kinematics model of the vehicle
shock. Key to a kinematic model of an autonomous vehicle is the con-
Focusing on the defects of the above basic RRT algorithm, the straint of the steering angle of the vehicle, not the lateral mo-
researchers proposed relevant improvement methods. Among the tion of the vehicle. At the same time, the speed-to-steering limita-
methods based on the essential attributes of RRT, the most in- tion and vehicle dynamics requirements will be ignored, and the
fluential are RRT-Connect and RRT∗. The RRT-Connect algorithm model should be built at the level of vehicle kinematics. A kine-
adopts bidirectional random tree growth. In each iteration, the matic model of the autonomous vehicle is established, as shown
tree growth of one side always expands towards the other side in Fig. 1, which is simplified to a two-wheel model.
alternately, and the greedy growth strategy is added to node ex- Among them, in the inertial coordinate system, (Xf , Yf ) is the
pansion to achieve rapid exploration which greatly reduces com- centre coordinate of front axle, (Xr , Yr ) is the centre coordinates
puting time. Based on RRT, the RRT∗ algorithm uses the evalua- of the rear axle, δf is the front wheel slip angle, ϕ is the head-
Received: June 7, 2022. Revised: September 20, 2022. Accepted: October 5, 2022
© The Author(s) 2022. Published by Oxford University Press on behalf of Central South University Press. This is an Open Access article distributed under the
terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and
reproduction in any medium, provided the original work is properly cited.
2 | Transportation Safety and Environment, 2023, Vol. 5: No. 3
ing angle of the body, R is the rear wheel turning radius, L is the
wheelbase and P is the instantaneous rotation centre of the ve- 3. Improved RRT algorithm
hicle. It is assumed that the vehicle’s centroid slip angle is con-
3.1 Improvements of random tree exploring
stant throughout the steering process, namely, the vehicle’s in-
strategies
stantaneous steering radius is consistent with the road curvature
radius.
3.1.1 Main structure of improved RRT
According to the geometric relationship of the vehicle, there RRT-Connect has advantages of bi-directional exploration and
are: greedy strategy guidance, so it has high exploration efficiency.
In the path formed from it, the number of straight line seg-
Xf = Xr + l cos ϕ
(1) ments is directly related to the complexity of the map, having
Yf = Yr + l sin ϕ
certain similarity with vehicle motion. Therefore, the main struc-
vf = X˙ f cos (ϕ + δf ) + Y˙ f sin (ϕ + δf ) ture of bidirectional co-exploration and greedy strategy guidance
(2)
vr = X˙ r cos ϕ + Y˙ r sin ϕ in RRT-Connect is selected. Considering that direct connect can
From formula (1), the following can be obtained: be achieved between the starting point and target point under
barrier-free conditions, a judgement can be made in the first
X˙ f = X˙ r − l · ϕ˙ · sin ϕ growth stage of the algorithm. If the condition is satisfied, enter
(3)
Y˙ f = Y˙ r + l · ϕ˙ · cos ϕ post-processing directly to reduce unnecessary growth calcula-
When ignoring sideslip, kinematic constraints of front and rear tion.
axles are:
3.1.2 Cost function
X˙ f sin (ϕ + δf ) − Y˙ f cos (ϕ + δf ) = 0
(4) In the iterative process, RRT and its variants select parent nodes
X˙ r sin ϕ − Y˙ r cos ϕ = 0
through the cost function. In the above algorithm, the cost func-
Combining formulas (2) and (4), the following can be obtained: tion takes the minimum Euclidean distance as the reference in-
dex, as shown in formula (10), causing inoperability in the planned
X˙ r = vr cos ϕ
(5) path and going against requirements of vehicle kinematics.
Y˙ r = vr sin ϕ
Combining formulas (1), (3) and (5), yaw angular velocity ω can C(qi , qi+1 ) = (xi − xi+1 )2 + (yi − yi+1 )2 (10)
be obtained:
vr where, qi and qi+ 1 are the nodes on a random tree, and (xi , yi ), (xi + 1 ,
ω = ϕ˙ = tan δf (6) yi + 1 ) are the spatial coordinates of the two, respectively.
l
The following can be obtained from yaw rate ω and vehicle As shown in Fig. 2, after random point of growth qrand , if the Eu-
speed vr : clidean distance is compared, qi node is naturally selected. But in
fact, if the degree of tortuosity of the connection path of the ran-
R = vωr dom tree is taken into account, due to θ j < θi , qj is a better choice,
(7)
δf = arctan R1 which makes the path more smooth [18].
From formulas (1) and (7), the kinematic model can be obtained Therefore, when selecting parent nodes, distance and angle
as: need to be taken into account at the same time. In Ref. [12],
⎡ ⎤ ⎡ ⎤ Du et al. proposed a metric function that considers vector an-
X˙ r cos ϕ
⎢˙ ⎥ ⎢ ⎥ gle and Euclidean distance at the same time, and normalizes
⎣Yr ⎦ = ⎣sin ϕ ⎦ vr (8)
two dimensions of distance and angle in metric function C(qi , q j ).
ϕ˙ tan δf /l
After being normalized and adding weights to be combined,
The curvature formula is: where the weights are each 0.5, finally the output position of
1 the peak of the metric function is found. In practice, an accu-
k= (9)
R rate calculation of angles in the random tree is a great bur-
when the vehicle is turning, the steering curvature should be den, which will lead to an exponential increase of the calcula-
smaller than the maximum curvature limit constrained by the tion time, and at the same time, outward exploration of new
minimum steering radius of the vehicle, so that the path follow- nodes becomes lazy, and the advantages of RRT are no longer
ing can be satisfied. obvious.
Transportation Safety and Environment | 3
Non-obtuse angle Select parent nodes based on minimum Euclidean distance (consistent
with basic RRT mode).
Both obtuse and non-obtuse angles exist Among parent nodes with obtuse angle, select parent node using
minimum Euclidean distance as standard.
All obtuse angle Select parent nodes based on minimum Euclidean distance (consistent
with basic RRT mode).
Combining quantities of distance and angle, the following met- 3.1.3 Adaptive dynamic step length
ric function T (qi , qrand ) is put forward: Step length is the distance between a node and its growing child
nodes, which would affect calculation time and quality of planned
T (qi , qrand ) = D(qi , qrand ) + A(qi , qrand ) path. The smaller the step size, the more likely it is to jump over
⎧ obstacles to converge and the shorter the planned path may be,
⎪ D(qi , qrand ) = (xi − xrand )2 + (yi − yrand )2
⎪
⎪
⎪ 2
⎪D(qi , qk ) = (xi − xk ) + (yi − yk )
2 but the greater the cost of time [13–16]. Therefore, the adaptive
⎨ (11)
D(qk , qrand ) = (xk − xrand )2 + (yk − yrand )2 dynamic step length is proposed to balance exploration efficiency
⎪
⎪ and obstacle avoidance ability.
⎪
⎪ 0, D(qi , qrand ) + D(qi , qk ) < D(qk , qrand )
⎪
⎩A(qi , qrand ) =
1, others In RRT-Connect, the step length p of the double random tree
exploration is adjusted as follows: when one of the random tree
growth nodes explores a new node, the movement step length ex-
where, qi is a node in the matrix of the candidate parent nodes in pands a new node qnew with unit step length p. The other tree ex-
the random tree, qk is the parent node of qi , qrand is the random pands a new node q’new with a unit step size p. At this time, if
node generated before new nodes are generated in the next step, the connection between new node of the tree and its parent node
and cost function T (qi , qrand ) is determined by the square term of does not encounter obstacles and is not connected to the random
the Euclidean distance D(qi , qrand ) and angle control of the obtuse tree of the other party, the step length of the greedy expansion
angle A(qi , qrand ). The node with minimum value is selected as the in the next step will be 2p until it exits the loop when hitting the
parent node. The distance calculation function adopts the square obstacle. The improved dynamic step length method is shown in
term of the Euclidean distance, using positive correlation of the Fig. 3.
square root operation of the natural numbers, and directly remov- Establishment of this adaptive dynamic step size has the fol-
ing the square root operation, thus the calculation amount is re- lowing advantages:
duced. The angle control function uses the square relationship
of three sides of triangle, bounded by the Pythagorean theorem 1) Step length is only changed in the greedy straight line seg-
under right angles. If the square term of two adjacent sides is less ment, retaining exploration characteristics of the original
than that of the opposite side, it is an obtuse angle. Take the obtuse RRT, which will speed up the exploration speed to a certain
angle as priority, assign A(qi , qrand )=0, and assign 1 in other cases. extent and reduce the number of nodes.
In the tree node expansion, the parent node matrix (excluding 2) When approaching the obstacle with a step size of 2p, it is
starting point) of T (qi , qrand ) has the following possibilities show as equivalent to being able to perceive the obstacle at a faster
Table 1. speed. At the same time, compared with RRT of fixed step
The purpose of the re-proposed cost function is to use a sim- length, it is more likely that the node will eventually be far-
ple and effective function to guide random tree to expand for- ther away from the obstacle, which is beneficial to improve
ward in the direction of the obtuse angle. Compared with con- the smoothness of the high trajectory path.
trol of precise calculation of angle, this method of classifying the
angle of range greatly reduces the amount of calculation, retain- 3.1.4 Expansion of adaptive barrier block
ing the rapid expansion capability of RRT, and planning time does Due to the randomness of the trajectory generated by the RRT al-
not increase significantly compared with the original. Though the gorithm, there is a high probability of collision at the corner of the
planned path is still not optimal, obtuse sampling of new nodes maximum curvature of the path during the path post-processing,
has been optimized for smoother paths. as shown in Fig. 4. Thus, a supplementary expansion mechanism
4 | Transportation Safety and Environment, 2023, Vol. 5: No. 3
orientation is proposed. The first step is the same as that of the p(u ) = pi Ni,k (u ) (13)
i=0
pruning function based on the maximum curvature constraint,
and the pruning function is used to remove redundant points to where, pi is the coordinate of the control point, which determines
the greatest extent. In the valid path obtained after random tree the control polygon of the B-spline; i is the node number; Ni,k is the
finishes growing, from the starting node, define subsequent nodes normative B-spline basis function of number k, with the highest
as path nodes from target node to current node, and then connect number k. The basis function is a kth-order segmented polyno-
the current node to subsequent nodes in turn. Nodes with later mial consisting of the parameters u (u1 ≤ u2 ≤ ... ≤ un+k+2 ) in a se-
serial numbers are connected preferentially until there is no col- quence of non-decreasing vectors U. From recursion formula Cox-
lision between connection line and obstacle node, and so on, until de Boor, the following can be obtained:
⎧
it is connected to the target node. ⎪
⎨ 1, ui ≤ u ≤ ui+1
⎪
,k = 0
In the second step, path nodes are supplemented to eliminate 0,
Ni,k (u )= others (14)
the sharp included angle of the path, as shown in Fig. 9, and node ⎪
⎪ ui+k+1 −u
⎩ uu−u i
Ni,k −1 ( u ) + Ni +1 ,k −1 ( u ) , others
i+k −ui u −ui+1
selection is carried out on the basis of point-line distance from the i+k+1
DP algorithm. The algorithm is as follows: detect whether there where the denominator term ui+k − ui =0 or ui+k+1 − ui+1 =0, then
is an angle smaller than the set maximum limit angle αmin in define denominator value to be 1.
the connection path formed by the pruning function processing Generation rules of node vector sequence U are as follows:
in the previous step. If the path exists, define the furthest path ⎧
⎪
⎨0 , i = 1 : (1 + k )
point from the path segment qi -qi-1 as qt , then connect qi -qt and qt -
ui = uk+i−1 + n−k1+1 , i = others (15)
qi-1 in sequence, and check whether connection lines collide and ⎪
⎩1 , i = (n + 2 ) : (n + 2 + k )
whether angles qi+1 qi qt and qi qt qi−1 meet the maximum angle
requirements. If it is satisfied, supplementary path node qt enters Among them, there are a total of n + 1 control points, and a
the key point of the path. If there is no path that satisfies the con- total of n + k + 2 node vectors are generated. Nodes at both ends
dition, the algorithm tries to define the node closer to the line seg- of the node vector have a degree of repetition k + 1, namely: u1 =
ment qi -qi -1 as qt . If none of the node between qi -qi-1 satisfies the u2 = ... = uk+1 , un+2 = un+3 = ... = un+k+2 . Nodes in the middle are
condition, it tries to extract the node qt between qi -qi+1 . The final incremented point by point with tolerance n−k1+1 as arithmetic
planning result of the same schematic diagram is shown in Fig. 10, progression. The example of way-points curve fitting is shown
q1 is added between q3 and q0 , so curvature of the final fitted curve inFig. 11.
changes less. However, in special cases, in the process of supple- Take number k of fitting curve as 2, because nodes at both ends
menting nodes, the final set of selectable points is an empty one. have a lower repetition rate by one unit, and there are more node
Since new nodes regenerated are not supplemented, the second vectors increasing in the middle, which makes it closer to the
step is exited and the result of original first step is retained. control point and can improve planning, and maximum steering
Definition of maximum limit angle αmin =90◦ herein is based on curvature requirements are given to optimize control points de-
the square term of Euclidean distance, as shown in the following scribed later.
formula.
3.2.3 Control way-point supplement
⎧
⎪a = (xi − xi+1 )2 + (yi − yi+1 )2 Processed using the pruning function, path points become sparse,
⎪
⎪
⎪ 2 2
⎨b = (xi − xi−1 ) + (yi − yi−1 )
⎪ especially in segments with large turning. Fitting collision will oc-
xi−1 ) + (yi+1 − yi−1 )2
c = (xi+1 − 2
(12) cur due to the lack of control points, as shown in Fig. 12. If node
⎪
⎪
⎪
⎪ 0, a + b < c coordinates are (0,30), (0,0) and (30,0), the fitting result of the B-
⎪
⎩Angle(i ) =
1, others spline function described in Section 3.2.2 is the blue line, lead-
6 | Transportation Safety and Environment, 2023, Vol. 5: No. 3
Fig. 14. Improved RRT planning path curvature change (normalized path length).
cessfully inclined to the obtuse angle and the change of angle can overcomes blindness of exploration of the RRT algorithm. Mean-
be clearly seen compared with the original random tree of RRT- while, the number of random tree nodes is close to RRT-Connect.
Connect. Secondly, the adaptive dynamic step length and adap- Due to the adaptive dynamic step length strategy, the number
tive barrier block supplement expansion strategy can make the of nodes is further reduced. However, due to the addition of the
random tree far away from the barrier to a certain extent, approx- post-processing operation of road condition planning, the plan-
imating a safer path. In the post-processing stage of the planned ning time is increased by 0.03 s compared with RRT-Connect and
path, the way-point extraction strategy that considers both the 0.16 s compared with basic RRT. The increased time has little im-
heading angle constraint and the low path cost orientation re- pact in practical application, but the pruning function process-
duces unnecessary tortuous paths. Redundant way-points are re- ing of the post-processing operation of the improved RRT-Connect
moved, while the obtuse angle of the path is preserved. In this way, algorithm greatly reduces the path cost. The simulation results
sudden increase of curvature is limited to a certain extent, and show that the overall performance of the improved RRT-Connect
finally the curve fitting of the B-spline enables a continuous cur- algorithm is better than that of RRT, RRT-Connect and RRT∗ algo-
vature path to be realized. Compared with RRT, RRT-Connect and rithms. The obtained path meets the steering curvature constraint
RRT∗ algorithm, paths planned by improved RRT-Connect can be of autonomous vehicles, and the planned path is easier to be ex-
directly executed and meet requirements of smooth driving and ecuted by vehicles.
safe obstacle avoidance.
In case of straight overtaking road conditions and complex
parking lot conditions, since the interval of the convergence re- 5. Conclusions and future works
gion is wide enough, the curvature of the planned path satisfies
5.1 Conclusions
the limit curvature of the simulated vehicle, and the planned path
Focusing on the problem of path planning for autonomous ve-
is almost in line with the ideal path. From the simulation graph
hicles, this study proposes an improved path-planning algorithm
under complex parking lot conditions, it can be seen that the
based on RRT-Connect. The algorithm takes environmental con-
improved RRT-Connect algorithm inherits characteristics of at-
straints and dynamic constraints of intelligent vehicles into ac-
traction growth between two random trees of RRT-Connect, and
count at the same time. Firstly, a reasonable path cost function is
8 | Transportation Safety and Environment, 2023, Vol. 5: No. 3
References
Fig. 20. Improved RRT-Connect simulation iteration results. 1. Yu Zhuo-ping, Li Yi-shan, Xion G Lu. A review of motion plan-
16. Wang Dao-wei, Zhu Ming-fu, Liu Hui. Rapidly-exploring Random 18. Elbanhawi M, Simic M, Jazar R. Randomized bidirectional b-
Tree algorithm based on dynamic step [J]. Computer Technology spline parameterization motion planning[J]. IEEE Trans Intell
and Development 2016;26:105–7 112. Transp Syst 2016;17:406–19.
17. Jiang Yuan-yuan, Tao De-jun, Shi Mei-le, et al. Path smoothing 19. Gómez-Bravo F, Cuesta F, Ollero A, et al. Continuous curva-
algorithm of mobile robot based on DP-B spline [J/OL]. Mechanical ture path generation based on β -spline curves for parking ma-
Science and Technology for Aerospace Engineering 1-7[2019-10-09]. noeuvres[J]. Rob Autom Syst 2008;56:360–72.
Received: June 7, 2022. Revised: September 20, 2022. Accepted: October 5, 2022
© The Author(s) 2022. Published by Oxford University Press on behalf of Central South University Press. This is an Open Access article distributed under the terms of the Creative Commons Attribution
License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted reuse, distribution, and reproduction in any medium, provided the original work is properly cited.