Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe Interval Path Planner #1184

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

SchwartzCode
Copy link
Contributor

@SchwartzCode SchwartzCode commented Mar 8, 2025

What does this implement/fix?

Implements the SafeInterval path planning algorithm as described in this paper

This script implements a safe-interval path planner for a 2d grid with dynamic obstacles. It is faster than
SpaceTime A* because it reduces the number of redundant node expansions by pre-computing regions of adjacent
time steps that are safe ("safe intervals") at each position. This allows the algorithm to skip expanding nodes
that are in intervals that have already been visited earlier.

Additional information

PR into the gifs repo:
AtsushiSakai/PythonRoboticsGifs#7

Gifs for reference:
250 obstacles:
path_animation

Found path to goal after 764 expansions
Planning took: 0.59794 seconds

Hard-coded obstacle pattern:

path_animation2

Found path to goal after 322 expansions
Planning took: 0.00702 seconds

SpaceTime A* on this same arrangement:

Found path to goal after 2717154 expansions
Planning took: 20.30111 seconds

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green? (You can check it after submitting)

@SchwartzCode SchwartzCode changed the title Jbs/sipp Safe Interval Path Planner Mar 8, 2025
@AtsushiSakai AtsushiSakai requested a review from Copilot March 8, 2025 08:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR implements a safe‑interval path planning algorithm for a 2D grid with dynamic obstacles, aimed at reducing redundant node expansions compared to SpaceTime A*.

  • Implements a new SafeIntervalPathPlanner class along with supporting Node, NodePath, and interval utilities.
  • Adds a dedicated test file to verify the planner’s functionality.
  • Updates the GridWithDynamicObstacles module to provide safe interval computation and fixes a loop iteration issue.

Reviewed Changes

File Description
PathPlanning/TimeBasedPathPlanning/SafeInterval.py New implementation of the safe‑interval path planning algorithm using SIPP.
tests/test_safe_interval_path_planner.py Added unittests verifying the correctness of the safe‑interval planner.
PathPlanning/TimeBasedPathPlanning/GridWithDynamicObstacles.py Updates to safe intervals functions and a fix for iterating while modifying a list.

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

PathPlanning/TimeBasedPathPlanning/SafeInterval.py:49

  • For rich comparisons, lt (and similarly eq) should return NotImplemented instead of raising NotImplementedError. This will ensure proper behavior when comparing against other types.
if not isinstance(other, Node): return NotImplementedError(f"Cannot compare Node with object of type: {type(other)}")

@SchwartzCode
Copy link
Contributor Author

Wow that copilot review is awesome!

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