All Projects → GavinPHR → Space-Time-AStar

GavinPHR / Space-Time-AStar

Licence: MIT license
A* Search Algorithm with an Additional Time Dimension to Deal with Dynamic Obstacles

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Space-Time-AStar

coursera robotics
Contains coursera robotics specialization assignment codes
Stars: ✭ 65 (-18.75%)
Mutual labels:  astar-algorithm
eastar
A* graph pathfinding in pure Elixir
Stars: ✭ 26 (-67.5%)
Mutual labels:  astar-algorithm
panther
Perception-Aware Trajectory Planner in Dynamic Environments
Stars: ✭ 115 (+43.75%)
Mutual labels:  obstacle-avoidance
dqn-obstacle-avoidance
Deep Reinforcement Learning for Fixed-Wing Flight Control with Deep Q-Network
Stars: ✭ 57 (-28.75%)
Mutual labels:  obstacle-avoidance
AI-Programming-using-Python
This repository contains implementation of different AI algorithms, based on the 4th edition of amazing AI Book, Artificial Intelligence A Modern Approach
Stars: ✭ 43 (-46.25%)
Mutual labels:  astar-algorithm
Advanced-Shortest-Paths-Algorithms
Java Code for Contraction Hierarchies Algorithm, A-Star Algorithm and Bidirectional Dijkstra Algorithm. Tested and Verified Code.
Stars: ✭ 63 (-21.25%)
Mutual labels:  astar-algorithm
Optical-Flow-based-Obstacle-Avoidance
Image based obstacle avoidance using optical flow
Stars: ✭ 24 (-70%)
Mutual labels:  obstacle-avoidance
Baritone
google maps for block game
Stars: ✭ 3,868 (+4735%)
Mutual labels:  astar-algorithm
IsoRTS
Isometric RTS game with procedural generated maps.
Stars: ✭ 14 (-82.5%)
Mutual labels:  astar-algorithm
Global path planning for USV
This repository uses the S-57 electronic chart to build the octree grid environment model, and proposes an improved A* algorithm based on sailing safety weight, pilot quantity and path curve smoothing to ensure the safety of the route, reduce the planning time, and improve path smoothness.
Stars: ✭ 52 (-35%)
Mutual labels:  astar-algorithm
Pathfindax
Pathfinding framework
Stars: ✭ 20 (-75%)
Mutual labels:  astar-algorithm
CosmosFramework
CosmosFramework is a lightweight plug-in Unity development framework . Has a rich Unity method extensions and toolchain. async/await syntax support, multi-network channel support.Long term support for this project
Stars: ✭ 176 (+120%)
Mutual labels:  astar-algorithm
algoviz
Codebase for educational tool on algorithms
Stars: ✭ 21 (-73.75%)
Mutual labels:  astar-algorithm
Underwater-obstacle-avoidance
The underwater robot obstacle avoidance project with the method of deep reinforcement learning
Stars: ✭ 23 (-71.25%)
Mutual labels:  obstacle-avoidance
car-racing
A toolkit for testing control and planning algorithm for car racing.
Stars: ✭ 30 (-62.5%)
Mutual labels:  obstacle-avoidance
Quadcopter multi
(Complete). An open-architecture multi-agent quadcopter simulator. We implement a few modern techniques for improving the performance of aerial vehicles, including reinforcement learning and shifting planar inequalities for obstacle avoidance.
Stars: ✭ 16 (-80%)
Mutual labels:  obstacle-avoidance
mader
Trajectory Planner in Multi-Agent and Dynamic Environments
Stars: ✭ 252 (+215%)
Mutual labels:  obstacle-avoidance
obstacle-env
An environment for an obstacle avoidance task
Stars: ✭ 30 (-62.5%)
Mutual labels:  obstacle-avoidance

Space-Time A*

Space-Time A* (STA*) Search Algorithm with an Additional Time Dimension to Deal with Dynamic Obstacles.

Installation

The package is named space-time-astar and listed on PyPI. You can use the pip to install:

pip3 install space-time-astar

For multiple agents, you might be interested in the cbs-mapf package which uses this package as the low-level planner, also on GitHub and PyPI.

Usage

Import Planner

from stastar.planner import Planner

Constructor Parameters

Planner(grid_size: int, robot_radius: int, static_obstacles: List[Tuple[int, int]])
  • grid_size: int - each grid will be square with side length grid_size.
  • robot_radius: int - agents are assumed to be circles with radius being robot_radius.
  • static_obstacles: List[Tuple[int, int]] - A list of coordinates specifying the static obstacles in the map.

It is important that grid_size is not too small and static_obstacles does not contain too many coordinates, otherwise the performance will severely deteriorate. What is 'too many' you might ask? It depends on your requirements.

Find Path

Use Planner's plan() method:

plan(start: Tuple[int, int],
     goal: Tuple[int, int],
     dynamic_obstacles: Dict[int, Set[Tuple[int, int]]],
     semi_dynamic_obstacles:Dict[int, Set[Tuple[int, int]]] = dict(),
     max_iter:int = 500,
     debug:bool = False) -> np.ndarray:

Parameters:

  • start: Tuple[int, int] - A start coordinate.
  • goal: Tuple[int, int] - A goal coordinate.
  • dynamic_obstacles: Dict[int, Set[Tuple[int, int]]] - Dynamic obstacles are really other agents reservation in space-time, more details below.
  • semi_dynamic_obstacles: Dict[int, Set[Tuple[int, int]]], optional - This parameter exist because we have to take the agents that have reached their destinations into account, they are essentially static obstacles from specific times.
  • max_iter: int, optional - Max iterations of the search. Default to 500.
  • debug: bool, optional - Prints some debug message. Default to False.

The keys for dynamic_obstacles are integers representing time and the values are sets of coordinates. It tells the planner what coordinates we need to avoid at each time step. Currently, it is assumed that dynamic obstacles are other agents (with the same robot_radius) and are treated differently to static obstacles.

Return:

A numpy.ndaarray with shape (L, 2) with L being the length of the path.

Theoretical Background

Here is a good document about Space-Time A* (STA*) written by David Silver.

In a nutshell, STA* is normal A* plus a time dimension. See the illustration below.

On the left block, the first agent plans its path and reserve its path through time (with no regard to the second agent).

On the right block, the second agent plans its path while avoiding the path reserved by the first agent (i.e. the dynamic_obstacles argument).

Implementation decisions in space-time-astar package

  • The Manhattan distance, an admissible and consistent heuristic, is used in this implementation. You can change this by changing the h() function in planner.py.

  • The agents can be bigger than the grid.

  • The dynamic obstacles are assumed to be other agents of the same size. This can be changed in the safe_dynamic() inner function in plan().

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].