[Paper Notes] Optimal trajectory generation for dynamic street scenarios in a Frenét Frame

Insert image description here


A method of horizontal and vertical decoupling optimization planning of the classic Frenet coordinate system.
Due to the limitations of personal abilities, there may be some mistakes. Please criticize and correct me. I hope to learn from everyone together.

Abstract

  • A semi-reactive trajectory generation algorithm is proposed , which can be well integrated into the decision-making layer. This method combines passive collision with cruise control, merging, car following, etc. based on the optimal control strategy in the Frenet coordinate system.
  • Find reasonable approximations in the set of optimal solutions to unconstrained optimization problems to solve constrained optimization problems and select the best solution to satisfy constraints .
  • High speeds are decoupled horizontally and vertically from each other; low speeds are different.

I. INTRODUCTION

A. Motivation

Traditional algorithms have some limitations and are difficult to apply to dynamic and complex environments and high-speed scenarios. The method proposed by the author can:

  1. It is well adapted to highway scenarios and can generate driving actions that keep the speed constant (meaning that operations such as lane changing and merging are independent of driving speed) and transfer speed and distance control to the planning level.
  2. Reactive (passive?) obstacle avoidance is achieved by combining steering, braking/acceleration.

B. Related work

  • [11], [19], [2], [4]: ​​Use a global trajectory connecting the starting point and a distant possible target state, but this type of method does not consider various uncertainties in the driving process of autonomous vehicles . Relies on the accurate prediction of the future behavior trajectories of other traffic participants .
  • [16], [1], [7]: The discrete optimization method is used: the finite trajectory library (discretization of the control space) is obtained through forward integration of the vehicle dynamics differential equation . Use the trajectory library to evaluate and score using the cost function for local path planning. The types of trajectories can take many forms. However, this approach may be suboptimal. And this method may produce overshoot or even instability , as shown in the figure below.
    Insert image description here
    This figure shows that trajectories with high replanning frequency can avoid or reduce the overshoot and even instability problems encountered by trajectories with low replanning frequency.

PS1: Similar papers Maximum Likelihood Path Planning for Fast Aerial Maneuvers and Collision Avoidance Ji Zhang, Chen Hu, Rushat Gupta Chadha, and Sanjiv Singh
PS2: Notes from previous mobile robot motion planning courses: https://blog.csdn.net/ sinat_52032317/article/details/132125557

  • [9]: Sampling the trajectory tree through RRT simulation closed-loop system [10].
  • [17]: Similar idea to this paper, but does not consider obstacles. The concept of Galerkin base was mentioned.

PS: Galerkin base : Galerkin base is a basis function that can describe the dynamic behavior of a system in function space. In optimal control, the Galerkin basis is used to represent the state and control space of the system in order to find the optimal control trajectory. Simply put, the Galerkin basis is a mathematical method used to express the dynamic behavior of a system as a linear combination of a set of basis functions, thereby simplifying the modeling and control of the system.

PS: Bellman's optimality principle is one of the basic principles of dynamic programming. This principle states that in any case, the optimal sequence of decisions contains the optimal sequence of decisions for the current decision. That is, if we find the optimal decision sequence in a problem, then every decision in this sequence is the optimal decision for this problem , regardless of the previous decision sequence. This principle is the basis of the dynamic programming algorithm, which gradually decomposes complex problems into simple problems and solves them step by step.

II. OPTIMAL CONTROL APPROACH

The author uses the idea of ​​introducing optimal control in trajectory generation to ensure the temporal consistency of the trajectory.


Q: Generally speaking, the cost function method may not comply with the Bellman optimality principle, and the planned trajectory will be different during the next planning. So how did this article do it?

A: The method in this article conforms to the Bellman optimality principle because during the trajectory generation process, the trajectory tracking problem is optimized into an optimal control problem and a cost function is selected that conforms to the optimality principle. The principle of optimality states that when an optimal solution is found, it will be retained until some aspect of the problem changes. In our approach, once the optimal solution is found, the vehicle follows the remaining portion of the precomputed trajectory at each planning step, thus ensuring the temporal consistency of the trajectory. The temporal consistency of the trajectory is visually demonstrated in the following figures.


  • In terms of optimal control, Bellman's optimization principle is mainly followed to select the cost
    function. On the basis of minimizing the cost, the trajectory can also be as close as possible to the ideal driving form of the vehicle.

    Ideal self-driving vehicle kinematic behavior : good balance of comfort (with jerk jerk) after deviating from the lanej er k measure) and the time to return to the desired position (tend − tstart t_{end}-t_{start}tendtstart)。

  • When solving general restricted optimization problems, since the problem is not limited to a certain function class, the problem becomes very complex and can only be solved numerically at best. Therefore, the method proposed by the author is to find reasonable approximations in the optimal solution set of the unconstrained (free) optimization problem to solve the constrained optimization problem and select the best solution to satisfy the constraints. This means that once the optimal solution is found to be valid (the constraints are no longer active), the temporal consistency of non-reactive trajectories is guaranteed.

    Simply put, it is to use the optimal solution sequence obtained under the unconstrained optimization problem to approximate the constrained optimization problem.

III. MOTION PLANNING IN THE FREN ́ET FRAME

A better method in trajectory tracking control is the Frenet coordinate system method, which can

  • S E ( 2 ) : = S O ( 2 ) × R 2 SE(2):=SO(2) \times \mathbb R^2 SE ( 2 ):=SO(2)×R2. The special Euclidean subgroup has good tracking performance (invariant tracking
    performance)

    PS: The special Euclidean subgroup SO(2) refers to the two-dimensional rotation group, which is composed of all two-dimensional rotation matrices. The form is: SO (2) = { ( cos ⁡ ( θ ) − sin ⁡ ( θ ) sin ⁡ ( θ ) cos ⁡ ( θ ) ) | θ ∈ [ 0 , 2 π ) } SO(2) = \left\{ \begin{pmatrix} \cos(\theta) & -\sin(\theta) \\ \sin (\theta) & \cos(\theta) \end{pmatrix} \:\middle|\: \theta \in [0, 2\pi) \right\}SO(2)={ (cos ( θ )sin ( θ ).sin ( θ )cos ( θ ).) i[0,2 π ) } whereθ \thetaθ represents the rotation angle.
    The special Euclidean subgroup SE(2) refers to the two-dimensional Euclidean group, which consists of all two-dimensional rigid body motion matrices, including translation and rotation, in the form: SE (2) = { ( cos⁡ ( θ ) − sin ⁡ ( θ ) x sin ⁡ ( θ ) cos ⁡ ( θ ) y 0 0 1 ) | θ ∈ [ 0 , 2 π ) , x , y ∈ R } SE(2) = \left\{ \begin{pmatrix} \cos (\theta) & -\sin(\theta) & x \\ \sin(\theta) & \cos(\theta) & y \\ 0 & 0 & 1 \end{pmatrix} \:\middle|\: \theta \in [0, 2\pi), x, y \in \mathbb{R} \right\}SE ( 2 )= cos ( θ )sin ( θ )0sin ( θ )cos ( θ )0xy1 i[0,2 p ) ,x,yR
    Among them θ \thetaθ represents the rotation angle,xxxyyy represents the translation amount. The two-dimensional Euclidean group is very important because it is a common motion group in fields such as robotics and computer vision, and can be used to describe the motion of a robot on a plane.

  • In planning problems under the Frenet coordinate system, reference lines are very important. The reference line can be the road centerline or the rough trajectory generated by path planning under unstructured roads.
    Insert image description hereOne-dimensional trajectories in the horizontal and vertical directions are generated based on the dynamic reference system. The relative relationship is as follows: x ⃗ ( s ( t ) , d ( t ) ) = r ⃗ ( s ( t ) ) + d ( t ) n ⃗ r ( s ( t ) ) \vec{x}(s( t),d(t))=\vec{r}(s(t))+d(t)\vec{n}_r(s(t))x (s(t),d(t))=r (s(t))+d(t)n r(s(t)) r ⃗ \vec{r} r is the reference point on the center line; d (t) d(t)d ( t ) is the lateral deviation;s (t) s(t)s ( t ) refers to
    the arc length passing through a period of time along the direction of the center line;t ⃗ x , n ⃗ x \vec t_x,\vec n_xt x,n xare the tangential and normal vectors of the trajectory respectively.

This article uses a fifth-degree polynomial as the trajectory, which can achieve the effect of minimum jerk and construct the classic BVP/OBVP problem. Previous related notes: https://blog.csdn.net/sinat_52032317/article/details/132125557

J t ( p ( t ) ) : = ∫ t 0 t 1 p ¨ 2 ( τ ) d τ . J_t(p(t)):=\int_{t_0}^{t_1}\ddot{p}^2(\tau)\mathrm{d}\tau. Jt(p(t)):=t0t1p¨2 (τ)dτ.Starting
state:P 0 = [ p 0 , p ˙ 0 , p ¨ 0 ] P_0 = [p_0,\dot p_0, \ddot p_0]P0=[p0,p˙0,p¨0] , starting timet 0 t_0t0;
End state: P 1 = [ p ˙ 1 , p ¨ 1 ] P_1 = [\dot p_1, \ddot p_1]P1=[p˙1,p¨1] , end timet 1 = t 0 + T t_1 = t_0 +Tt1=t0+T;

The cost function is a fifth degree polynomial:
C = kj J t + ktg ( T ) + kph ( p 1 ) C=k_jJ_t+k_tg(T)+k_ph(p_1)C=kjJt+ktg(T)+kph(p1)
wheregg_g andhhh is any function,kj, kt, kp k_j,k_t,k_pkj,kt,kp>0
Take a look at the proof process of the paper (prove cost function CCC is also a fifth-degree polynomial):
Proof by contradiction:
If not, thenJ t J_tJtwill always be smaller than the form of the fifth degree polynomial.

IV. GENERATION OF LATERAL MOVEMENT

PS: In the field of optimal control, "target manifold" is a term that refers to the set of state variables that the control input needs to achieve in the control system. In an optimal control problem, the objective manifold is the part of the optimization problem that describes the constraints that the system must obey. In the paper, the author puts d ˙ 1 = d 1 = 0 ḋ_1 = d_1 = 0d˙1=d1=0 as the target manifold so that the car moves parallel along the center line.

A. High Speed Trajectories

At high speed, horizontal and vertical decoupling and independent calculation are adopted.

The starting state is calculated from the previous trajectory to ensure continuity: D 0 = [ d 0 , d ˙ 0 , d ¨ 0 ] D_0=[d_0,\dot d_0,\ddot d_0]D0=[d0,d˙0,d¨0] . In order to make the trajectory parallel to the center line, the final stated ˙ 1 , = 0 d ¨ 1 = 0 \dot d_1,=0\ddot d_1=0d˙1,=0d¨1=0 . Theng ( T ) = T , h ( d 1 ) = d 1 2 g(T)=T,h(d_1)=d_1^2g(T)=T,h(d1)=d12(The former is to accelerate convergence, and the latter is to reduce the deviation from the center line), the final cost function is obtained:
C d = kj J t ( d ( t ) ) + kt T + kdd 1 2 , C_d=k_jJ_t(d( t))+k_tT+k_dd_1^2,Cd=kjJt(d(t))+ktT+kdd12,

The process of trajectory generation is explained with reference to the figure below.
Insert image description here
The first step is not to directly calculate the trajectory and then adjust the relevant parameters. The author first generated a trajectory library containing the final state di d_idiand the experienced time T j T_jTj:
[ d 1 , d ˙ 1 , d ¨ 1 , T ] i j = [ d i , 0 , 0 , T j ] [d_1,\dot{d}_1,\ddot{d}_1,T]_{ij}=[d_i,0,0,T_j] [d1,d˙1,d¨1,T]ij=[di,0,0,Tj]

Step 2: Select the lowest cost effective trajectory.

The trajectory planned in each cycle will continue to be planned along the optimal trajectory planned in the previous cycle. In this way, it can comply with Bellman's optimality principle and achieve time consistency.

B. Low Speed Trajectories

For low-speed scenarios, the horizontal and longitudinal decoupling method ignores the non-integrity constraints of the vehicle, so the trajectory may not be effective. The relative relationship at low speed is as follows:
x ⃗ ( s ( t ) , d ( t ) ) = r ⃗ ( s ( t ) ) + d ( s ( t ) ) n ⃗ r ( s ( t ) ) . \ vec{x}(s(t),d(t))=\vec{r}(s(t))+d(s(t))\vec{n}_r(s(t)).x (s(t),d(t))=r (s(t))+d(s(t))n r( s ( t )) . Why not do this in high-speed scenarios?

For low-speed scenes, you can set a speed threshold in the behavioral layer. When the speed is lower than this threshold, a horizontal trajectory is generated based on longitudinal motion.

Insert image description here
Cost function in low-speed scenarios.
The generation of the trajectory library is similar to the high-speed situation, but attention should be paid to d ′ d^{'}d is forsss求导
[ d 1 , d ˙ 1 , d ¨ 1 , T ] i j = [ d i , 0 , 0 , T j ] [d_1,\dot{d}_1,\ddot{d}_1,T]_{ij}=[d_i,0,0,T_j] [d1,d˙1,d¨1,T]ij=[di,0,0,Tj]

V. GENERATION OF LONGITUDINAL MOVEMENT

Horizontal planning mainly uses time/distance as the main evaluation criteria. The evaluation annotations here are mainly comfort and safety, so vertical jerk is introduced as a consideration for optimization problems.

Use diagrams to understand the process of vertical planning.

Insert image description here

For scenarios such as car following, merging, and parking, a target state starget (t) s_{target}(t) is requiredstarget( t ) serves as a guide, and in each cycle, the end constraints are updated (there will be differentΔ si \Delta s_iΔs _iand T j T_jTj)。
S 0 = [ s 0 , s ˙ 0 , s ¨ 0 ] S_0=[s_0,\dot s_0,\ddot s_0] S0=[s0,s˙0,s¨0]
[ s 1 , s ˙ 1 , s ¨ 1 , T ] i j = [ [ s target ( T j ) + Δ s i ] , s ˙ target ( T j ) , s ¨ target ( T j ) , T j ] [s_1,\dot{s}_1,\ddot{s}_1,T]_{ij}=[[s_\text{target}(T_j)+\Delta s_i],\dot{s}_\text{target}(T_j),\ddot{s}_\text{target}(T_j),T_j] [s1,s˙1,s¨1,T]ij=[[starget(Tj)+Δs _i],s˙target(Tj),s¨target(Tj),Tj]
The cost function is:C t = kj J t + kt T + ks [ s 1 − sd ] 2 . C_t=k_jJ_t+k_tT+k_s[s_1-s_d]^2.Ct=kjJt+ktT+ks[s1sd]2.

Following

mentioned constant time gap law

PS: " constant time gap law " refers to the international traffic rules that require a vehicle to maintain a safe distance from the vehicle in front of it at a certain time interval. This distance will change with the change of speed. This time gap is considered to be a constant, hence the name "constant time gap law". The purpose of this rule is to ensure a safe distance between vehicles traveling on highways and other high-speed roads to ensure driving safety.

s t a r g e t ( t ) : = s l v ( t ) − [ D 0 + τ s ˙ l v ( t ) ] s_{\mathrm{target}}(t):=s_{lv}(t)-[D_0+\tau\dot{s}_{lv}(t)] starget(t):=slv(t)[D0+ts˙lv(t)]

D 0 , τ D_0,\tauD0,τ is fixed;slv , s ˙ lv s_{lv},\dot s_{lv}slv,s˙lvare the position and speed of the vehicle in front respectively.
Some data of the vehicle in front need to be obtained through perception prediction, where we assume that the acceleration of the vehicle in front remains unchanged, s ¨ lv ( t ) = s ¨ lv ( t 0 ) = const . \ddot{s}_ {lv}(t)=\ddot{s}_{lv}\left(t_0\right)=\mathrm{~const.}s¨lv(t)=s¨lv(t0)= const. Integrating over time gives:

s ˙ l v ( t ) = s ˙ l v ( t 0 ) + s ¨ l v ( t 0 ) [ t − t 0 ] s l v ( t ) = s l v ( t 0 ) + s ˙ l v ( t 0 ) [ t − t 0 ] + 1 2 s ¨ l v ( t 0 ) [ t − t 0 ] 2 , \begin{aligned}\dot{s}_{lv}(t)&=\dot{s}_{lv}(t_0)+\ddot{s}_{lv}(t_0)[t-t_0]\\s_{lv}(t)&=s_{lv}(t_0)+\dot{s}_{lv}(t_0)[t-t_0]+\frac12\ddot{s}_{lv}(t_0)[t-t_0]^2,\end{aligned} s˙lv(t)slv(t)=s˙lv(t0)+s¨lv(t0)[tt0]=slv(t0)+s˙lv(t0)[tt0]+21s¨lv(t0)[tt0]2,

Then get the remaining variables of the target state.
s ˙ target ( t ) = s ˙ lv ( t ) − τ s ¨ lv ( t ) , s ¨ target ( t ) = s ¨ lv ( t 1 ) − τ s ¨ lv ( t ) = s ¨ lv ( t 1) . \begin{aligned}\dot{s}_{\mathrm{target}}(t)&=\dot{s}_{lv}(t)-\tau\ddot{s}_{lv} (t),\\\ddot{s}_{\mathrm{target}}(t)&=\ddot{s}_{lv}(t_1)-\tau\ddot{s}_{lv}(t )=\ddot{s}_{lv}(t_1).\end{aligned}s˙target(t)s¨target(t)=s˙lv(t)ts¨lv(t),=s¨lv(t1)ts¨lv(t)=s¨lv(t1).

Merging and Stopping

s t a r g e t ( t ) = 1 2 [ s a ( t ) + s b ( t ) ] s_{\mathrm{target}}(t)=\frac12[s_a(t)+s_b(t)] starget(t)=21[sa(t)+sb( t )]
The target point of the merge is set between the two vehicles.
The parking scene is as follows:starget = sstop, s ˙ target ≡ 0 , s ¨ target ≡ 0. s_{\mathrm{target}}=s_{\mathrm{stop}},\dot{s}_{\mathrm{ target}}\equiv0,\ddot{s}_{\mathrm{target}}\equiv0.starget=sstop,s˙target0,s¨target0.

Velocity Keeping

Insert image description here

For the situation where there is no car ahead, the cost function is as follows: C v = kj J t ( s ( t ) ) + kt T + ks ˙ [ s ˙ 1 − s ˙ d ] 2 C_v=k_jJ_t(s(t))+k_tT +k_{\dot{s}}[\dot{s}_1-\dot{s}_d]^2Cv=kjJt(s(t))+ktT+ks˙[s˙1s˙d]2By
usingΔ s ˙ , T j \Delta \dot s, T_jDs˙TjTo change the constraints of the final state, to generate the trajectory library of quartic polynomial: [ s ˙ 1 , s ¨ 1 , T ] ij = [ [ s ˙ d + Δ s ˙ i ] , 0 , T j ] [\dot {s}_1,\ddot{s}_1,T]_{ij}=[[\dot{s}_d+\Delta\dot{s}_i],0,T_j][s˙1,s¨1,T]ij=[[s˙d+Ds˙i],0,Tj]

VI. COMBINING LATERAL AND LONGITUDINAL TRAJECTORIES

  • First perform an acceleration limiter check on the trajectories and then merge them.

  • Normally, the reference line is not
    in close form, but is represented by a pre-sampled point set (heading angle θ r ( s ) \theta_r(s)ir( s ) , curvatureκ r ( s ) \kappa_r(s)Kr( s ) , derivative of curvatureκ ˙ r ( s ) \dot\kappa_r(s)K˙r( s ) ), higher-order information cannot be obtained by numerical solution.

    PS: close form is a mathematical concept, which refers to a mathematical expression that can be expressed by analytical expressions obtained by limited basic arithmetic operations and functional operations, as well as finite-order derivatives and integrals and other basic mathematical operations.

  • The joint cost of the final trajectory is obtained by adding different weight coefficients to the horizontal and vertical directions: C tot = klat C lat + klon C lat C_{tot}=k_{lat}C_{lat}+k_{lon}C_{lat}Ct o t=klatClat+klonClat

  • Measures to reduce unnecessary side-passes: the scope of collision checking expands a little over time.

  • When encountering a situation where the reference line needs to be changed, the terminal end points (x, θ x, κ x, vx, ax) need to be changed (x,\theta_x,\kappa_x,v_x,a_x)(x,ix,Kx,vx,ax) is projected onto the starting point of the new reference line[s 0 , s ˙ 0 , s ¨ 0 , d 0 , d ˙ 0 , d ¨ 0 ] [s_0,\dot s_0,\ddot s_0,d_0,\dot d_0, \ddot d_0][s0,s˙0,s¨0,d0,d˙0,d¨0]. s 0 s_0 s0Exception, since no specific reference line shape is constrained. But it can be solved by constructing an optimization problem. s = argmin ⁡ σ ∥ x − r ( σ ) ∥ s=\underset{\sigma}{\operatorname*{argmin}}\|xr(\sigma)\|s=pargminxr ( σ )

Insert image description here
The change in the color of the trajectory in the figure represents the change in cost.

VIII. EXPERIMENTS

Insert image description here
Fig. 7. Simulated highway scenario: The center line is given by the middle lane and the desired speed is significantly higher than the traffic flow. Two completely reactive passing maneuvers are shown between t = 0.0 s and 7.75 s, as well as between t = 29.07 s and 50.0 s with predicted obstacle movements on Thor ≤ 3.0 s.

TRANSFORMATIONS FROM FREN ́ET COORDINATES TO GLOBAL COORDINATES

The appendix of this paper is also very useful, introducing the transformation from Frenet to global coordinates.

For further information, please refer to this blog. Frenet coordinate system and its conversion to Cartesian coordinates (1) principle
Insert image description hereInsert image description hereInsert image description here

Insert image description here

code

[1] https://atsushisakai.github.io/PythonRobotics/modules/path_planning/path_planning.html
[2] https://github.com/ChenBohan/Robotics-Path-Planning-04-Quintic-Polynomial-Solver/blob/master/Optimal%20Trajectory%20in%20a%20Frenet%20Frame/cubic_spline_planner.py
[3] https://github.com/AtsushiSakai/PythonRobotics/tree/master/PathPlanning
[4] https://github.com/ndrplz/self-driving-car/blob/master/project_11_path_planning/src/coords_transform.h
[5] https://github.com/caokaifa/Matlab-planning
[6] https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py
[7] https://www.cnblogs.com/kin-zhang/p/15006838.html

Guess you like

Origin blog.csdn.net/sinat_52032317/article/details/132924715