Skip to content

Return empty path when road-map Dijkstra cannot reach goal - #1419

Open
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/voronoi-dijkstra-no-path
Open

Return empty path when road-map Dijkstra cannot reach goal#1419
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/voronoi-dijkstra-no-path

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Summary

  • return ([], []) when the shared road-map Dijkstra search exhausts its frontier
  • add a deterministic regression test for an unreachable goal

Problem

PathPlanning/VoronoiRoadMap/dijkstra_search.py is shared by the Voronoi and visibility road-map planners. When no path exists, the search currently breaks out of the loop and then calls generate_final_path() with the untouched goal node. That produces a singleton [goal] path, which can be mistaken for a successful plan.

This change makes the no-path result explicit and consistent with other planners in the repository by returning empty coordinate lists as soon as the open set is exhausted.

Tests

Added tests/test_voronoi_dijkstra_search.py with a disconnected three-node graph and asserts that an unreachable goal returns empty path lists.

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