AtsushiSakai / PythonRobotics

Python sample codes for robotics algorithms.
https://atsushisakai.github.io/PythonRobotics/
Other
22.72k stars 6.47k forks source link

A little errata? #87

Closed soblin closed 6 years ago

soblin commented 6 years ago

I think the following line in PathTracking/model_predictive_speed_and_steer_control.py, line 91, A[3, 2] = DT * math.tan(delta)

should be

A[3, 2] = DT * math.tan(delta) / WB

instead, because this term is the derivative of

phi_next = phi + DT * math.tan(delta) * v / WB

with respcect to v. I tested the modified code, to have no problem.

BTW, could you teach me the meaning of matrix C in get_linear_model_matrix? I know the matrix A and B is the jacobian with respect to x and u, but what does C stand for?

AtsushiSakai commented 6 years ago

@soblin Thank you for bug report. Yes, you are right. I fixed it. Thank you.

what does C stand for? This is a constant term of linearized model. See This reference: MPC Course Material - MPC Lab @ UC-Berkeley http://www.mpc.berkeley.edu/mpc-course-material I'm trying to write a document about it later.

AtsushiSakai commented 6 years ago

@soblin Please check it.

https://github.com/AtsushiSakai/PythonRobotics/blob/master/PathTracking/model_predictive_speed_and_steer_control/notebook.ipynb