Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync beta branch beta/v0.26.0 with tier4/main #1234

Merged
merged 55 commits into from
Apr 8, 2024
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a8364b4
refactor(pointcloud_preprocessor): move roi_mode_map_ definition insi…
kyoichi-sugahara Mar 20, 2024
872cbdd
fix(avoidance): don't slow down if avoidance is NOT definitely necess…
satoshi-ota Mar 21, 2024
3a346c7
fix(out_of_lane): use bigger stop lines to cut predicted paths (#6630)
maxime-clem Mar 22, 2024
e903d11
feat: enable multithreading for the control container (#6666)
tkimura4 Mar 22, 2024
af04566
feat(dynamic_obstacle_stop): set velocity factor to ROUTE_OBSTACLE (#…
maxime-clem Mar 22, 2024
62c1b89
feat(out_of_lane): set velocity_factor to ROUTE_OBSTACLE (#6668)
maxime-clem Mar 22, 2024
338aca7
feat(crosswalk): add velocity factor when slowing down (#6670)
maxime-clem Mar 22, 2024
b44fb20
fix(motion_utils): check size after overlap points removal (#6653)
zulfaqar-azmi-t4 Mar 22, 2024
7908a4a
feat(tier4_system_launch): add option to launch mrm handler (#6660)
isamu-takagi Mar 22, 2024
262ec55
fix(probabilistic_occupancy_grid_map): fix launch config name from ol…
YoshiRi Mar 23, 2024
b9f7ae6
fix(planning_validator): calculate max lateral acceleration after res…
kaigohirao Mar 25, 2024
3683131
test(ndt_scan_matcher): added an unit test to ndt_scan_matcher (#6649)
SakodaShintaro Mar 25, 2024
b7f2079
feat(perception_online_evaluator): add yaw rate metrics for stopped o…
kosuke55 Mar 25, 2024
f36005b
chore(tier4_planning_launch): set log output both (#6685)
shmpwk Mar 25, 2024
1d721dc
fix(out_of_lane): calculate path lanelets that we can miss during a l…
maxime-clem Mar 26, 2024
297b486
feat(goal_planner): add general turnsignalinfo method for goal planne…
danielsanchezaran Mar 26, 2024
106ee3e
feat(goal_planner): add param reconfig to goal planner (#6646)
danielsanchezaran Mar 26, 2024
ce6de02
feat(AEB): add height filter for avoiding the ghost brake by false po…
Shin-kyoto Mar 26, 2024
93dfcbb
fix(vehicle_cmd_gate): fix publisher HZ in the unit test by introduci…
xmfcx Mar 26, 2024
d26565d
feat(default_ad_api): add door api (#5737)
isamu-takagi Mar 27, 2024
2d524dc
fix(lane_change): do not return empty path if no valid path (#6686)
zulfaqar-azmi-t4 Mar 27, 2024
aa057b8
fix(avoidance_by_lane_change): object filtering too conservative (#6662)
zulfaqar-azmi-t4 Mar 27, 2024
a0bac37
feat(behavior_velocity_run_out_module): exclude obstacle crossing ego…
danielsanchezaran Mar 27, 2024
e84aaee
feat(run_out): add motorcyles to run out module target obstacles (#6690)
danielsanchezaran Mar 27, 2024
dd7c252
refactor(start planner): refactor for clarity, readability and maybe …
danielsanchezaran Mar 27, 2024
fe5e63f
fix(goal_planner): stop path candidates update after arriving modifie…
kosuke55 Mar 28, 2024
1ed6462
perf(static_centerline_optimizer): cleanup the package dependencies (…
maxime-clem Mar 28, 2024
6d7cd0a
fix(freespace_planner): fix parking trajectory errors and warnings wh…
ahmeddesokyebrahim Mar 28, 2024
c2f57ae
chore(tier4_system_launch): add option to select graph path depending…
TomohitoAndo Mar 29, 2024
61beca1
fix(dynamic_obstacle_stop,out_of_lane,crosswalk): update velocity fac…
maxime-clem Mar 29, 2024
37cd3f8
chore(blockage_diag): add dust diagnostic option param (#6645)
badai-nguyen Mar 29, 2024
dd2ff22
feat(dynamic_obstacle_stop): use a time buffer for each dynamic objec…
maxime-clem Mar 29, 2024
6c75c7b
refactor(image_projection_based_fusion): rename template argument (#6…
kminoda Mar 29, 2024
52efb84
docs(dynamic_avoidance): update doc (#6648)
yuki-takagi-66 Mar 29, 2024
031c873
feat(crosswalk): ignore occlusions in the presence of traffic lights …
maxime-clem Mar 29, 2024
1527f8a
fix(dynamic_obstacle_stop): fix run time error (#6714)
takayuki5168 Mar 29, 2024
b5c29fc
docs(mpc_lateral_controller): modify mathjax visualization error (#6486)
sak-0822 Mar 31, 2024
badd949
refactor(dynamic_obstacle_stop): change log level for processing time…
kyoichi-sugahara Mar 31, 2024
7869149
feat(default_ad_api): add dynamic_obstacle_stop velocity factor topic…
maxime-clem Apr 1, 2024
d49680d
feat(default_ad_api): release adapi v1.2.0 (#6694)
isamu-takagi Apr 1, 2024
0836cfb
feat(run_out_module): exclude obstacles on path (#6703)
danielsanchezaran Apr 1, 2024
42d4936
feat(lane_change): additional debug markers (#6529)
zulfaqar-azmi-t4 Apr 1, 2024
46e3ad4
feat(ndt_scan_matcher): fix first update map (#6699)
YamatoAndo Apr 1, 2024
8c02272
feat(pose_initilizer): set intial pose directly (#6692)
YamatoAndo Apr 1, 2024
a808ff0
docs(lane_change): update documentation (#6544)
zulfaqar-azmi-t4 Apr 1, 2024
f8e6047
feat(perception_online_evaluator): unify debug markers instead of sep…
kosuke55 Apr 1, 2024
f77f0f7
feat(perception_online_evaluator): extract moving object for deviatio…
kosuke55 Apr 1, 2024
dadbb2c
feat(start_planner): add validation check to prevent over cropped pat…
danielsanchezaran Apr 1, 2024
2d105d5
feat(obstacle_avoidance_planner): sanitize reference points (#6704)
danielsanchezaran Apr 1, 2024
8f67bc9
fix(pose_initializer): added "user_defined_initial_pose" to dummy loc…
SakodaShintaro Apr 2, 2024
6e6e601
feat(static_centerline_optimizer): static centerline optimizer with G…
takayuki5168 Apr 2, 2024
8948859
feat(multi_object_tracker): debug timer to work with reduced replay r…
technolojin Apr 2, 2024
1aa5bb9
fix(object_recognition_utils): check polygon area on iou calculation …
technolojin Apr 2, 2024
5617f74
fix(predicted_path_checker): check if trajectory size (#6730)
beyzanurkaya Apr 2, 2024
f97cdc0
fix(static_centerline_optimizer): fix latlon values of generated LL2 …
takayuki5168 Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(mpc_lateral_controller): modify mathjax visualization error (aut…
…owarefoundation#6486)

* docs: modified mathjacs error

* test

* fix

* docs(mpc_lateral_controller): modify mathjax visualization error

Signed-off-by: root <root@DESKTOP-EP0T4HP>

---------

Signed-off-by: root <root@DESKTOP-EP0T4HP>
Co-authored-by: Daiki Sakanoue <sak@Daikis-MacBook-Air.local>
  • Loading branch information
sak-0822 and Daiki Sakanoue authored Mar 31, 2024
commit b5c29fc36bde2fe4d4a482d05b5fd375cfd00b96
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In the linear MPC formulation, all motion and constraint expressions are linear.

$$
\begin{gather}
x_{k+1}=Ax_{k}+Bu_{k}+w_{k}, y_{k}=Cx_{k} \tag{1} \\
x_{k+1}=Ax_{k}+Bu_{k}+w_{k}, y_{k}=Cx_{k} \tag{1} \\\
x_{k}\in R^{n},u_{k}\in R^{m},w_{k}\in R^{n}, y_{k}\in R^{l}, A\in R^{n\times n}, B\in R^{n\times m}, C\in R^{l \times n}
\end{gather}
$$
Expand All @@ -47,29 +47,29 @@ Then, when $k=2$, using also equation (2), we get

$$
\begin{align}
x_{2} & = Ax_{1} + Bu_{1} + w_{1} \\
& = A(Ax_{0} + Bu_{0} + w_{0}) + Bu_{1} + w_{1} \\
& = A^{2}x_{0} + ABu_{0} + Aw_{0} + Bu_{1} + w_{1} \\
& = A^{2}x_{0} + \begin{bmatrix}AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\ u_{1} \end{bmatrix} + \begin{bmatrix}A & I \end{bmatrix}\begin{bmatrix}w_{0}\\ w_{1} \end{bmatrix} \tag{3}
x_{2} & = Ax_{1} + Bu_{1} + w_{1} \\\
& = A(Ax_{0} + Bu_{0} + w_{0}) + Bu_{1} + w_{1} \\\
& = A^{2}x_{0} + ABu_{0} + Aw_{0} + Bu_{1} + w_{1} \\\
& = A^{2}x_{0} + \begin{bmatrix}AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\\ u_{1} \end{bmatrix} + \begin{bmatrix}A & I \end{bmatrix}\begin{bmatrix}w_{0}\\\ w_{1} \end{bmatrix} \tag{3}
\end{align}
$$

When $k=3$ , from equation (3)

$$
\begin{align}
x_{3} & = Ax_{2} + Bu_{2} + w_{2} \\
& = A(A^{2}x_{0} + ABu_{0} + Bu_{1} + Aw_{0} + w_{1} ) + Bu_{2} + w_{2} \\
& = A^{3}x_{0} + A^{2}Bu_{0} + ABu_{1} + A^{2}w_{0} + Aw_{1} + Bu_{2} + w_{2} \\
& = A^{3}x_{0} + \begin{bmatrix}A^{2}B & AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\ u_{1} \\ u_{2} \end{bmatrix} + \begin{bmatrix} A^{2} & A & I \end{bmatrix}\begin{bmatrix}w_{0}\\ w_{1} \\ w_{2} \end{bmatrix} \tag{4}
x_{3} & = Ax_{2} + Bu_{2} + w_{2} \\\
& = A(A^{2}x_{0} + ABu_{0} + Bu_{1} + Aw_{0} + w_{1} ) + Bu_{2} + w_{2} \\\
& = A^{3}x_{0} + A^{2}Bu_{0} + ABu_{1} + A^{2}w_{0} + Aw_{1} + Bu_{2} + w_{2} \\\
& = A^{3}x_{0} + \begin{bmatrix}A^{2}B & AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\\ u_{1} \\\ u_{2} \end{bmatrix} + \begin{bmatrix} A^{2} & A & I \end{bmatrix}\begin{bmatrix}w_{0}\\\ w_{1} \\\ w_{2} \end{bmatrix} \tag{4}
\end{align}
$$

If $k=n$ , then

$$
\begin{align}
x_{n} = A^{n}x_{0} + \begin{bmatrix}A^{n-1}B & A^{n-2}B & \dots & B \end{bmatrix}\begin{bmatrix}u_{0}\\ u_{1} \\ \vdots \\ u_{n-1} \end{bmatrix} + \begin{bmatrix} A^{n-1} & A^{n-2} & \dots & I \end{bmatrix}\begin{bmatrix}w_{0}\\ w_{1} \\ \vdots \\ w_{n-1} \end{bmatrix}
x_{n} = A^{n}x_{0} + \begin{bmatrix}A^{n-1}B & A^{n-2}B & \dots & B \end{bmatrix}\begin{bmatrix}u_{0}\\\ u_{1} \\\ \vdots \\\ u_{n-1} \end{bmatrix} + \begin{bmatrix} A^{n-1} & A^{n-2} & \dots & I \end{bmatrix}\begin{bmatrix}w_{0}\\\ w_{1} \\\ \vdots \\\ w_{n-1} \end{bmatrix}
\tag{5}
\end{align}
$$
Expand All @@ -78,8 +78,8 @@ Putting all of them together with (2) to (5) yields the following matrix equatio

$$
\begin{align}
\begin{bmatrix}x_{1}\\ x_{2} \\ x_{3} \\ \vdots \\ x_{n} \end{bmatrix} = \begin{bmatrix}A^{1}\\ A^{2} \\ A^{3} \\ \vdots \\ A^{n} \end{bmatrix}x_{0} + \begin{bmatrix}B & 0 & \dots & & 0 \\ AB & B & 0 & \dots & 0 \\ A^{2}B & AB & B & \dots & 0 \\ \vdots & \vdots & & & 0 \\ A^{n-1}B & A^{n-2}B & \dots & AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\ u_{1} \\ u_{2} \\ \vdots \\ u_{n-1} \end{bmatrix} \\ +
\begin{bmatrix}I & 0 & \dots & & 0 \\ A & I & 0 & \dots & 0 \\ A^{2} & A & I & \dots & 0 \\ \vdots & \vdots & & & 0 \\ A^{n-1} & A^{n-2} & \dots & A & I \end{bmatrix}\begin{bmatrix}w_{0}\\ w_{1} \\ w_{2} \\ \vdots \\ w_{n-1} \end{bmatrix}
\begin{bmatrix}x_{1}\\\ x_{2} \\\ x_{3} \\\ \vdots \\\ x_{n} \end{bmatrix} = \begin{bmatrix}A^{1}\\\ A^{2} \\\ A^{3} \\\ \vdots \\\ A^{n} \end{bmatrix}x_{0} + \begin{bmatrix}B & 0 & \dots & & 0 \\\ AB & B & 0 & \dots & 0 \\\ A^{2}B & AB & B & \dots & 0 \\\ \vdots & \vdots & & & 0 \\\ A^{n-1}B & A^{n-2}B & \dots & AB & B \end{bmatrix}\begin{bmatrix}u_{0}\\\ u_{1} \\\ u_{2} \\\ \vdots \\\ u_{n-1} \end{bmatrix} \\\ +
\begin{bmatrix}I & 0 & \dots & & 0 \\\ A & I & 0 & \dots & 0 \\\ A^{2} & A & I & \dots & 0 \\\ \vdots & \vdots & & & 0 \\\ A^{n-1} & A^{n-2} & \dots & A & I \end{bmatrix}\begin{bmatrix}w_{0}\\\ w_{1} \\\ w_{2} \\\ \vdots \\\ w_{n-1} \end{bmatrix}
\tag{6}
\end{align}
$$
Expand All @@ -88,7 +88,7 @@ In this case, the measurements (outputs) become; $y_{k}=Cx_{k}$, so

$$
\begin{align}
\begin{bmatrix}y_{1}\\ y_{2} \\ y_{3} \\ \vdots \\ y_{n} \end{bmatrix} = \begin{bmatrix}C & 0 & \dots & & 0 \\ 0 & C & 0 & \dots & 0 \\ 0 & 0 & C & \dots & 0 \\ \vdots & & & \ddots & 0 \\ 0 & \dots & 0 & 0 & C \end{bmatrix}\begin{bmatrix}x_{1}\\ x_{2} \\ x_{3} \\ \vdots \\ x_{n} \end{bmatrix} \tag{7}
\begin{bmatrix}y_{1}\\\ y_{2} \\\ y_{3} \\\ \vdots \\\ y_{n} \end{bmatrix} = \begin{bmatrix}C & 0 & \dots & & 0 \\\ 0 & C & 0 & \dots & 0 \\\ 0 & 0 & C & \dots & 0 \\\ \vdots & & & \ddots & 0 \\\ 0 & \dots & 0 & 0 & C \end{bmatrix}\begin{bmatrix}x_{1}\\\ x_{2} \\\ x_{3} \\\ \vdots \\\ x_{n} \end{bmatrix} \tag{7}
\end{align}
$$

Expand Down Expand Up @@ -124,8 +124,8 @@ Substituting equation (8) into equation (9) and tidying up the equation for $U$.

$$
\begin{align}
J(U) &= (H(Fx_{0}+GU+SW)-Y_{ref})^{T}Q(H(Fx_{0}+GU+SW)-Y_{ref})+(U-U_{ref})^{T}R(U-U_{ref}) \\
& =U^{T}(G^{T}H^{T}QHG+R)U+2\left\{(H(Fx_{0}+SW)-Y_{ref})^{T}QHG-U_{ref}^{T}R\right\}U +(\rm{constant}) \tag{10}
J(U) &= (H(Fx_{0}+GU+SW)-Y_{ref})^{T}Q(H(Fx_{0}+GU+SW)-Y_{ref})+(U-U_{ref})^{T}R(U-U_{ref}) \\\
& =U^{T}(G^{T}H^{T}QHG+R)U+2\lbrace\{(H(Fx_{0}+SW)-Y_{ref})^{T}QHG-U_{ref}^{T}R\rbrace\}U +(\rm{constant}) \tag{10}
\end{align}
$$

Expand All @@ -141,9 +141,9 @@ For a nonlinear kinematic vehicle model, the discrete-time update equations are

$$
\begin{align}
x_{k+1} &= x_{k} + v\cos\theta_{k} \text{d}t \\
y_{k+1} &= y_{k} + v\sin\theta_{k} \text{d}t \\
\theta_{k+1} &= \theta_{k} + \frac{v\tan\delta_{k}}{L} \text{d}t \tag{11} \\
x_{k+1} &= x_{k} + v\cos\theta_{k} \text{d}t \\\
y_{k+1} &= y_{k} + v\sin\theta_{k} \text{d}t \\\
\theta_{k+1} &= \theta_{k} + \frac{v\tan\delta_{k}}{L} \text{d}t \tag{11} \\\
\delta_{k+1} &= \delta_{k} - \tau^{-1}\left(\delta_{k}-\delta_{des}\right)\text{d}t
\end{align}
$$
Expand Down Expand Up @@ -171,9 +171,9 @@ We make small angle assumptions for the following derivations of linear equation

$$
\begin{align}
y_{k+1} &= y_{k} + v\sin\theta_{k} \text{d}t \\
y_{k+1} &= y_{k} + v\sin\theta_{k} \text{d}t \\\
\theta_{k+1} &= \theta_{k} + \frac{v\tan\delta_{k}}{L} \text{d}t - \kappa_{r}v\cos\theta_{k}\text{d}t
\tag{12} \\
\tag{12} \\\
\delta_{k+1} &= \delta_{k} - \tau^{-1}\left(\delta_{k}-\delta_{des}\right)\text{d}t
\end{align}
$$
Expand Down Expand Up @@ -202,9 +202,9 @@ Substituting this equation into equation (12), and approximate $\Delta\delta$ to

$$
\begin{align}
\tan\delta &\simeq \tan\delta_{r} + \frac{\text{d}\tan\delta}{\text{d}\delta} \Biggm|_{\delta=\delta_{r}}\Delta\delta \\
&= \tan \delta_{r} + \frac{1}{\cos^{2}\delta_{r}}\Delta\delta \\
&= \tan \delta_{r} + \frac{1}{\cos^{2}\delta_{r}}\left(\delta-\delta_{r}\right) \\
\tan\delta &\simeq \tan\delta_{r} + \frac{\text{d}\tan\delta}{\text{d}\delta} \Biggm|_{\delta=\delta_{r}}\Delta\delta \\\
&= \tan \delta_{r} + \frac{1}{\cos^{2}\delta_{r}}\Delta\delta \\\
&= \tan \delta_{r} + \frac{1}{\cos^{2}\delta_{r}}\left(\delta-\delta_{r}\right) \\\
&= \tan \delta_{r} - \frac{\delta_{r}}{\cos^{2}\delta_{r}} + \frac{1}{\cos^{2}\delta_{r}}\delta
\end{align}
$$
Expand All @@ -213,9 +213,9 @@ Using this, $\theta_{k+1}$ can be expressed

$$
\begin{align}
\theta_{k+1} &= \theta_{k} + \frac{v\tan\delta_{k}}{L}\text{d}t - \kappa_{r}v\cos\delta_{k}\text{d}t \\
&\simeq \theta_{k} + \frac{v}{L}\text{d}t\left(\tan\delta_{r} - \frac{\delta_{r}}{\cos^{2}\delta_{r}} + \frac{1}{\cos^{2}\delta_{r}}\delta_{k} \right) - \kappa_{r}v\text{d}t \\
&= \theta_{k} + \frac{v}{L}\text{d}t\left(L\kappa_{r} - \frac{\delta_{r}}{\cos^{2}\delta_{r}} + \frac{1}{\cos^{2}\delta_{r}}\delta_{k} \right) - \kappa_{r}v\text{d}t \\
\theta_{k+1} &= \theta_{k} + \frac{v\tan\delta_{k}}{L}\text{d}t - \kappa_{r}v\cos\delta_{k}\text{d}t \\\
&\simeq \theta_{k} + \frac{v}{L}\text{d}t\left(\tan\delta_{r} - \frac{\delta_{r}}{\cos^{2}\delta_{r}} + \frac{1}{\cos^{2}\delta_{r}}\delta_{k} \right) - \kappa_{r}v\text{d}t \\\
&= \theta_{k} + \frac{v}{L}\text{d}t\left(L\kappa_{r} - \frac{\delta_{r}}{\cos^{2}\delta_{r}} + \frac{1}{\cos^{2}\delta_{r}}\delta_{k} \right) - \kappa_{r}v\text{d}t \\\
&= \theta_{k} + \frac{v}{L}\frac{\text{d}t}{\cos^{2}\delta_{r}}\delta_{k} - \frac{v}{L}\frac{\delta_{r}\text{d}t}{\cos^{2}\delta_{r}}
\end{align}
$$
Expand All @@ -224,7 +224,7 @@ Finally, the linearized time-varying model equation becomes;

$$
\begin{align}
\begin{bmatrix} y_{k+1} \\ \theta_{k+1} \\ \delta_{k+1} \end{bmatrix} = \begin{bmatrix} 1 & v\text{d}t & 0 \\ 0 & 1 & \frac{v}{L}\frac{\text{d}t}{\cos^{2}\delta_{r}} \\ 0 & 0 & 1 - \tau^{-1}\text{d}t \end{bmatrix} \begin{bmatrix} y_{k} \\ \theta_{k} \\ \delta_{k} \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \tau^{-1}\text{d}t \end{bmatrix}\delta_{des} + \begin{bmatrix} 0 \\ -\frac{v}{L}\frac{\delta_{r}\text{d}t}{\cos^{2}\delta_{r}} \\ 0 \end{bmatrix}
\begin{bmatrix} y_{k+1} \\\ \theta_{k+1} \\\ \delta_{k+1} \end{bmatrix} = \begin{bmatrix} 1 & v\text{d}t & 0 \\\ 0 & 1 & \frac{v}{L}\frac{\text{d}t}{\cos^{2}\delta_{r}} \\\ 0 & 0 & 1 - \tau^{-1}\text{d}t \end{bmatrix} \begin{bmatrix} y_{k} \\\ \theta_{k} \\\ \delta_{k} \end{bmatrix} + \begin{bmatrix} 0 \\\ 0 \\\ \tau^{-1}\text{d}t \end{bmatrix}\delta_{des} + \begin{bmatrix} 0 \\\ -\frac{v}{L}\frac{\delta_{r}\text{d}t}{\cos^{2}\delta_{r}} \\\ 0 \end{bmatrix}
\end{align}
$$

Expand All @@ -243,23 +243,23 @@ Using this equation, write down the update equation likewise (2) ~ (6)
$$
\begin{align}
\begin{bmatrix}
x_{1} \\ x_{2} \\ x_{3} \\ \vdots \\ x_{n}
x_{1} \\\ x_{2} \\\ x_{3} \\\ \vdots \\\ x_{n}
\end{bmatrix}
= \begin{bmatrix}
A_{1} \\ A_{1}A_{0} \\ A_{2}A_{1}A_{0} \\ \vdots \\ \prod_{i=0}^{n-1} A_{k}
A_{1} \\\ A_{1}A_{0} \\\ A_{2}A_{1}A_{0} \\\ \vdots \\\ \prod_{i=0}^{n-1} A_{k}
\end{bmatrix}
x_{0} +
\begin{bmatrix}
B_{0} & 0 & \dots & & 0 \\ A_{1}B_{0} & B_{1} & 0 & \dots & 0 \\ A_{2}A_{1}B_{0} & A_{2}B_{1} & B_{2} & \dots & 0 \\ \vdots & \vdots & &\ddots & 0 \\ \prod_{i=1}^{n-1} A_{k}B_{0} & \prod_{i=2}^{n-1} A_{k}B_{1} & \dots & A_{n-1}B_{n-1} & B_{n-1}
B_{0} & 0 & \dots & & 0 \\\ A_{1}B_{0} & B_{1} & 0 & \dots & 0 \\\ A_{2}A_{1}B_{0} & A_{2}B_{1} & B_{2} & \dots & 0 \\\ \vdots & \vdots & &\ddots & 0 \\\ \prod_{i=1}^{n-1} A_{k}B_{0} & \prod_{i=2}^{n-1} A_{k}B_{1} & \dots & A_{n-1}B_{n-1} & B_{n-1}
\end{bmatrix}
\begin{bmatrix}
u_{0} \\ u_{1} \\ u_{2} \\ \vdots \\ u_{n-1}
u_{0} \\\ u_{1} \\\ u_{2} \\\ \vdots \\\ u_{n-1}
\end{bmatrix} +
\begin{bmatrix}
I & 0 & \dots & & 0 \\ A_{1} & I & 0 & \dots & 0 \\ A_{2}A_{1} & A_{2} & I & \dots & 0 \\ \vdots & \vdots & &\ddots & 0 \\ \prod_{i=1}^{n-1} A_{k} & \prod_{i=2}^{n-1} A_{k} & \dots & A_{n-1} & I
I & 0 & \dots & & 0 \\\ A_{1} & I & 0 & \dots & 0 \\\ A_{2}A_{1} & A_{2} & I & \dots & 0 \\\ \vdots & \vdots & &\ddots & 0 \\\ \prod_{i=1}^{n-1} A_{k} & \prod_{i=2}^{n-1} A_{k} & \dots & A_{n-1} & I
\end{bmatrix}
\begin{bmatrix}
w_{0} \\ w_{1} \\ w_{2} \\ \vdots \\ w_{n-1}
w_{0} \\\ w_{1} \\\ w_{2} \\\ \vdots \\\ w_{n-1}
\end{bmatrix}
\end{align}
$$
Expand All @@ -280,7 +280,7 @@ As an example, let's determine the weight matrix $Q_{1}$ of the evaluation funct

$$
\begin{align}
Q_{1} = \begin{bmatrix} q_{e} & 0 & 0 & 0 & 0& 0 \\ 0 & q_{\theta} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & q_{e} & 0 & 0 \\ 0 & 0 & 0 & 0 & q_{\theta} & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}
Q_{1} = \begin{bmatrix} q_{e} & 0 & 0 & 0 & 0& 0 \\\ 0 & q_{\theta} & 0 & 0 & 0 & 0 \\\ 0 & 0 & 0 & 0 & 0 & 0 \\\ 0 & 0 & 0 & q_{e} & 0 & 0 \\\ 0 & 0 & 0 & 0 & q_{\theta} & 0 \\\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}
\end{align}
$$

Expand All @@ -302,7 +302,7 @@ For instance, write $Q_{2}$ as follows for the $n=2$ system.

$$
\begin{align}
Q_{2} = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & q_{d} & 0 & 0 & -q_{d} \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & -q_{d} & 0 & 0 & q_{d} \end{bmatrix}
Q_{2} = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 \\\ 0 & 0 & 0 & 0 & 0 & 0 \\\ 0 & 0 & q_{d} & 0 & 0 & -q_{d} \\\ 0 & 0 & 0 & 0 & 0 & 0 \\\ 0 & 0 & 0 & 0 & 0 & 0 \\\ 0 & 0 & -q_{d} & 0 & 0 & q_{d} \end{bmatrix}
\end{align}
$$

Expand Down Expand Up @@ -340,35 +340,35 @@ We can also put constraints on the input deviations. As the derivative of steeri

$$
\begin{align}
\dot{u}_{min} < \dot{u} < \dot{u}_{max}
\dot u_{min} < \dot u < \dot u_{max}
\end{align}
$$

We discretize $\dot{u}$ as $\left(u_{k} - u_{k-1}\right)/\text{d}t$ and multiply both sides by dt, and the resulting constraint become linear and convex

$$
\begin{align}
\dot{u}_{min}\text{d}t < u_{k} - u_{k-1} < \dot{u}_{max}\text{d}t
\dot u_{min}\text{d}t < u_{k} - u_{k-1} < \dot u_{max}\text{d}t
\end{align}
$$

Along the prediction or control horizon, i.e for setting $n=3$

$$
\begin{align}
\dot{u}_{min}\text{d}t < u_{1} - u_{0} < \dot{u}_{max}\text{d}t \\
\dot{u}_{min}\text{d}t < u_{2} - u_{1} < \dot{u}_{max}\text{d}t
\dot u_{min}\text{d}t < u_{1} - u_{0} < \dot u_{max}\text{d}t \\\
\dot u_{min}\text{d}t < u_{2} - u_{1} < \dot u_{max}\text{d}t
\end{align}
$$

and aligning the inequality signs

$$
\begin{align}
u_{1} - u_{0} &< \dot{u}_{max}\text{d}t \\ +
u_{1} + u_{0} &< -\dot{u}_{min}\text{d}t \\
u_{2} - u_{1} &< \dot{u}_{max}\text{d}t \\ +
u_{2} + u_{1} &< - \dot{u}_{min}\text{d}t
u_{1} - u_{0} &< \dot u_{max}\text{d}t \\\ +
u_{1} + u_{0} &< -\dot u_{min}\text{d}t \\\
u_{2} - u_{1} &< \dot u_{max}\text{d}t \\\ +
u_{2} + u_{1} &< - \dot u_{min}\text{d}t
\end{align}
$$

Expand All @@ -384,6 +384,6 @@ Thus, putting this inequality to fit the form above, the constraints against $\d

$$
\begin{align}
\begin{bmatrix} -1 & 1 & 0 \\ 1 & -1 & 0 \\ 0 & -1 & 1 \\ 0 & 1 & -1 \end{bmatrix}\begin{bmatrix} u_{0} \\ u_{1} \\ u_{2} \end{bmatrix} \leq \begin{bmatrix} \dot{u}_{max}\text{d}t \\ -\dot{u}_{min}\text{d}t \\ \dot{u}_{max}\text{d}t \\ -\dot{u}_{min}\text{d}t \end{bmatrix}
\begin{bmatrix} -1 & 1 & 0 \\\ 1 & -1 & 0 \\\ 0 & -1 & 1 \\\ 0 & 1 & -1 \end{bmatrix}\begin{bmatrix} u_{0} \\\ u_{1} \\\ u_{2} \end{bmatrix} \leq \begin{bmatrix} \dot u_{max}\text{d}t \\\ -\dot u_{min}\text{d}t \\\ \dot u_{max}\text{d}t \\\ -\dot u_{min}\text{d}t \end{bmatrix}
\end{align}
$$