Skip to content

Commit 5e3d796

Browse files
committed
small bugs on linear discrete model of MPC
1 parent 7bf93bd commit 5e3d796

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def get_linear_model_matrix(v, phi, delta):
9797
C = np.zeros(NX)
9898
C[0] = DT * v * math.sin(phi) * phi
9999
C[1] = - DT * v * math.cos(phi) * phi
100-
C[3] = v * delta / (WB * math.cos(delta) ** 2)
100+
C[3] = - v * delta / (WB * math.cos(delta) ** 2)
101101

102102
return A, B, C
103103

PathTracking/model_predictive_speed_and_steer_control/notebook.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@
175175
"$$z_{k+1}=z_k+f(z_k,u_k)dt$$\n",
176176
"\n",
177177
"Using first degree Tayer expantion around zbar and ubar\n",
178-
"$$z_{k+1}=z_k+(f(\\bar{z},\\bar{u})+A'z_k+B'u_k)dt$$\n",
178+
"$$z_{k+1}=z_k+(f(\\bar{z},\\bar{u})+A'z_k+B'u_k-A'\\bar{z}-B'\\bar{u})dt$$\n",
179179
"\n",
180-
"$$z_{k+1}=(I + dtA')z_k+(dtB')u_k + (f(\\bar{z},\\bar{u})-A'\\bar{z}+B'\\bar{u})dt$$\n"
180+
"$$z_{k+1}=(I + dtA')z_k+(dtB')u_k + (f(\\bar{z},\\bar{u})-A'\\bar{z}-B'\\bar{u})dt$$\n"
181181
]
182182
},
183183
{
@@ -251,7 +251,7 @@
251251
"\\bar{v}sin(\\bar{\\phi})\\bar{\\phi}dt\\\\\n",
252252
"-\\bar{v}cos(\\bar{\\phi})\\bar{\\phi}dt\\\\\n",
253253
"0\\\\\n",
254-
"\\frac{\\bar{v}\\bar{\\delta}}{Lcos^2(\\bar{\\delta})}dt\\\\\n",
254+
"-\\frac{\\bar{v}\\bar{\\delta}}{Lcos^2(\\bar{\\delta})}dt\\\\\n",
255255
"\\end{bmatrix}\n",
256256
"\\end{equation*}"
257257
]
@@ -279,7 +279,7 @@
279279
],
280280
"metadata": {
281281
"kernelspec": {
282-
"display_name": "Python 3",
282+
"display_name": "Python [default]",
283283
"language": "python",
284284
"name": "python3"
285285
},
@@ -293,7 +293,7 @@
293293
"name": "python",
294294
"nbconvert_exporter": "python",
295295
"pygments_lexer": "ipython3",
296-
"version": "3.6.6"
296+
"version": "3.6.4"
297297
}
298298
},
299299
"nbformat": 4,

0 commit comments

Comments
 (0)