Path is defined in station-lateral corrdination system. The **s** range from veichle's current position to default planing path length.
Path is defined in station-lateral coordination system. The **s** range from vehicle's current position to default planing path length.
### 1.2 Get spline segments
### 1.2 Get spline segments
Split the path into n segments. each segment trajectory is defined by a polynomial.
Split the path into **n** segments. each segment trajectory is defined by a polynomial.
### 1.3 Define function for each spline segment
### 1.3 Define function for each spline segment
Each segment *i* has accumulated distance $d_i$ along reference line. And the trajactory for the segment is defined as a polynomial of degree five by default
Each segment ***i*** has accumulated distance $d_i$ along reference line. The trajectory for the segment is defined as a polynomial of degree five by default.
Let's assume the the first point is ($s_0$, $l_0$), and $l_0$ should be on the planned path $f_i(s)$, $f'_i(s)$, and $f_i(s)''$. we convert those constraint into QP equality constraints
Assume that the first point is ($s0$, $l0$), and that $l0$ is on the planned path $f_i(s)$, $f'i(s)$, and $f_i(s)''$. Convert those constraints into QP equality constraints, using:
$i$ is the index of segment that contains the $s_0$.
The $i$ is the index of segment that contains the $s_0$.
so we get the equality constraint as
Therefore the equality constraint is:
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
...
...
@@ -175,11 +175,11 @@ $$
\end{vmatrix}
$$
### 2.2 The end point constraints
### 2.2 The end point constraints
Similar to the init point, the end point $(s_e, l_e)$ is known and shoud produce the same constraint as above.
Similar to the init point, the end point $(s_e, l_e)$ is known and should produce the same constraint as described in the init point calculations.
Combined init point and end point, we get equality constraint as
Combine the init point and end point, and show the equality constraint as:
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
...
...
@@ -203,13 +203,13 @@ $$
$$
### 2.3 Joint smoothness constraints
### 2.3 Joint smoothness constraints
This constraint is to make the spline joint smooth. Let's assume two segment $seg_k$ and $seg_{k+1}$ are connected, and the accumulated s of segment $seg_k$ is $s_k$. The we can get the constraint equation as
This constraint is designed to smooth the spline joint. Assume two segments $seg_k$ and $seg_{k+1}$ are connected, and the accumulated **s** of segment $seg_k$ is $s_k$. Calculate 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
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
$$
We first find lower boundary $l_{lb,j}$ at those points ($s_j$, $l_j$) and $j\in[0, m]$ based on road width and surrounding obstacles. The calculate the inequality constraints as
First find 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. Calculate the inequality constraints as:
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
...
...
@@ -273,7 +273,7 @@ $$
$$
similarly, for upper boundary $l_{ub,j}$, we get the inequality constraints as
Similarly, for the upper boundary $l_{ub,j}$, calculate the inequality constraints as:
After finding a path in QP-Spline-Path, we convert all obstacles on the path and ADV (autonomous driving vehicle) itself into a ST graph, which represents the stations changes over time along the path. Our speed optimization task is to find a path on ST graph that is collision-free and comfort.
After finding a path in QP-Spline-Path, Apollo converts all obstacles on the path and the ADV (autonomous driving vehicle) into an ST graph, which represents the station changes over time along the path. The speed optimization task is to find a path on the ST graph that is collision-free and safe.
We use spline to define the path, and find the best path leveraging Quadratic programming with a set of conditions. QP formulation is defined as
Apollo uses spline to define the path. To find the best path, Apollo leverages Quadratic programming with a set of conditions. The QP formulation is defined as:
$$
\frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\
...
...
@@ -17,59 +17,57 @@ A_{eq}x = b_{eq}
Ax \leq b
$$
## 2 Objective function
## 2 Objective function
### 1.1 Get spline segments
Split the path into n segments. each segment trajectory is defined by a polynomial.
Split the path into **n** segments. Each segment trajectory is defined by a polynomial.
### 1.2 Define function for each spline segment
### 1.2 Define function for each spline segment
Each segment *i* has accumulated distance $d_i$ along reference line. And the trajactory for the segment is defined as a polynomial of degree five by default
Each segment ***i*** has accumulated distance $d_i$ along a reference line. And the trajectory for the segment is defined as a polynomial of degree five by default.
Let's assume the the first point is ($t_0$, $s_0$), and $s_0$ should be on the planned path $f_i(t)$, $f'_i(t)$, and $f_i(t)''$ (position, velocity, acceleration). we convert those constraint into QP equality constraints
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}
$$
### 2.2 Monotone constraint
### 3.2 Monotone constraint
The path need to be monotone, e.g., vehicle can only drive forward.
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]$)
Sample **m** points on the path, for each $j$ and $j-1$ point pairs ($j\in[1,...,m]$):
This constraint is to make the spline joint smooth. Let's assume two segment $seg_k$ and $seg_{k+1}$ are connected, and the accumulated s of segment $seg_k$ is $s_k$. The we can get the constraint equations as
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 is $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
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
$$
We first find lower boundary $l_{lb,j}$ at those points ($s_j$, $l_j$) and $j\in[0, m]$ based on road width and surrounding obstacles. The calculate the inequality constraints as
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:
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
...
...
@@ -162,7 +160,7 @@ $$
$$
similarly, for upper boundary $l_{ub,j}$, we get the inequality constraints as
Similarly, for upper boundary $l_{ub,j}$, Apollo calculates the inequality constraints as:
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
...
...
@@ -182,15 +180,15 @@ $$
### 2.5 Speed Boundary constraint
### 3.5 Speed Boundary constraint
We need to limit speed boundary as well.
Apollo establishes a speed limit boundary as well.
Sample m points on st curve, and get speed limits upper bound and lower bound for each point $j$, e.g., $v_{ub,j}$ and $v_{lb,j}$ . The constraints is defined as
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:
Segment routing path into n segments. each segment trajectory is defined by two polynomials.
Segment routing path into **n** segments. each segment trajectory is defined by two polynomials:
$$
x = f_i(t)
...
...
@@ -47,11 +47,11 @@ $$
### 2.1 Joint smoothness constraints
This constraint is to make the spline joint smooth. Let's assume two segment $seg_k$ and $seg_{k+1}$ are connected, and the accumulated s of segment $seg_k$ is $s_k$. The we can get the constraint euqation as
This constraint smoothes the spline joint. Let's assume two segments, $seg_k$ and $seg_{k+1}$, are connected and the accumulated **s** of segment $seg_k$ is $s_k$. Calculate the constraint equation as:
$$
f_k(s_k) = f_{k+1} (s_0)
$$
Similarly we can get the equality constraints for
Similarly the formula works for the equality constraints, such as:
$$
f'_k(s_k) = f'_{k+1} (s_0)
\\
...
...
@@ -70,7 +70,7 @@ $$
### 2.2 Sampled points for boundary constraint
Evenly sample m points along the path, and check predefined boundary at those points.
Evenly sample **m** points along the path and check the predefined boundaries at those points.