Skip to content

Fix scalar solver handling in the Clothoid path planner - #1458

Draft
Afloat16 wants to merge 1 commit into
AtsushiSakai:masterfrom
Afloat16:fix/clothoid-scalar-root
Draft

Afloat16 wants to merge 1 commit into
AtsushiSakai:masterfrom
Afloat16:fix/clothoid-scalar-root

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 9, 2026

Copy link
Copy Markdown

What does this implement/fix?

The Clothoid planner passes fsolve's one-element input array directly into scalar quadrature and trigonometry, then retains the solver's array result. With the project's current NumPy pins, valid paths return None after a scalar-conversion error. The existing animation-free smoke test still passes because it does not inspect the generated paths.

Extract the scalar fitting parameter at the solver boundary. Read the solver's diagnostics and require a finite root and residual. A stalled result is accepted only when the dimensionless residual is within double-precision roundoff; this preserves analytic circular paths whose exact root is zero under the existing warnings-as-errors test policy. Larger failed-fit residuals remain errors.

The initial guess, fitting equations, public path inputs, units and point-list contract are unchanged. The existing official RST equations and explanation remain correct, so this code-only correction adds no documentation, figure or animation change.

Validation

  • Exact base: cdd0cc888802b584c2d654ca85e3c5460973487d.
  • The identical new tests on the base: 16 failed, 11 passed. With this patch: 27 passed under -Werror.
  • Independent straight-line and signed circular-arc coordinates cover scale, rotation and translation. Public multi-orientation generation and the complete 75-orientation default grid produce finite complete paths with correct endpoints.
  • Nonfinite start/goal orientations and a zero-length segment remain rejected. Scalar integration and circular-parameter controls remain correct.
  • bash runtests.sh: 182 passed on Linux/Python 3.14.8 with the exact requirements, including the configured diff-Ruff and mypy checks. No skips or deselections were added.
  • Strict Sphinx HTML build: passed. The documented Clothoid page has unchanged text, equations, links, images and API content; the only generated difference is a cache-version query for an identical existing CSS asset. Browser-rendered HTML is not claimed.
  • Other operating systems and Python versions were not tested locally. No physical robot, animation export or performance claim is made.

AI assistance: prepared with OpenAI Codex (gpt-6.1-sol). The native validation above was executed.

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