$ show AtsushiSakai/PythonRobotics
PythonRobotics is a large collection of robotics algorithms implemented in Python, designed primarily for educational purposes and as a companion to a textbook. It covers a wide range of robotics domains including localization (EKF, particle filter, histogram filter), mapping (grid maps, NDT, clustering), SLAM (EKF SLAM, FastSLAM, GraphSLAM), path planning (A*, Dijkstra, RRT variants, PRM, DWA, Frenet, etc.), path tracking (Stanley, LQR, MPC, pure pursuit), arm navigation (inverse kinematics, RRT for arms), aerial navigation (drone trajectory, rocket landing), bipedal walking, inverted pendulum control, and mission planning (state machines, behavior trees). Each algorithm is implemented as a standalone script with a main() function that runs a simulation and visualizes results using matplotlib. The code is not packaged as a library and is not intended for production use; it is a learning resource with clear, readable implementations that reference academic papers. The repository includes extensive documentation in Sphinx RST format, CI/CD pipelines, and a test suite that runs each demo without animation.
The LLM identified 5 files worth highlighting for reuse:
Provides angle_mod and rot_mat_2d functions used across many modules for angle normalization and 2D rotation. Self-contained, no internal dependencies, and solves a common robotics problem. Easily extractable.
Implements cubic spline interpolation for 1D and 2D paths, including curvature and yaw calculation. Used by multiple path tracking and planning modules. Demonstrates clean numerical methods and is reusable for any trajectory generation task.
Core graph SLAM solver with classes for graph, vertex, edge, and pose (SE2). Implements information matrix and vector updates for pose graph optimization. Well-structured, object-oriented, and could be extracted for use in other SLAM projects.
A behavior tree engine that parses XML definitions and executes nodes (sequence, selector, decorator, action). Uses a factory pattern to register node builders. Self-contained and demonstrates a reusable AI architecture pattern for mission planning.
GridMap class for 2D occupancy grids with polygon filling, coordinate conversion, and plotting. Used by NDT map and other mapping modules. Provides a clean abstraction for grid-based mapping that can be reused in any robotics project.