PythonRobotics Logo

Table of Contents

  • Getting Started
  • Introduction
  • Localization
  • Mapping
  • SLAM
  • Path Planning
    • Dynamic Window Approach
    • Bug planner
    • Grid based search
    • Time based grid search
      • Space-time astar
        • Code Link
      • Safe Interval Path Planning
        • Code Link
      • References
    • Model Predictive Trajectory Generator
    • State Lattice Planning
    • Probabilistic Road-Map (PRM) planning
    • Visibility Road-Map planner
    • Voronoi Road-Map planning
    • Rapidly-Exploring Random Trees (RRT)
    • Cubic spline planning
    • B-Spline planning
    • Catmull-Rom Spline Planning
    • Clothoid path planning
    • Eta^3 Spline path planning
    • Bezier path planning
    • Quintic polynomials planning
    • Dubins path planning
    • Reeds Shepp planning
    • LQR based path planning
    • Hybrid a star
    • Optimal Trajectory in a Frenet Frame
    • Coverage path planner
    • Elastic Bands
  • Path Tracking
  • Arm Navigation
  • Aerial Navigation
  • Bipedal
  • Inverted Pendulum
  • Mission Planning
  • Utilities
  • Appendix
PythonRobotics
  • Path Planning
  • Time based grid search
  • Edit on GitHub

Time based grid search

Space-time astar

This is an extension of A* algorithm that supports planning around dynamic obstacles.

https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar/path_animation.gif https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/TimeBasedPathPlanning/SpaceTimeAStar/path_animation2.gif

The key difference of this algorithm compared to vanilla A* is that the cost and heuristic are now time-based instead of distance-based. Using a time-based cost and heuristic ensures the path found is optimal in terms of time to reach the goal.

The cost is the amount of time it takes to reach a given node, and the heuristic is the minimum amount of time it could take to reach the goal from that node, disregarding all obstacles. For a simple scenario where the robot can move 1 cell per time step and stop and go as it pleases, the heuristic for time is equivalent to the heuristic for distance.

One optimization that was added in this PR was to add an expanded set to the algorithm. The algorithm will not expand nodes that are already in that set. This greatly reduces the number of node expansions needed to find a path, since no duplicates are expanded. It also helps to reduce the amount of memory the algorithm uses.

Before:

Found path to goal after 204490 expansions
Planning took: 1.72464 seconds
Memory usage (RSS): 68.19 MB

After:

Found path to goal after 2348 expansions
Planning took: 0.01550 seconds
Memory usage (RSS): 64.85 MB

When starting at (1, 11) in the structured obstacle arrangement (second of the two gifs above).

Code Link

class PathPlanning.TimeBasedPathPlanning.SpaceTimeAStar.SpaceTimeAStar(grid: Grid, start: Position, goal: Position)[source]

Safe Interval Path Planning

The safe interval path planning algorithm is described in this paper:

SIPP: Safe Interval Path Planning for Dynamic Environments

It is faster than space-time A* because it pre-computes the intervals of time that are unoccupied in each cell. This allows it to reduce the number of successor node it generates by avoiding nodes within the same interval.

Comparison with SpaceTime A*:

Arrangement 1 starting at (1, 18)

SafeInterval planner:

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

SpaceTime A*:

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

Benchmarking the Safe Interval Path Planner:

250 random obstacles:

Found path to goal after 764 expansions
Planning took: 0.60596 seconds
https://raw.githubusercontent.com/AtsushiSakai/PythonRoboticsGifs/refs/heads/master/PathPlanning/TimeBasedPathPlanning/SafeIntervalPathPlanner/path_animation.gif

Arrangement 1 starting at (1, 18):

Found path to goal after 322 expansions
Planning took: 0.00730 seconds
https://raw.githubusercontent.com/AtsushiSakai/PythonRoboticsGifs/refs/heads/master/PathPlanning/TimeBasedPathPlanning/SafeIntervalPathPlanner/path_animation2.gif

Code Link

class PathPlanning.TimeBasedPathPlanning.SafeInterval.SafeIntervalPathPlanner(grid: Grid, start: Position, goal: Position)[source]

References

  • Cooperative Pathfinding

  • SIPP: Safe Interval Path Planning for Dynamic Environments

Previous Next

© Copyright 2018-now, Atsushi Sakai.

Built with Sphinx using a theme provided by Read the Docs.