Repository navigation
Fix bidirectional A* crash when the goal is unreachable (fixes #1504) - #1507
Open
blessedefe4real wants to merge 1 commit into
Open
blessedefe4real wants to merge 1 commit into
blessedefe4real wants to merge 1 commit into
Conversation
When either open set was exhausted the search loop only broke out,
leaving the meeting points as None, and calc_final_bidirectional_path
then raised AttributeError ('NoneType' object has no attribute 'x').
Return empty lists when either search runs out of nodes. Add a test
file for bidirectional A* covering the example and an unreachable goal.
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.
Reference issue
Fixes #1504
What does this implement/fix?
BidirectionalAStarPlanner.planningraisedAttributeError: 'NoneType' object has no attribute 'x'when the goal is unreachable: the search loopbreaks on an empty open set while the meeting points are stillNone, and path reconstruction dereferences them.[], []as soon as either open set is exhausted (same behavior as the Dijkstra fix proposed in Fix Dijkstra failure when goal is unreachable #1418), and document it in theplanningdocstring.tests/test_bidirectional_a_star.py, which did not exist: it runsmain()without animation and checks the unreachable-goal case.Normal planning is unchanged.
Additional information
test_unreachable_goal_returns_empty_pathraisesAttributeErroronmasterand passes with this change. Full suite (pytest tests -Werror, as inruntests.sh): 158 passed;ruff checkpasses on the changed files.CheckList