AtsushiSakai/PythonRobotics

need to correct the scope of the range function at line 321 in model_predictive_speed_and_steer_control.py

WordOfGod opened this issue · 2 comments

I apprecitated your work. It is a very good example code. I'd like to report a small bug.

Describe the bug
A clear and concise description of what the bug is.

need to correct the scope of the range function at line 321 in model_predictive_speed_and_steer_control.py
As-Is : range(T + 1)
To-Be : range(1, T + 1)

Expected behavior
A clear and concise description of what you expected to happen.

Issue : values are assigned to xref[0 , 0], ..., xref[3 , 0] above the for-loop. However, the range starts from index 0. The previously assigned value of xref[ : , 0] are overwrited with the values of the next time point.

tracking may fail in some cases.

Screenshots
If applicable, add screenshots to help explain your problem.

I have attached the result screens before and after the correction.

before
Image

after
Image

Desktop (please complete the following information):

  • Python version (This repo only supports Python 3.9.x or higher).
  • Each library version
  • OS version

PR is welcome.

Hey @WordOfGod, I would like to open a PR for the same. So can you confirm if you are working on it?