Skip to main content

Production-oriented search-based and sampling-based path planning algorithms with reusable Python API.

Project description

PathPlanningV2

PathPlanning is a curated collection of search-based and sampling-based path planning algorithms for robotics, with built-in visualizations for 2D and 3D demos.

The repository is organized for practical use:

  • algorithm implementations grouped by planning family
  • reusable environment and plotting utilities
  • runnable demo scripts
  • production-oriented linting and pre-commit checks

Contents

Overview

This codebase is useful for:

  • learning classic planning algorithms
  • comparing planners on shared map/obstacle settings
  • extending planners while keeping plotting and environment code decoupled

Primary modules:

  • Search_based_Planning/plan2d: 2D grid search planners
  • Search_based_Planning/Search_3D: 3D search planners
  • Sampling_based_Planning/rrt_2D: 2D sampling-based planners
  • Sampling_based_Planning/rrt_3D: 3D sampling-based planners
  • CurvesGenerator: curve generation utilities (Bezier, spline, Dubins, Reeds-Shepp)

Visual Preview

A small gallery from the built-in animations:

Search-Based

A star planning animation Bidirectional A star animation

D star lite planning animation ARA star planning animation

Sampling-Based

RRT 2D planning animation RRT connect 2D planning animation

FMT star planning animation BIT star planning animation

Repository Layout

.
├── .github/workflows/
│   └── pylint.yml
├── CurvesGenerator/
├── Sampling_based_Planning/
│   ├── gif/
│   ├── rrt_2D/
│   └── rrt_3D/
├── Search_based_Planning/
│   ├── gif/
│   ├── plan2d/
│   └── Search_3D/
├── .pre-commit-config.yaml
├── pyproject.toml
├── requirements.txt
├── requirements-dev.txt
├── Makefile
└── README.md

Implemented Algorithms

Search-based (2D/3D):

  • Breadth-First Search (BFS)
  • Depth-First Search (DFS)
  • Best-First Search
  • Dijkstra
  • A*
  • Bidirectional A*
  • Lifelong Planning A* (LPA*)
  • Learning Real-Time A* (LRTA*)
  • Real-Time Adaptive A* (RTAA*)
  • D*
  • D* Lite
  • Anytime D*
  • Anytime Repairing A* (ARA*)

Sampling-based (2D/3D):

  • RRT
  • RRT-Connect
  • Extended-RRT
  • Dynamic-RRT
  • RRT*
  • Informed RRT*
  • RRT* Smart
  • FMT*
  • BIT*
  • AIT*

Installation

git clone https://github.com/damminhtien/PathPlanningV2.git
cd PathPlanningV2

python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Python >=3.9 is recommended.

Package API

Import-first usage (production path):

from pathplanning import Search2D, Planner, PlanConfig, Heuristic

planner = Search2D()
result = planner.plan(
    Planner.ASTAR,
    PlanConfig(s_start=(5, 5), s_goal=(45, 25), heuristic=Heuristic.EUCLIDEAN),
)

print(result.path)
print(result.cost)

Load algorithm modules via registry:

from pathplanning import list_supported_algorithms, load_algorithm_module

for spec in list_supported_algorithms():
    module = load_algorithm_module(spec.algorithm_id)
    print(spec.algorithm_id, module.__name__)

Production Support Matrix

Production algorithm support is documented in:

  • SUPPORTED_ALGORITHMS.md

Policy:

  1. All complete algorithms are included in production scope.
  2. Incomplete algorithms are explicitly marked as dropped.
  3. sampling3d.abit_star is currently dropped as incomplete and excluded from production API surface.

Publish to PyPI

Build and upload (requires build and twine, already in requirements-dev.txt):

make build            # creates dist/ artifacts
make publish-test     # upload to TestPyPI (configure ~/.pypirc)
make publish          # upload to PyPI (configure ~/.pypirc)

Manual commands:

python -m build
twine check dist/*
twine upload --repository testpypi dist/*

Run Demos

Run from repository root.

2D search demo (runs multiple algorithms):

python Search_based_Planning/plan2d/run.py

Single 2D search example:

python Search_based_Planning/plan2d/astar.py

2D sampling example:

python Sampling_based_Planning/rrt_2D/rrt.py

3D search example:

python Search_based_Planning/Search_3D/Astar3D.py

Generated animations are available under:

  • Search_based_Planning/gif
  • Sampling_based_Planning/gif

Production Developer Workflow

Install development tooling:

pip install -r requirements-dev.txt

Run lint checks:

ruff check .

Run formatter (optional but recommended before commit):

ruff format .

Enable git hooks:

pre-commit install

Run all hooks manually:

pre-commit run --all-files

Run smoke tests:

pytest -q

Shortcut commands:

make install-dev
make lint
make format
make precommit
make test

Code Quality Files

  • pyproject.toml
    • central ruff lint/format configuration
    • conservative default lint rule set focused on correctness issues
  • .pre-commit-config.yaml
    • syntax/config sanity checks
    • ruff lint hook for Python files
  • requirements-dev.txt
    • pinned development dependencies for linting and pre-commit
  • .editorconfig
    • consistent whitespace/newline/indentation defaults
  • Makefile
    • common development commands (install-dev, lint, format, precommit)

CI

GitHub Actions workflow: .github/workflows/pylint.yml

CI installs requirements-dev.txt and runs:

pre-commit run --all-files --show-diff-on-failure
pytest -q

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathplanning-0.1.0.tar.gz (95.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathplanning-0.1.0-py3-none-any.whl (142.8 kB view details)

Uploaded Python 3

File details

Details for the file pathplanning-0.1.0.tar.gz.

File metadata

  • Download URL: pathplanning-0.1.0.tar.gz
  • Upload date:
  • Size: 95.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.5

File hashes

Hashes for pathplanning-0.1.0.tar.gz
Algorithm Hash digest
SHA256 27cf7f983919fd70c966cb9f995a7b4e620de8f5b91f9adc102449a618f56e7a
MD5 8b96450eab094c83a60cd50398241d8b
BLAKE2b-256 d50de52b0b87e7e9c5cc0f862b11537a957c76eed8f49b66494ac842c24a6b90

See more details on using hashes here.

File details

Details for the file pathplanning-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pathplanning-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 142.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.5

File hashes

Hashes for pathplanning-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd8cd0c6a0e3e763badb6322778bb06fc5b09524f171fda7a3157c1e5b536e2e
MD5 741161bf172a105882b8ad6c314c844a
BLAKE2b-256 c6833f0f09b73970b726f932bd70ce91d329d04f405455b8018c801ab9b4be49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page