PythonRobotics
repository·master·Indexed 12 days ago
https://github.com/atsushisakai/pythonroboticsA comprehensive collection of Python implementations and an accompanying textbook for robotics algorithms. It covers localization (EKF, Particle Filter), mapping, SLAM (FastSLAM, ICP), path planning (A*, Dijkstra, RRT*, PRM), path tracking (MPC, LQR, Stanley), and specialized navigation for robotic arms, aerial vehicles, and bipedal robots. Built for Python 3.13.x using NumPy, SciPy, Matplotlib, and cvxpy.
What's inside PythonRobotics
- PythonRobotics is a collection of Python implementations and a textbook for various robotics algorithms. It is designed to be easy to read for understanding basic ideas, uses widely used and practical algorithms, and maintains minimum dependencies.
Overview of Localization techniques in PythonRobotics
masterLocalization is the process of determining a robot's position and orientation using sensors like GNSS. This repository provides implementations of various Bayesian filters used for localization, including:
- Kalman Filters: Specifically Extended Kalman Filter (EKF), Ensemble Kalman Filter, and Unscented Kalman Filter (UKF).
- Histogram Filters: For probabilistic localization.
- Particle Filters: For non-Gaussian/non-linear localization tasks.
Overview of Path Tracking techniques in PythonRobotics
masterPath tracking enables a robot to follow a reference path generated by a path planner while stabilizing the robot. This process often accounts for modeling errors and uncertainty using feedback control or optimization-based control techniques.
PythonRobotics provides several implementations of path tracking controllers, including:
- Pure Pursuit Tracking: A geometric approach to following paths.
- Stanley Control: A controller based on the Stanley method.
- Rear Wheel Feedback Control: Uses rear wheel feedback steering and PID speed control.
- LQR Steering Control: Linear Quadratic Regulator for steering.
- LQR Speed and Steering Control: LQR for both speed and steering control.
- Model Predictive Speed and Steering Control: Optimization-based control.
- CGMRES NMPC: Nonlinear Model Predictive Control using CGMRES.
- Move to a Pose: Controlling the robot to reach a specific pose.
Overview of External Sensors for Robots
masterSincePythonRoboticsfocuses on algorithms rather than hardware, this section provides a conceptual overview of the external sensors used to feed data into robotic algorithms. External recognition (understanding surroundings, identifying safe zones, and detecting moving objects) depends on selecting the appropriate sensor based on the environment and required precision.Overview of SLAM (Simultaneous Localization and Mapping) examples
masterThe
pythonroboticsrepository provides several implementations of Simultaneous Localization and Mapping (SLAM). SLAM is the process of estimating a robot's pose and the environment's map simultaneously. Because mapping requires localization and localization requires a map, it is often treated as a 'chicken-and-egg' problem.Available SLAM implementation modules in this repository include:
- Iterative Closest Point (ICP) matching
- Extended Kalman Filter (EKF) SLAM
- FastSLAM 1.0
- FastSLAM 2.0
- Graph SLAM
Overview of Internal Sensors for Robots
masterIn robotic systems, internal sensors provide self-awareness of the robot's own motion and condition, supporting control, localization, and safety mechanisms. WhilePythonRoboticsfocuses on algorithms rather than hardware, understanding these sensors is essential for implementing algorithms that process their feedback (e.g., orientation, acceleration, altitude, and temperature).What is PythonRobotics?
masterPythonRobotics is a collection of Python code and a textbook focused on robotics algorithms. It serves as an open-source resource for implementing and studying various robotics algorithms, ranging from localization and mapping to path planning and aerial navigation.Overview of Path Planning modules
masterThe Path Planning module in PythonRobotics provides implementations for searching feasible and efficient paths to a goal while satisfying robot motion constraints and avoiding obstacles. The module includes two primary categories of algorithms:
- Search and Sampling Based Approaches: Includes algorithms like RRT, PRM, Grid-based search, and Hybrid A*.
- Trajectory and Spline Generation: Includes methods for smoothing paths using Cubic Splines, B-Splines, Bezier curves, Clothoids, and Quintic Polynomials.
- Optimization and Control-based Planning: Includes Model Predictive Trajectory Generation, Particle Swarm Optimization, and Elastic Bands.
- Kinematic/Non-holonomic Path Planning: Includes Dubins Path, Reeds-Shepp Path, and LQR-based paths.
Users can explore specific implementations by navigating to the individual sub-directories for each algorithm listed in the module's table of contents.
Understand the scope of PythonRobotics
masterPythonRobotics is a collection of algorithms, sample codes, and documentation focused specifically on the Computer Science and Artificial Intelligence (AI) aspects of robotics. It does not cover mechanical or electrical engineering.Object shape recognition using rectangle fitting
masterThis module implements object shape recognition by fitting rectangles to range data (e.g., from laser scanners). The algorithm is based on the paper "Efficient L-Shape Fitting for Vehicle Detection Using Laser Scanners" from Carnegie Mellon University. It works in two primary stages:
Adaptive range segmentation: Range data points are clustered based on their proximity. To account for the sparser data distribution at greater distances, the distance threshold $r_{th}$ is calculated adaptively using the formula: $r_{th} = R_0 + R_d * r_{origin}$ where $R_0$ and $R_d$ are constant parameters and $r_{origin}$ is the distance from the sensor.
Rectangle search: For each cluster, the algorithm rotates the data at specific angle intervals and evaluates the fit using one of three criteria to find the best rectangle shape.
Identify the scope of PythonRobotics
masterThe
PythonRoboticsproject is specifically focused on the Software & Algorithms component of robotics. It provides implementations for core robotic logic such as:- Localization
- Mapping
- Path planning
- Control
- Machine learning models
It is intended for developers interested in the algorithmic side of robotics rather than the hardware design of sensors or actuators.
Understand the PythonRobotics project
masterPythonRobotics is an open-source collection of robotics algorithms implemented in Python. The project is designed for beginners to understand the core ideas behind practical algorithms used in both academia and industry.
Key features include:
- Algorithm Implementations: Covers localization (Kalman filters, particle filters), mapping (grid mapping), path planning (dynamic programming, sampling-based), and path tracking (optimal control).
- Visualizations: Uses
Matplotlibto provide intuitive animations that demonstrate algorithm behavior over time. - Textbook: A companion guide that explains algorithms with minimal mathematical formulas, focusing on the logic and sample code.