fixed the scope of range function#1276
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the scope of the range function in the model predictive speed and steer control algorithm to address issue #1263. The change modifies the loop iteration to start from index 1 instead of 0.
- Updated the range function in
calc_ref_trajectoryto start from 1 instead of 0
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| travel = 0.0 | ||
|
|
||
| for i in range(T + 1): | ||
| for i in range(1, T + 1): |
There was a problem hiding this comment.
Changing the range from range(T + 1) to range(1, T + 1) reduces the number of iterations from T+1 to T, which may affect the trajectory calculation. Verify that this change doesn't break the algorithm's expected behavior, as the loop now skips the initial state (i=0) and may not compute the full prediction horizon.
|
@codex please review this PR. |
|
Hey @AtsushiSakai, any updates on this? |
|
@sanskarmodi8 Thank you!! |
This PR fixes the scope of range function as described in issue #1263