Skip to content

Fix Voronoi roadmap collision checks across the full edge - #1487

Open
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/voronoi-continuous-edge-collision
Open

huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/voronoi-continuous-edge-collision

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Summary

The Voronoi roadmap's is_collision() samples a candidate edge at intervals equal to the robot radius. An obstacle can intrude into the edge's swept clearance disk between sample points, while the function reports no collision.

For an edge from (0, 0) to (1, 0), robot radius 1, and obstacle at (0.5, 0.95), both endpoints are approximately 1.074 away from the obstacle, but the segment clearance is 0.95. The old sampling returns False despite the collision.

The same logic divides by the radius, which raises ZeroDivisionError for a point robot (rr=0).

Fix

  • Use the existing cKDTree to shortlist obstacles in a bounding ball around the edge.
  • Compute the exact minimum obstacle-to-line-segment distance, including projected points and endpoints.
  • Support zero-radius and zero-length edges without dividing by the radius.
  • Preserve the existing maximum edge length, API, and roadmap generation behavior.

Regression tests

Added focused tests for between-sample collisions, collision-free clearance, point robots with obstacles on/off the segment, zero-length edges, endpoint clearance, and the existing maximum edge length limit.

Scope: Voronoi roadmap implementation plus one focused test module; no new dependencies.

Related: #1482 fixes the corresponding sampling bug in the separate Probabilistic Roadmap implementation; this PR addresses PathPlanning/VoronoiRoadMap specifically.

Independent cross-platform CI validation has been started.

AI disclosure: ChatGPT assisted with code analysis and preparing the fix and tests.

@huxiaoyi-ovo
huxiaoyi-ovo marked this pull request as ready for review October 30, 2026 04:42

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