Skip to content

fix(planning): return Dubins distances in workspace units - #1009

Open
Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/dubins-physical-lengths-20261129
Open

Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/dubins-physical-lengths-20261129

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Summary

Dubins planning solves its segments with a unit turning radius, but it returns those normalized lengths directly and passes the public sample spacing into that normalized coordinate system. A 10-unit straight path therefore reports length 5 at curvature 0.5 and length 20 at curvature 2. With stepsize=0.125, its ordinary samples are 0.25 or 0.0625 units apart respectively.

Convert the requested spacing into normalized units before sampling and convert segment lengths and total cost back afterwards, matching the existing Reeds–Shepp convention. The path geometry and candidate selection are unchanged. At curvature other than one, returned lengths and sample density change to their documented physical units. This also corrects the lengths consumed by RRT's edge-cost and connection-length checks.

Contribution owner: @Afloat16. Codex (GPT-6 Astra Pro) assisted with the implementation and regression tests.

Related issue

Newly reproduced problem. Reviewed all 59 prior PRs by @Afloat16 and all five upstream Dubins PRs plus the related issue. #798 preserves zero-coordinate endpoints; it does not convert distance units.

Validation

Base 5aef407ae89cea7dd7edf378dee0757e697cd3bb; Linux x86-64, Python 3.12.14, NumPy 2.5.5, SpatialMath 1.1.19. Tests import the checkout with PYTHONPATH=src:rtb-data and use MPLBACKEND=Agg.

  • New tests before the production change: 10 failed, 5 passed.
  • python -m pytest tests/test_dubins_units.py tests/test_planner_course_endpoints.py tests/test_graph_planners.py tests/test_mobile.py -q: 202 passed, 6 skipped, 13 subtests passed.
  • Regressions verify known straight and straight-plus-quarter-circle lengths, rotated/translated frames, curved and straight sampling intervals, and the unchanged unit-curvature control. Existing RRT tests also pass.
  • Ruff format and git diff --check: passed. Ruff lint reports the same four pre-existing source diagnostics as the base; the new test file is clean.
  • The complete repository test matrix, type checks and documentation build were not run locally.

Checklist

  • Checked existing PRs and issues for the same problem; this does not claim an existing issue.
  • Conventional Commit title and focused change.
  • Added typed regressions and clarified the units in the docstring.
  • Targeted tests pass with the exact scope above.
  • Numerical and public behaviour changes are stated above.
  • Allow edits by maintainers is enabled.
  • No project-specific data or notebooks are included.

Co-Authored-By: Codex (GPT-6 Astra Pro) noreply@openai.com

Co-Authored-By: Codex (GPT-6 Astra Pro) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
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