Skip to content

Bidirectional A* raises AttributeError when the goal is unreachable #1504

Open

Description

@blessedefe4real

BidirectionalAStarPlanner.planning in PathPlanning/BidirectionalAStar/bidirectional_a_star.py raises AttributeError: 'NoneType' object has no attribute 'x' when the goal cannot be reached.

When either open set is exhausted the loop prints "Open set A/B is empty.." and breaks, but meet_point_A / meet_point_B are still None, so calc_final_bidirectional_path -> calc_final_path fails on goal_node.x.

Reproduce

from PathPlanning.BidirectionalAStar import bidirectional_a_star as m
m.show_animation = False

# square boundary 0..10 with an inner wall at x = 5
ox, oy = [], []
for i in range(11):
    ox += [0.0, 10.0, float(i), float(i), 5.0]
    oy += [float(i), float(i), 0.0, 10.0, float(i)]
planner = m.BidirectionalAStarPlanner(ox, oy, 1.0, 0.5)

planner.planning(2.0, 5.0, 8.0, 5.0)  # AttributeError: 'NoneType' object has no attribute 'x'

Expected

Return empty lists [], [] when no path exists, consistent with the proposed Dijkstra fix in #1418.

There is also currently no test file for bidirectional A* under tests/.

Tested on current master (61a8b0b), Python 3.13.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions