Skip to content

fix: stop quintic paths at their terminal time - #909

Draft
Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/quintic-planner-terminal-sample-20261030
Draft

Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/quintic-planner-terminal-sample-20261030

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Summary

The mobile quintic planner samples through T + dt, so a step that does not divide the duration can evaluate beyond the terminal boundary and return a path past the requested goal.

Generate samples strictly below T and append T exactly once. Validate that dt is positive and finite before constructing the samples.

Numerical results and public behaviour: This changes numerical results for non-dividing or oversized time steps: the final sample now satisfies the requested terminal state instead of extrapolating beyond it. Non-positive or non-finite dt values raise ValueError. Public signatures are unchanged.

The implementation, regression tests and this description were prepared with ChatGPT (GPT-6 Astra Pro). Afloat16 requested the work and authorised submission; human review of this diff has not yet been confirmed, so this PR is a draft.

Related issue

Found through code inspection; no specific issue is linked. The current open PRs were checked for competing fixes.

Validation

The new regressions on the unchanged base report 6 failed, 11 passed (17 new regression cases on the unchanged base). With this change: 17 new regression cases pass; selected planner suites: 50 passed.

Non-dividing and oversized steps, terminal position/velocity/heading, exact-grid controls, and invalid time steps.

Tested on 9f282d8ff952a6ca95d340ae6a62b04e545a302f using Linux/Python 3.12.14 and the actual package with matching native extensions enabled.

PYTHONPATH=src python -m pytest -q tests/test_quintic_planner_terminal_sample.py tests/test_mobile_planners_a.py tests/test_planner_failure_contract.py

New test files pass Ruff lint and format checks; git diff --check passes. Existing production-file Ruff diagnostics are unchanged. Mypy reports the same existing Link.py:327 return-type error on the unchanged base and this branch (165 source files checked), with no additional diagnostics. It does not pass cleanly.

Focused suites only; the complete repository suite, docs build and cross-platform CI were not rerun.

Checklist

  • Issue claimed, if a corresponding issue is identified.
  • PR title follows Conventional Commits.
  • Full repository tests pass locally (focused results are reported above).
  • Added regression tests for this change.
  • The PR is limited to this fix and its tests.
  • Numerical and public behaviour changes are stated above.
  • The contributor has personally read, run and understood the diff.
  • Required CI checks pass.

Prepared with ChatGPT (GPT-6 Astra Pro).

Co-Authored-By: ChatGPT (GPT-6 Astra Pro)
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant