You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tip: to read the equations in the document, you are recommended to use Chrome with a plugin or copy the latex equation to an online editor
1 Definition
After finding a path in QP-Spline-Path, Apollo converts all obstacles on the path and the ADV (autonomous driving vehicle) into an path-time (S-T) graph, which represents that the station changes over time along the path. The speed optimization task is to find a path on the S-T graph that is collision-free and comfortable.
Apollo uses splines to represent speed profiles, which are lists of S-T points in S-T graph. Apollo leverages Quadratic programming to find the best profile. The standard form of QP problem is defined as:
$$
minimize \frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\\
s.t. LB \leq x \leq UB
\\\
A_{eq}x = b_{eq}
\\\
Ax \leq b
$$
2 Objective function
2.1 Get spline segments
Split the S-T profile into n segments. Each segment trajectory is defined by a polynomial.
2.2 Define function for each spline segment
Each segment i has an accumulated distance $d_i$ along a reference line. And the trajectory for the segment is defined as a polynomial of degree five by default. The degree of the polynomials are adjustable by configuration parameters.
Given the assumption that the the first point is ($t0$, $s0$), and $s0$ is on the planned path $f_i(t)$, $f'i(t)$, and $f_i(t)''$ (position, velocity, acceleration). Apollo converts those constraint into QP equality constraints:
$$
A_{eq}x = b_{eq}
$$
3.2 Monotone constraint
The path must be monotone, e.g., the vehicle can only drive forward.
Sample m points on the path, for each $j$ and $j-1$ point pairs ($j\in[1,...,m]$):
This constraint is designed to smooth the spline joint. Given the assumption that two segments, $seg_k$ and $seg_{k+1}$, are connected, and the accumulated s of segment $seg_k$ is $s_k$, Apollo calculates the constraint equation as:
Evenly sample m points along the path, and check the obstacle boundary at those points. Convert the constraint into QP inequality constraints, using:
$$
Ax \leq b
$$
Apollo first finds the lower boundary $l_{lb,j}$ at those points ($s_j$, $l_j$) and $j\in[0, m]$ based on the road width and surrounding obstacles. Then it calculates the inequality constraints as:
Apollo establishes a speed limit boundary as well.
Sample m points on the st curve, and get speed limits defined as an upper boundary and a lower boundary for each point $j$, e.g., $v{ub,j}$ and $v{lb,j}$ . The constraints are defined as: