How to run sample codes
In this chapter, we will explain the setup process for running each sample code in PythonRobotics and describe the contents of each directory.
Steps to setup and run sample codes
Install Python 3.12.x
Note that older versions of Python3 might work, but we recommend using the specified version, because the sample codes are only tested with it.
2. If you prefer to use conda for package management, install Anaconda or Miniconda to use conda command.
Clone this repo and go into dir.
>$ git clone https://github.com/AtsushiSakai/PythonRobotics.git
>$ cd PythonRobotics
Install the required libraries.
We have prepared requirements management files for conda and pip under the requirements directory. Using these files makes it easy to install the necessary libraries.
using conda :
>$ conda env create -f requirements/environment.yml
using pip :
>$ pip install -r requirements/requirements.txt
Execute python script in each directory.
For example, to run the sample code of Extented Kalman Filter in the localization directory, execute the following command:
>$ cd localization/extended_kalman_filter
>$ python extended_kalman_filter.py
Then, you can see this animation of the EKF algorithm based localization:

Please refer to the Directory structure section for more details on the contents of each directory.
Add star to this repo if you like it 😃.
Directory structure
The top-level directory structure of PythonRobotics is as follows:
Sample codes directories:
AerialNavigation : the sample codes of aerial navigation algorithms for drones and rocket landing.
ArmNavigation : the sample codes of arm navigation algorithms for robotic arms.
Localization : the sample codes of localization algorithms.
Bipedal : the sample codes of bipedal walking algorithms for legged robots.
Control : the sample codes of control algorithms for robotic systems.
Mapping : the sample codes of mapping or obstacle shape recognition algorithms.
PathPlanning : the sample codes of path planning algorithms.
PathTracking : the sample codes of path tracking algorithms for car like robots.
SLAM : the sample codes of SLAM algorithms.
Other directories:
docs : This directory contains the documentation of PythonRobotics.
requirements : This directory contains the requirements management files.
tests : This directory contains the unit test files.
utils : This directory contains utility functions used in some sample codes in common.
.github : This directory contains the GitHub Actions configuration files.
.circleci : This directory contains the CircleCI configuration files.
The structure of this document is the same as that of the sample code directories mentioned above. For more details, please refer to the How to read this textbook section.