|
4 | 4 | "cell_type": "markdown", |
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | | - "# Model predictive speed and steering control\n", |
| 7 | + "## Model predictive speed and steering control\n", |
| 8 | + "\n", |
| 9 | + "\n" |
| 10 | + ] |
| 11 | + }, |
| 12 | + { |
| 13 | + "cell_type": "markdown", |
| 14 | + "metadata": {}, |
| 15 | + "source": [ |
| 16 | + "\n", |
8 | 17 | "\n", |
9 | 18 | "code:\n", |
10 | 19 | "\n", |
11 | | - "https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py\n", |
| 20 | + "[PythonRobotics/model\\_predictive\\_speed\\_and\\_steer\\_control\\.py at master · AtsushiSakai/PythonRobotics](https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py)\n", |
12 | 21 | "\n", |
13 | 22 | "This is a path tracking simulation using model predictive control (MPC).\n", |
14 | 23 | "\n", |
|
23 | 32 | "cell_type": "markdown", |
24 | 33 | "metadata": {}, |
25 | 34 | "source": [ |
26 | | - "# MPC modeling\n", |
| 35 | + "### MPC modeling\n", |
27 | 36 | "\n", |
28 | 37 | "State vector is:\n", |
29 | 38 | "$$ z = [x, y, v,\\phi]$$ x: x-position, y:y-position, v:velocity, φ: yaw angle\n", |
|
49 | 58 | "metadata": {}, |
50 | 59 | "source": [ |
51 | 60 | "subject to:\n", |
| 61 | + "\n", |
52 | 62 | "- Linearlied vehicle model\n", |
| 63 | + "\n", |
53 | 64 | "$$z_{t+1}=Az_t+Bu+C$$\n", |
| 65 | + "\n", |
54 | 66 | "- Maximum steering speed\n", |
| 67 | + "\n", |
55 | 68 | "$$|u_{t+1}-u_{t}|<du_{max}$$\n", |
| 69 | + "\n", |
56 | 70 | "- Maximum steering angle\n", |
| 71 | + "\n", |
57 | 72 | "$$|u_{t}|<u_{max}$$\n", |
| 73 | + "\n", |
58 | 74 | "- Initial state\n", |
| 75 | + "\n", |
59 | 76 | "$$z_0 = z_{0,ob}$$\n", |
| 77 | + "\n", |
60 | 78 | "- Maximum and minimum speed\n", |
| 79 | + "\n", |
61 | 80 | "$$v_{min} < v_t < v_{max}$$\n", |
| 81 | + "\n", |
62 | 82 | "- Maximum and minimum input\n", |
63 | | - "$$u_{min} < u_t < u_{max}$$\n" |
| 83 | + "\n", |
| 84 | + "$$u_{min} < u_t < u_{max}$$\n", |
| 85 | + "\n" |
64 | 86 | ] |
65 | 87 | }, |
66 | 88 | { |
|
69 | 91 | "source": [ |
70 | 92 | "This is implemented at \n", |
71 | 93 | "\n", |
72 | | - "https://github.com/AtsushiSakai/PythonRobotics/blob/f51a73f47cb922a12659f8ce2d544c347a2a8156/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py#L247-L301" |
| 94 | + "[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)" |
73 | 95 | ] |
74 | 96 | }, |
75 | 97 | { |
76 | 98 | "cell_type": "markdown", |
77 | 99 | "metadata": {}, |
78 | 100 | "source": [ |
79 | | - "# Vehicle model linearization\n", |
| 101 | + "### Vehicle model linearization\n", |
80 | 102 | "\n", |
81 | 103 | "\n", |
82 | 104 | "\n", |
|
106 | 128 | "source": [ |
107 | 129 | "where\n", |
108 | 130 | "\n", |
109 | | - "\\begin{equation*}\n", |
| 131 | + "$$\\begin{equation*}\n", |
110 | 132 | "A' =\n", |
111 | 133 | "\\begin{bmatrix}\n", |
112 | 134 | "\\frac{\\partial }{\\partial x}vcos(\\phi) & \n", |
|
134 | 156 | "0 & 0 & 0 & 0 \\\\\n", |
135 | 157 | "0 & 0 &\\frac{tan(\\bar{\\delta})}{L} & 0 \\\\\n", |
136 | 158 | "\\end{bmatrix}\n", |
137 | | - "\\end{equation*}\n", |
| 159 | + "\\end{equation*}$$\n", |
138 | 160 | "\n" |
139 | 161 | ] |
140 | 162 | }, |
141 | 163 | { |
142 | 164 | "cell_type": "markdown", |
143 | 165 | "metadata": {}, |
144 | 166 | "source": [ |
145 | | - "\\begin{equation*}\n", |
| 167 | + "$$\\begin{equation*}\n", |
146 | 168 | "B' =\n", |
147 | 169 | "\\begin{bmatrix}\n", |
148 | 170 | "\\frac{\\partial }{\\partial a}vcos(\\phi) &\n", |
|
162 | 184 | "1 & 0 \\\\\n", |
163 | 185 | "0 & \\frac{\\bar{v}}{Lcos^2(\\bar{\\delta})} \\\\\n", |
164 | 186 | "\\end{bmatrix}\n", |
165 | | - "\\end{equation*}\n", |
| 187 | + "\\end{equation*}$$\n", |
166 | 188 | "\n" |
167 | 189 | ] |
168 | 190 | }, |
|
190 | 212 | "\n", |
191 | 213 | "where,\n", |
192 | 214 | "\n", |
193 | | - "\\begin{equation*}\n", |
| 215 | + "$$\\begin{equation*}\n", |
194 | 216 | "A = (I + dtA')\\\\\n", |
195 | 217 | "=\n", |
196 | 218 | "\\begin{bmatrix} \n", |
|
199 | 221 | "0 & 0 & 1 & 0 \\\\\n", |
200 | 222 | "0 & 0 &\\frac{tan(\\bar{\\delta})}{L}dt & 1 \\\\\n", |
201 | 223 | "\\end{bmatrix}\n", |
202 | | - "\\end{equation*}" |
| 224 | + "\\end{equation*}$$" |
203 | 225 | ] |
204 | 226 | }, |
205 | 227 | { |
206 | 228 | "cell_type": "markdown", |
207 | 229 | "metadata": {}, |
208 | 230 | "source": [ |
209 | | - "\\begin{equation*}\n", |
| 231 | + "$$\\begin{equation*}\n", |
210 | 232 | "B = dtB'\\\\\n", |
211 | 233 | "=\n", |
212 | 234 | "\\begin{bmatrix} \n", |
|
215 | 237 | "dt & 0 \\\\\n", |
216 | 238 | "0 & \\frac{\\bar{v}}{Lcos^2(\\bar{\\delta})}dt \\\\\n", |
217 | 239 | "\\end{bmatrix}\n", |
218 | | - "\\end{equation*}" |
| 240 | + "\\end{equation*}$$" |
219 | 241 | ] |
220 | 242 | }, |
221 | 243 | { |
222 | 244 | "cell_type": "markdown", |
223 | 245 | "metadata": {}, |
224 | 246 | "source": [ |
225 | | - "\\begin{equation*}\n", |
| 247 | + "$$\\begin{equation*}\n", |
226 | 248 | "C = (f(\\bar{z},\\bar{u})-A'\\bar{z}-B'\\bar{u})dt\\\\\n", |
227 | 249 | "= dt(\n", |
228 | 250 | "\\begin{bmatrix} \n", |
|
253 | 275 | "0\\\\\n", |
254 | 276 | "-\\frac{\\bar{v}\\bar{\\delta}}{Lcos^2(\\bar{\\delta})}dt\\\\\n", |
255 | 277 | "\\end{bmatrix}\n", |
256 | | - "\\end{equation*}" |
| 278 | + "\\end{equation*}$$" |
257 | 279 | ] |
258 | 280 | }, |
259 | 281 | { |
|
262 | 284 | "source": [ |
263 | 285 | "This equation is implemented at \n", |
264 | 286 | "\n", |
265 | | - "https://github.com/AtsushiSakai/PythonRobotics/blob/eb6d1cbe6fc90c7be9210bf153b3a04f177cc138/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py#L80-L102" |
| 287 | + "[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" |
266 | 288 | ] |
267 | 289 | }, |
268 | 290 | { |
269 | 291 | "cell_type": "markdown", |
270 | 292 | "metadata": {}, |
271 | 293 | "source": [ |
272 | | - "# Reference\n", |
| 294 | + "### Reference\n", |
273 | 295 | "\n", |
274 | 296 | "- [Vehicle Dynamics and Control \\| Rajesh Rajamani \\| Springer](http://www.springer.com/us/book/9781461414322)\n", |
275 | 297 | "\n", |
|
279 | 301 | ], |
280 | 302 | "metadata": { |
281 | 303 | "kernelspec": { |
282 | | - "display_name": "Python [default]", |
| 304 | + "display_name": "Python 3", |
283 | 305 | "language": "python", |
284 | 306 | "name": "python3" |
285 | 307 | }, |
|
293 | 315 | "name": "python", |
294 | 316 | "nbconvert_exporter": "python", |
295 | 317 | "pygments_lexer": "ipython3", |
296 | | - "version": "3.6.4" |
| 318 | + "version": "3.6.6" |
297 | 319 | } |
298 | 320 | }, |
299 | 321 | "nbformat": 4, |
|
0 commit comments