Home

Awesome

Introduction

Motion planning plans the state sequence of the robot without conflict between the start and goal.

Motion planning mainly includes Path planning and Trajectory planning.

This repository provides the implementations of common Motion planning algorithms. Your stars and forks are welcome. Maintaining this repository requires a huge amount of work. Therefore, you are also welcome to contribute to this repository by opening issues, submitting pull requests or joining our development team.

The theory analysis can be found at motion-planning.

We also provide ROS C++ version and Matlab version.

Quick Start

Overview

The file structure is shown below

python_motion_planning
├─assets
├─docs
├─examples
└─python_motion_planning
    ├─global_planner
    |   ├─graph_search
    |   ├─sample_search
    |   └─evolutionary_search
    ├─local_planner
    ├─curve_generation
    └─utils
        ├─agent
        ├─environment
        ├─helper
        ├─planner
        └─plot

Dependencies

The code was tested in python=3.10. To install other dependencies, please run the following command in shell.

pip install -r requirements.txt

Run

Below are some simple examples.

  1. Run planning and animation separately
import python_motion_planning as pmp
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
cost, path, expand = planner.plan()
planner.plot.animation(path, str(planner), cost, expand)  # animation
  1. Run planning and animation in one step
import python_motion_planning as pmp
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
planner.run()       # run both planning and animation
  1. Create planner in factory mode
import python_motion_planning as pmp
search_factory = pmp.SearchFactory()
planner = search_factory("a_star", start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
planner.run()       # run both planning and animation

More examples can be found in the folder examples. You can also refer to the examples in the documentations generated using the following method.

Documentation

This repository also support auto-generated documentation using mkdocs. Enter the root directory and run

python generate_mkdocs.py
mkdocs serve

Then open the browser and go to http://127.0.0.1:8000. That is the generated documentation.

Version

Global Planner

PlannerVersionAnimation
GBFSStatusgbfs_python.png
DijkstraStatusdijkstra_python.png
A*Statusa_star_python.png
JPSStatusjps_python.png
D*Statusd_star_python.png
LPA*Statuslpa_star_python.png
D* LiteStatusd_star_lite_python.png
Theta*Statustheta_star_python.png
Lazy Theta*Statuslazy_theta_star_python.png
S-Theta*Statuss_theta_star_python.png
AnyaStatusStatus
VoronoiStatusvoronoi_python.png
RRTStatusrrt_python.png
RRT*Statusrrt_star_python.png
Informed RRTStatusinformed_rrt_python.png
RRT-ConnectStatusrrt_connect_python.png
ACOStatusaco_python.png
GAStatusStatus
PSOStatuspso_python.png pso_python_cost.png

Local Planner

PlannerVersionAnimation
PIDStatuspid_python.svg
APFStatusapf_python.svg
DWAStatusdwa_python.svg
RPPStatusrpp_python.svg
LQRStatuslqr_python.svg
TEBStatusStatus
MPCStatusmpc_python.svg
MPPIStatusStatus
LatticeStatusStatus
DDPGStatusddpg_python.svg

Curve Generation

PlannerVersionAnimation
PolynomiaStatuspolynomial_curve_python.gif
BezierStatusbezier_curve_python.png
Cubic SplineStatuscubic_spline_python.png
BSplineStatusbspline_curve_python.png
DubinsStatusdubins_curve_python.png
Reeds-SheppStatusreeds_shepp_python.png
Fem-Pos SmootherStatusfem_pos_smoother_python.png

Papers

Global Planning

Local Planning

Curve Generation

Acknowledgment