Collaborative astar#1247
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors single-agent planners into a common interface, adds a new multi-agent priority-based planner, and modularizes plotting and testing.
- Refactored
SpaceTimeAStarandSafeIntervalPathPlannerintoSingleAgentPlannersubclasses with staticplanmethods - Introduced
PriorityBasedPlannerfor multi-agent path planning with priority ordering - Extracted plotting logic into
Plotting.pyand updated tests and documentation accordingly
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_space_time_astar.py | Updated to call static SpaceTimeAStar.plan and adjusted assertions |
| tests/test_safe_interval_path_planner.py | Updated to call static SafeIntervalPathPlanner.plan |
| tests/test_priority_based_planner.py | Added tests for PriorityBasedPlanner |
| docs/.../time_based_grid_search_main.rst | Documented priority-based planning and added paper reference |
| PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar.py | Refactored into SingleAgentPlanner, static plan, improved API |
| PathPlanning/TimeBasedPathPlanning/SafeInterval.py | Refactored into SingleAgentPlanner, static plan, improved API |
| PathPlanning/TimeBasedPathPlanning/PriorityBasedPlanner.py | New multi-agent PriorityBasedPlanner implementation |
| PathPlanning/TimeBasedPathPlanning/Plotting.py | New plotting utilities for single- and multi-agent paths |
| PathPlanning/TimeBasedPathPlanning/Node.py | Introduced shared Node and NodePath dataclasses |
| PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py | Added NARROW_CORRIDOR arrangement and reservation APIs |
| PathPlanning/TimeBasedPathPlanning/BaseClasses.py | Added SingleAgentPlanner and MultiAgentPlanner base classes |
Comments suppressed due to low confidence (2)
tests/test_space_time_astar.py:23
- The comment indicates 28 entries but the assertion checks for 31. Update the comment to match the expected path length or adjust the expected value if it changed intentionally.
# path should have 28 entries
PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py:23
- No tests cover the new
NARROW_CORRIDORarrangement. Consider adding unit tests to validate its behavior.
NARROW_CORRIDOR = 2
| Returns the re-ordered StartAndGoal combinations, and a list of path plans. The order of the plans | ||
| corresponds to the order of the `start_and_goals` list. | ||
| """ | ||
| print(f"Using planner: {single_agent_planner_class}") |
There was a problem hiding this comment.
[nitpick] Consider logging single_agent_planner_class.__name__ instead of the full class object for cleaner output.
| print(f"Using planner: {single_agent_planner_class}") | |
| print(f"Using planner: {single_agent_planner_class.__name__}") |
There was a problem hiding this comment.
Nevermind - mypy didn't like this:
https://github.com/AtsushiSakai/PythonRobotics/actions/runs/16242140076/job/45860004917?pr=1247
AtsushiSakai
left a comment
There was a problem hiding this comment.
LGYM. Thank you for gret PR!!
Reference issue
What does this implement/fix?
This PR implements a simple priority based planner. It plans paths for multiple agents in an environment with dynamic obstacles. It plans in descending order of distance from start position to goal. Once a path is planned for an agent, all future plans will avoid that path.
The algorithm outlined in section III of this paper: https://pure.tudelft.nl/ws/portalfiles/portal/67074672/07138650.pdf
Additional information
PR to gifs repo: AtsushiSakai/PythonRoboticsGifs#8
CheckList