Repository navigation
Preserve distinct equidistant neighbors in Informed RRT* - #1484
Open
huxiaoyi-ovo wants to merge 4 commits into
Open
huxiaoyi-ovo wants to merge 4 commits into
huxiaoyi-ovo wants to merge 4 commits into
Conversation
huxiaoyi-ovo
marked this pull request as ready for review
October 29, 2026 09:00
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InformedRRTStar.find_near_nodes()builds squared distances and maps each matching distance back to an index usingd_list.index(distance). That lookup always returns the first occurrence.When two distinct nodes are equally far from a new sample, the method can return
[0, 0]instead of[0, 1]. The second candidate is never considered for parent selection or rewiring.A deterministic example has two obstacle-free parent candidates at
(-1, 0)and(1, 0)with costs9and1, and a new node at(0, 0). The old lookup duplicates the first parent, producing cost10; preserving the actual indices selects the second parent at cost2.Fix
Use
enumerate(d_list)to retain each vertex's original index. The existing neighbor-radius calculation, geometry, and collision checks remain unchanged.Regression tests
The change is limited to the Informed RRT* example and its tests, with no new dependencies.
Related: #1443 fixes a similar index-identity bug in the separate
PathPlanning/RRTStar/rrt_star.pyimplementation; this PR coversPathPlanning/InformedRRTStar/informed_rrt_star.py.Independent cross-platform CI validation has been started.
AI disclosure: ChatGPT assisted with analyzing the bug and preparing the fix and regression tests.