Repository navigation
Fix quintic trajectory samples extending beyond terminal time - #1481
Open
huxiaoyi-ovo wants to merge 3 commits into
Open
huxiaoyi-ovo wants to merge 3 commits into
huxiaoyi-ovo wants to merge 3 commits into
Conversation
huxiaoyi-ovo
marked this pull request as ready for review
October 29, 2026 06:16
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The quintic planner samples with
np.arange(0.0, T + dt, dt). Whendtdoes not divideT, the final sample is past the polynomial's terminal time, so the returned trajectory can overshoot its specified final position even though the polynomial itself satisfies the endpoint conditions.For example, with
T=5anddt=0.7, the last sample ist=5.6. A zero-velocity, zero-acceleration quintic fromx=0tox=10evaluates to aboutx=10.2054at that time instead of the intendedx=10.This patch samples only times below
Tand then includesTexactly once. It keeps the existing sampling interval, avoids extrapolation, and does not change polynomial coefficients or trajectory search logic.Regression tests
Parameterized tests cover:
dt=0.5: divides the candidate duration exactly.dt=0.7: previously sampled beyond the endpoint.dt=6.0: longer than the candidate duration.Each checks strictly increasing timestamps, no samples after
T, consistent output lengths, and the requested terminal position.Scope: two files, no new dependencies. Full cross-platform checks were started on fork CI PR #4; they are not claimed as passed yet.
AI assistance: ChatGPT (OpenAI GPT-6) helped identify the edge case, prepare the fix, and add regression tests.