The Problem

Robotics algorithm development is fragmented across research papers, blog posts, and scattered GitHub gists. Engineers evaluating or implementing path planning, SLAM, or control algorithms lack a single, runnable reference implementation to compare approaches, validate math, or bootstrap a prototype.

What This Does

PythonRobotics is a collection of Python implementations for core robotics algorithms, organized by capability: PathPlanning/ (92 files), SLAM/, Mapping/, PathTracking/, Localization/, and ArmNavigation/. Each subdirectory contains a self-contained script—e.g., PathPlanning/AStar/astar.py, SLAM/FastSLAM1/fastslam1.py, PathTracking/stanleycontrol/stanleycontrol.py—that demonstrates a specific algorithm with minimal dependencies.

The repo doubles as a textbook companion. The docs/ directory builds a static site (via docs/Makefile) that walks through each algorithm with math and generated plots. This is not a library with a unified API; it's a set of educational examples you read, run, and adapt.

How To Use It

Setup: No requirements.txt or pyproject.toml exists. The code relies on standard scientific Python packages (numpy, matplotlib, scipy). Install them manually:

pip install numpy matplotlib scipy

Running it: Each algorithm is a standalone script. Navigate to the relevant directory and execute directly:

cd PathPlanning/AStar python astar.py

Most scripts run a built-in simulation and render a plot—e.g., PathPlanning/RRT/rrt.py shows the tree growing around obstacles. There is no CLI, no configuration file, and no entry-point aggregation. The README documents each example and links to the corresponding textbook section.

Real-World Use

A robotics engineer evaluating path planners for an AGV can run PathPlanning/HybridAStar/hybridastar.py to see kinematic feasibility, then swap in PathPlanning/InformedRRTStar/informedrrtstar.py for a sampling-based alternative. The scripts are short enough to read top-to-bottom, extract the core function (e.g., astarsearch() in astar.py), and port it into a production ROS node or simulation harness.

Code Health & Issues

Med – No dependency pinning: No requirements.txt, pyproject.toml, or lockfile. Reproducibility relies on the user's environment. This is acceptable for a demo repo but a blocker for integration. Med – Minimal test coverage: Only 6 test files for 200 files. Core algorithms like PathPlanning/DStar/dstar.py and Localization/particlefilter/particlefilter.py have no automated verification. Regressions are easy to introduce. Low – Mixed code quality: Some modules (e.g., SLAM/GraphBasedSLAM/graphslam/) have clean class separation; others (e.g., PathPlanning/ElasticBands/elastic_bands.py) are monolithic scripts with global state. Expect to refactor before reuse. Low – Data files in repo: .npy and .csv files (e.g., PathPlanning/ElasticBands/obstacles.npy) are fine for demos but bloat the repo. Good – CI is solid: GitHub Actions runs on Linux, macOS, and Windows (.github/workflows/), plus CodeQL and Dependabot are configured. The license is MIT.

The Bottom Line

PythonRobotics is the best open reference for classic robotics algorithms—complete, readable, and well-documented. It is not a production library; treat it as a textbook with executable code. Use it to learn, compare, and extract algorithm kernels, then build your own validated implementation around them.