Fix markdown equations syntax (#535)

This commit is contained in:
Trung Kien
2021-08-29 11:49:15 +07:00
committed by GitHub
parent 4aae5f35c5
commit 06b2450591
2 changed files with 128 additions and 898 deletions

View File

@@ -2,16 +2,15 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Model predictive speed and steering control\n",
"\n",
"![Model predictive speed and steering control](https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathTracking/model_predictive_speed_and_steer_control/animation.gif?raw=true)\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"\n",
@@ -26,11 +25,11 @@
"This code uses cvxpy as an optimization modeling tool.\n",
"\n",
"- [Welcome to CVXPY 1\\.0 — CVXPY 1\\.0\\.6 documentation](http://www.cvxpy.org/)"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### MPC modeling\n",
"\n",
@@ -46,22 +45,22 @@
"\n",
"a: accellation, δ: steering angle\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The MPC cotroller minimize this cost function for path tracking:\n",
"\n",
"$$min\\ Q_f(z_{T,ref}-z_{T})^2+Q\\Sigma({z_{t,ref}-z_{t}})^2+R\\Sigma{u_t}^2+R_d\\Sigma({u_{t+1}-u_{t}})^2$$\n",
"\n",
"z_ref come from target path and speed."
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"subject to:\n",
"\n",
@@ -89,20 +88,20 @@
"\n",
"$$u_{min} < u_t < u_{max}$$\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is implemented at \n",
"\n",
"[PythonRobotics/model\\_predictive\\_speed\\_and\\_steer\\_control\\.py at f51a73f47cb922a12659f8ce2d544c347a2a8156 · AtsushiSakai/PythonRobotics](https://github.com/AtsushiSakai/PythonRobotics/blob/f51a73f47cb922a12659f8ce2d544c347a2a8156/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py#L247-L301)"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Vehicle model linearization\n",
"\n",
@@ -120,21 +119,21 @@
"\n",
"\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"ODE is\n",
"\n",
"$$ \\dot{z} =\\frac{\\partial }{\\partial z} z = f(z, u) = A'z+B'u$$\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"where\n",
"\n",
@@ -168,11 +167,11 @@
"\\end{bmatrix}\n",
"\\end{equation*}$\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$\\begin{equation*}\n",
"B' =\n",
@@ -196,11 +195,11 @@
"\\end{bmatrix}\n",
"\\end{equation*}$\n",
"\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can get a discrete-time mode with Forward Euler Discretization with sampling time dt.\n",
"\n",
@@ -210,11 +209,11 @@
"$$z_{k+1}=z_k+(f(\\bar{z},\\bar{u})+A'z_k+B'u_k-A'\\bar{z}-B'\\bar{u})dt$$\n",
"\n",
"$$z_{k+1}=(I + dtA')z_k+(dtB')u_k + (f(\\bar{z},\\bar{u})-A'\\bar{z}-B'\\bar{u})dt$$\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"So, \n",
"\n",
@@ -222,7 +221,7 @@
"\n",
"where,\n",
"\n",
"$\\begin{equation*}\n",
"$$\\begin{equation*}\n",
"A = (I + dtA')\\\\\n",
"=\n",
"\\begin{bmatrix} \n",
@@ -231,14 +230,14 @@
"0 & 0 & 1 & 0 \\\\\n",
"0 & 0 &\\frac{tan(\\bar{\\delta})}{L}dt & 1 \\\\\n",
"\\end{bmatrix}\n",
"\\end{equation*}$"
]
"\\end{equation*}$$"
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$\\begin{equation*}\n",
"$$\\begin{equation*}\n",
"B = dtB'\\\\\n",
"=\n",
"\\begin{bmatrix} \n",
@@ -247,14 +246,14 @@
"dt & 0 \\\\\n",
"0 & \\frac{\\bar{v}}{Lcos^2(\\bar{\\delta})}dt \\\\\n",
"\\end{bmatrix}\n",
"\\end{equation*}$"
]
"\\end{equation*}$$"
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"$\\begin{equation*}\n",
"$$\\begin{equation*}\n",
"C = (f(\\bar{z},\\bar{u})-A'\\bar{z}-B'\\bar{u})dt\\\\\n",
"= dt(\n",
"\\begin{bmatrix} \n",
@@ -285,28 +284,29 @@
"0\\\\\n",
"-\\frac{\\bar{v}\\bar{\\delta}}{Lcos^2(\\bar{\\delta})}dt\\\\\n",
"\\end{bmatrix}\n",
"\\end{equation*}$"
]
"\\end{equation*}$$"
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This equation is implemented at \n",
"\n",
"[PythonRobotics/model\\_predictive\\_speed\\_and\\_steer\\_control\\.py at eb6d1cbe6fc90c7be9210bf153b3a04f177cc138 · AtsushiSakai/PythonRobotics](https://github.com/AtsushiSakai/PythonRobotics/blob/eb6d1cbe6fc90c7be9210bf153b3a04f177cc138/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py#L80-L102)\n"
]
],
"metadata": {}
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Reference\n",
"\n",
"- [Vehicle Dynamics and Control \\| Rajesh Rajamani \\| Springer](http://www.springer.com/us/book/9781461414322)\n",
"\n",
"- [MPC Course Material \\- MPC Lab @ UC\\-Berkeley](http://www.mpc.berkeley.edu/mpc-course-material)\n"
]
],
"metadata": {}
}
],
"metadata": {
@@ -330,4 +330,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}