Skip to main content

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

Project description

PathPlanning

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

Release

  • Package: pathplanning
  • Version: 0.1.1
  • Canonical repository: https://github.com/damminhtien/pathplanning

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:

  • pathplanning/search_based_planning/plan2d: 2D grid search planners
  • pathplanning/search_based_planning/search_3d: 3D search planners
  • pathplanning/sampling_based_planning/rrt_2d: 2D sampling-based planners
  • pathplanning/sampling_based_planning/rrt_3d: 3D sampling-based planners
  • pathplanning/curves: 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
├── docs/
├── examples/
│   └── worlds/
├── pathplanning/
│   ├── core/
│   ├── curves/
│   ├── env/
│   ├── sampling_based_planning/
│   │   ├── rrt_2d/
│   │   └── rrt_3d/
│   ├── search_based_planning/
│   │   ├── plan2d/
│   │   └── search_3d/
│   └── viz/
├── scripts/
├── tests/
├── SUPPORTED_ALGORITHMS.md
├── 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/pathplanning.git
cd pathplanning

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

Python >=3.10 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__)

3D RRT Refactor

The 3D sampling stack includes a production refactor for deterministic execution, headless-safe imports, and clearer environment contracts.

See:

  • docs/rrt3d_refactor.md

Highlights:

  • DynamicRRT3DConfig and seeded constructor support (DynamicRRT3D.with_seed)
  • pluggable nearest-neighbor backends (BruteForceNearestNodeIndex, KDTreeNearestNodeIndex)
  • canonical Environment3D snake_case fields (aabb, aabb_pyrr, obb)
  • legacy environment field compatibility preserved with deprecation guidance

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 .
# optional: google-style lint via pylint
make lint-google

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.1.tar.gz (113.3 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.1-py3-none-any.whl (156.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pathplanning-0.1.1.tar.gz
  • Upload date:
  • Size: 113.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.12

File hashes

Hashes for pathplanning-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7dd25b671456f5b50871afb553878fed9e79fa006181ee26448dc27f30ebc7fb
MD5 894f74794a97c47a8b042ce4c06ccdf4
BLAKE2b-256 9d0eaa5bfc9fc6ccca3e9f858a13e668dfbc73ca135b1bcb4468d2a8140176a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pathplanning-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 156.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.12

File hashes

Hashes for pathplanning-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f0ca4325bdb5aaa31af836c4412f61b08330e9db9b7c4701362e040484d1f52
MD5 9d49783ff3b4cb02028e325b43798a39
BLAKE2b-256 d23c4031ecf0764efdd750d55245426b241ad9bce487526413eed9e1dd6d1a1e

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