https://github.com/ai-winter/python_motion_planning
Motion planning and Navigation of AGV/AMR:ROS planner plugin implementation of A*, JPS, D*, LPA*, D* Lite, (Lazy)Theta*, RRT, RRT*, RRT-Connect, Informed RRT*, ACO, Voronoi, PID, DWA, APF, LQR, MPC, Bezier, Dubins etc.
https://github.com/ai-winter/python_motion_planning
a-star ant-colony-optimization artificial-potential-field bezier-curve d-star d-star-lite dijkstra dubins-curve informed-rrt-star jump-point-search lazy-theta-star lpa-star model-predictive-control motion-planning python rrt rrt-connect rrt-star theta-star voronoi
Last synced: 6 months ago
JSON representation
Motion planning and Navigation of AGV/AMR:ROS planner plugin implementation of A*, JPS, D*, LPA*, D* Lite, (Lazy)Theta*, RRT, RRT*, RRT-Connect, Informed RRT*, ACO, Voronoi, PID, DWA, APF, LQR, MPC, Bezier, Dubins etc.
- Host: GitHub
- URL: https://github.com/ai-winter/python_motion_planning
- Owner: ai-winter
- License: gpl-3.0
- Created: 2023-02-07T03:25:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T15:09:52.000Z (over 1 year ago)
- Last Synced: 2024-05-22T16:31:58.575Z (over 1 year ago)
- Topics: a-star, ant-colony-optimization, artificial-potential-field, bezier-curve, d-star, d-star-lite, dijkstra, dubins-curve, informed-rrt-star, jump-point-search, lazy-theta-star, lpa-star, model-predictive-control, motion-planning, python, rrt, rrt-connect, rrt-star, theta-star, voronoi
- Language: Python
- Homepage:
- Size: 11.3 MB
- Stars: 247
- Watchers: 5
- Forks: 39
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`.
* `Path Planning`: It's based on path constraints (such as obstacles), planning the optimal path sequence for the robot to travel without conflict between the start and goal.
* `Trajectory planning`: It plans the motion state to approach the global path based on kinematics, dynamics constraints and path sequence.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](https://blog.csdn.net/frigidwinter/category_11410243.html).
We also provide [ROS C++](https://github.com/ai-winter/ros_motion_planning) version and [Matlab](https://github.com/ai-winter/matlab_motion_planning) version.
# Quick Start
## Overview
The source file structure is shown below```
python_motion_planning
├─global_planner
| ├─graph_search
| ├─sample_search
| └─evolutionary_search
├─local_planner
├─curve_generation
└─utils
├─agent
├─environment
├─helper
├─planner
└─plot
```* The global planning algorithm implementation is in the folder `global_planner` with `graph_search`, `sample_search` and `evolutionary search`.
* The local planning algorithm implementation is in the folder `local_planner`.
* The curve generation algorithm implementation is in the folder `curve_generation`.
## Install
*(Optional)* The code was tested in python=3.10. We recommend using `conda` to install the dependencies.```shell
conda create -n pmp python=3.10
conda activate pmp
```To install the repository, please run the following command in shell.
```shell
pip install python-motion-planning
```## Run
Below are some simple examples.1. Run planning and animation separately
```python
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
```2. Run planning and animation in one step
```python
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
```3. Create planner in factory mode
```python
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` in the repository.
## Documentation
For more details, you can refer to [online documentation](https://ai-winter.github.io/python_motion_planning/).
The documentation is auto-generated using mkdocs. To do this, enter the root directory and run
```shell
python generate_mkdocs.py
mkdocs serve
```Then open the browser and go to [http://127.0.0.1:8000](http://127.0.0.1:8000). That is the generated documentation.
# Version
## Global PlannerPlanner | Version | Animation
------------ |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ---------
**GBFS** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/gbfs.py) | 
**Dijkstra** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/dijkstra.py) | 
**A*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/a_star.py) | 
**JPS** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/jps.py) | 
**D*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/d_star.py) | 
**LPA*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/lpa_star.py) | 
**D\* Lite** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/d_star_lite.py) | 
**Theta\*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/theta_star.py) | 
**Lazy Theta\*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/lazy_theta_star.py) | 
**S-Theta\*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/s_theta_star.py) | 
**Anya** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/anya.py) | 
**Voronoi** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/graph_search/voronoi.py) | 
**RRT** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/sample_search/rrt.py) | 
**RRT*** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/sample_search/rrt_star.py) | 
**Informed RRT** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/sample_search/informed_rrt.py) | 
**RRT-Connect** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/sample_search/rrt_connect.py) | 
| **ACO** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/evolutionary_search/aco.py) | 
| **GA** |  | 
| **PSO** | [](https://github.com/ai-winter/python_motion_planning/blob/master/global_planner/evolutionary_search/pso.py) |  ## Local Planner
| Planner | Version | Animation
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| --------------------------------------------------
| **PID** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/pid.py) | 
| **APF** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/apf.py) | 
| **DWA** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/dwa.py) | 
| **RPP** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/rpp.py) | 
| **LQR** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/lqr.py) | 
| **TEB** |  | 
| **MPC** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/mpc.py) | 
| **MPPI** |  |
| **Lattice** |  |
| **DQN** |  |
| **DDPG** |  |## Curve Generation
| Planner | Version | Animation |
| ------- | -------------------------------------------------------- | --------------------------------------------------------
| **Polynomia** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/polynomial_curve.py) | 
| **Bezier** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/bezier_curve.py) | 
| **Cubic Spline** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/cubic_spline.py) | 
| **BSpline** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/bspline_curve.py) | 
| **Dubins** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/dubins_curve.py) | 
| **Reeds-Shepp** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/reeds_shepp.py) | 
| **Fem-Pos Smoother** | [](https://github.com/ai-winter/python_motion_planning/blob/master/curve_generation/fem_pos_smooth.py) | # Papers
## Global Planning* [A*: ](https://ieeexplore.ieee.org/document/4082128) A Formal Basis for the heuristic Determination of Minimum Cost Paths
* [JPS:](https://ojs.aaai.org/index.php/AAAI/article/view/7994) Online Graph Pruning for Pathfinding On Grid Maps
* [Lifelong Planning A*: ](https://www.cs.cmu.edu/~maxim/files/aij04.pdf) Lifelong Planning A*
* [D*: ](http://web.mit.edu/16.412j/www/html/papers/original_dstar_icra94.pdf) Optimal and Efficient Path Planning for Partially-Known Environments
* [D* Lite: ](http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf) D* Lite
* [Theta*: ](https://www.jair.org/index.php/jair/article/view/10676) Theta*: Any-Angle Path Planning on Grids
* [Lazy Theta*: ](https://ojs.aaai.org/index.php/AAAI/article/view/7566) Lazy Theta*: Any-Angle Path Planning and Path Length Analysis in 3D
* [S-Theta*: ](https://link.springer.com/chapter/10.1007/978-1-4471-4739-8_8) S-Theta*: low steering path-planning algorithm
* [Anya: ](http://www.grastien.net/ban/articles/hgoa-jair16.pdf) Optimal Any-Angle Pathfinding In Practice
* [RRT: ](http://msl.cs.uiuc.edu/~lavalle/papers/Lav98c.pdf) Rapidly-Exploring Random Trees: A New Tool for Path Planning
* [RRT-Connect: ](http://www-cgi.cs.cmu.edu/afs/cs/academic/class/15494-s12/readings/kuffner_icra2000.pdf) RRT-Connect: An Efficient Approach to Single-Query Path Planning
* [RRT*: ](https://journals.sagepub.com/doi/abs/10.1177/0278364911406761) Sampling-based algorithms for optimal motion planning
* [Informed RRT*: ](https://arxiv.org/abs/1404.2334) Optimal Sampling-based Path Planning Focused via Direct Sampling of an Admissible Ellipsoidal heuristic
* [ACO: ](http://www.cs.yale.edu/homes/lans/readings/routing/dorigo-ants-1999.pdf) Ant Colony Optimization: A New Meta-Heuristic## Local Planning
* [DWA: ](https://www.ri.cmu.edu/pub_files/pub1/fox_dieter_1997_1/fox_dieter_1997_1.pdf) The Dynamic Window Approach to Collision Avoidance
* [APF: ](https://ieeexplore.ieee.org/document/1087247) Real-time obstacle avoidance for manipulators and mobile robots
* [RPP: ](https://arxiv.org/pdf/2305.20026.pdf) Regulated Pure Pursuit for Robot Path Tracking
* [DDPG: ](https://arxiv.org/abs/1509.02971) Continuous control with deep reinforcement learning## Curve Generation
* [Dubins: ]() On curves of minimal length with a constraint on average curvature, and with prescribed initial and terminal positions and tangents
# Acknowledgment
* Our visualization and animation framework of Python Version refers to [https://github.com/zhm-real/PathPlanning](https://github.com/zhm-real/PathPlanning). Thanks sincerely.