Skip to content

Fix target-point arclength interpolation in RRT path smoothing - #1469

Open
Superfast-BS wants to merge 1 commit into
AtsushiSakai:masterfrom
Superfast-BS:fix/path-smoothing-arclength
Open

Superfast-BS wants to merge 1 commit into
AtsushiSakai:masterfrom
Superfast-BS:fix/path-smoothing-arclength

Conversation

@Superfast-BS

Copy link
Copy Markdown

Problem

get_target_point([[0, 0], [10, 0], [10, 10]], 5) returns [5, 5, -1]: the interpolation uses the previous segment index and a ratio based on the remaining distance. The returned point is off the path. Endpoints and zero-length segments are affected as well.

Change

Walk segments using the remaining arclength, interpolate from the containing segment's start, and return that segment's index. Skip zero-length segments and retain the existing signature and shortcutting policy. This does not change collision sampling or add a new planner.

Validation

On Python 3.13.16 with the repository's current requirements and MPLBACKEND=Agg:

  • Six new parametrized/degenerate-segment cases fail before the fix.
  • pytest tests/test_rrt_with_pathsmoothing_radius.py -q: 7 passed after the fix, including the existing robot-radius safety test.
  • pytest tests -l -Werror --durations=0: 162 passed.
  • ruff check PathPlanning/RRT/rrt_with_pathsmoothing.py tests/test_rrt_with_pathsmoothing_radius.py: passed. The existing files are not formatter-clean; unrelated formatting is unchanged.

I maintain robotics code reuse tooling at Superfast Robotics. This focused correction and its regression tests were prepared with AI assistance and executed locally; no hardware verification is claimed.

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