PythonRobotics
Python sample codes and textbook for robotics algorithms.
Install / Use
/learn @AtsushiSakai/PythonRoboticsREADME
PythonRobotics
Python codes and textbook for robotics algorithm.
Table of Contents
- What is this?
- Requirements
- Documentation
- How to use
- Localization
- Mapping
- SLAM
- Path Planning
- Path Tracking
- Arm Navigation
- Aerial Navigation
- Bipedal
- License
- Use-case
- Contribution
- Citing
- Support
- Sponsors
- Authors
What is PythonRobotics?
PythonRobotics is a Python code collection and a textbook of robotics algorithms.
Features:
-
Easy to read for understanding each algorithm's basic idea.
-
Widely used and practical algorithms are selected.
-
Minimum dependency.
See this documentation
or this Youtube video:
or this paper for more details:
Requirements to run the code
For running each sample code:
For development:
-
pytest (for unit tests)
-
pytest-xdist (for parallel unit tests)
-
mypy (for type check)
-
sphinx (for document generation)
-
pycodestyle (for code style check)
Documentation (Textbook)
This README only shows some examples of this project.
If you are interested in other examples or mathematical backgrounds of each algorithm,
You can check the full documentation (textbook) online: Welcome to PythonRobotics’s documentation! — PythonRobotics documentation
All animation gifs are stored here: AtsushiSakai/PythonRoboticsGifs: Animation gifs of PythonRobotics
How to use
-
Clone this repo.
git clone https://github.com/AtsushiSakai/PythonRobotics.git -
Install the required libraries.
-
using conda :
conda env create -f requirements/environment.yml -
using pip :
pip install -r requirements/requirements.txt
-
Execute python script in each directory.
-
Add star to this repo if you like it :smiley:.
Localization
Extended Kalman Filter localization
<img src="https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/Localization/extended_kalman_filter/animation.gif" width="640" alt="EKF pic">Reference
Particle filter localization

This is a sensor fusion localization with Particle Filter(PF).
The blue line is true trajectory, the black line is dead reckoning trajectory,
and the red line is an estimated trajectory with PF.
It is assumed that the robot can measure a distance from landmarks (RFID).
These measurements are used for PF localization.
Reference
Histogram filter localization

This is a 2D localization example with Histogram filter.
The red cross is true position, black points are RFID positions.
The blue grid shows a position probability of histogram filter.
In this simulation, x,y are unknown, yaw is known.
The filter integrates speed input and range observations from RFID for localization.
Initial position is not needed.
Reference
Mapping
Gaussian grid map
This is a 2D Gaussian grid mapping example.

Ray casting grid map
This is a 2D ray casting grid mapping example.

Lidar to grid map
This example shows how to convert a 2D range measurement to a grid map.

k-means object clustering
This is a 2D object clustering with k-means algorithm.

Rectangle fitting
This is a 2D rectangle fitting for vehicle detection.

SLAM
Simultaneous Localization and Mapping(SLAM) examples
Iterative Closest Point (ICP) Matching
This is a 2D ICP matching example with singular value decomposition.
It can calculate a rotation matrix, and a translation vector between points and points.

Reference
FastSLAM 1.0
This is a feature based SLAM example using FastSLAM 1.0.
The blue line is ground truth, the black line is dead reckoning, the red line is the estimated trajectory with FastSLAM.
The red points are particles of FastSLAM.
Black points are landmarks, blue crosses are estimated landmark positions by FastSLAM.

Refer
