Skip to content

Commit 3cade9c

Browse files
committed
release notebook
1 parent f51a73f commit 3cade9c

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

PathTracking/model_predictive_speed_and_steer_control/notebook.ipynb

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"source": [
77
"# Model predictive speed and steering control\n",
88
"\n",
9+
"code:\n",
10+
"\n",
911
"https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py\n",
1012
"\n",
1113
"This is a path tracking simulation using model predictive control (MPC)\n",
@@ -17,7 +19,52 @@
1719
"cell_type": "markdown",
1820
"metadata": {},
1921
"source": [
20-
"# MPC modeling"
22+
"# MPC modeling\n",
23+
"\n",
24+
"State vector is:\n",
25+
"$$ z = [x, y, v,\\phi]$$ x: x-position, y:y-position, v:velocity, φ: yaw angle\n",
26+
"\n",
27+
"Input vector is:\n",
28+
"$$ u = [a, \\delta]$$ a: accellation, δ: steering angle\n",
29+
"\n"
30+
]
31+
},
32+
{
33+
"cell_type": "markdown",
34+
"metadata": {},
35+
"source": [
36+
"The MPC cotroller minimize this cost function for path tracking:\n",
37+
"\n",
38+
"$$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",
39+
"\n",
40+
"z_ref come from target path and speed."
41+
]
42+
},
43+
{
44+
"cell_type": "markdown",
45+
"metadata": {},
46+
"source": [
47+
"subject to:\n",
48+
"- Linearlied vehicle model\n",
49+
"$$z_{t+1}=Az_t+Bu+C$$\n",
50+
"- Maximum steering speed\n",
51+
"$$|u_{t+1}-u_{t}|<du_{max}$$\n",
52+
"- Maximum steering angle\n",
53+
"$$|u_{t}|<u_{max}$$\n",
54+
"- Initial state\n",
55+
"$$z_0 = z_{0,ob}$$\n",
56+
"- Maximum and minimum speed\n",
57+
"$$v_{min} < v_t < v_{max}$$\n",
58+
"- Maximum and minimum input\n",
59+
"$$u_{min} < u_t < u_{max}$$\n"
60+
]
61+
},
62+
{
63+
"cell_type": "markdown",
64+
"metadata": {},
65+
"source": [
66+
"This is implemented at \n",
67+
"https://github.com/AtsushiSakai/PythonRobotics/blob/f51a73f47cb922a12659f8ce2d544c347a2a8156/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py#L247-L301"
2168
]
2269
},
2370
{
@@ -26,11 +73,7 @@
2673
"source": [
2774
"# Vehicle model linearization\n",
2875
"\n",
29-
"State vector is:\n",
30-
"$$ z = [x, y, v,\\phi]$$ x: x-position, y:y-position, v:velocity, φ: yaw angle\n",
3176
"\n",
32-
"Input vector is:\n",
33-
"$$ u = [a, \\delta]$$ a: accellation, δ: steering angle\n",
3477
"\n",
3578
"Vehicle model is \n",
3679
"$$ \\dot{x} = vcos(\\phi)$$\n",

0 commit comments

Comments
 (0)