python-motion-planning 1.1.1__tar.gz → 2.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/PKG-INFO +86 -162
- python_motion_planning-2.0.dev1/README.md +126 -0
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/pyproject.toml +4 -5
- python_motion_planning-2.0.dev1/src/python_motion_planning/__init__.py +4 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/__init__.py +3 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/__init__.py +6 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/map/__init__.py +2 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/map/base_map.py +125 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/map/grid.py +569 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/node.py +111 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/robot/__init__.py +3 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/robot/base_robot.py +214 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/robot/circular_robot.py +47 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/robot/diff_drive_robot.py +109 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/robot/tmp.py +404 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/types.py +19 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/world/__init__.py +1 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/world/base_world.py +120 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/env/world/toy_simulator.py +206 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/utils/__init__.py +2 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/utils/frame_transformer.py +218 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/utils/geometry.py +105 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/visualizer/__init__.py +1 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/common/visualizer/visualizer.py +529 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/__init__.py +3 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/base_controller.py +158 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/__init__.py +5 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/apf.py +232 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/dwa.py +253 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/path_tracker.py +257 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/pid.py +76 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/path_tracker/pure_pursuit.py +65 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/controller/random_controller.py +27 -0
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/bezier_curve.py +41 -41
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/bspline_curve.py +51 -51
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/cubic_spline.py +44 -44
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/dubins_curve.py +31 -31
- python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator/fem_pos_smooth.py +114 -0
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/polynomial_curve.py +58 -58
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/reeds_shepp.py +48 -48
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/__init__.py +3 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/base_path_planner.py +88 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/graph_search/__init__.py +3 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/graph_search/a_star.py +96 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/graph_search/dijkstra.py +97 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/graph_search/theta_star.py +118 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/sample_search/__init__.py +2 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/sample_search/rrt.py +201 -0
- python_motion_planning-2.0.dev1/src/python_motion_planning/path_planner/sample_search/rrt_star.py +209 -0
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/src/python_motion_planning.egg-info/PKG-INFO +86 -162
- python_motion_planning-2.0.dev1/src/python_motion_planning.egg-info/SOURCES.txt +56 -0
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/src/python_motion_planning.egg-info/requires.txt +1 -2
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/src/python_motion_planning.egg-info/top_level.txt +1 -0
- python_motion_planning-1.1.1/README.md +0 -201
- python_motion_planning-1.1.1/src/python_motion_planning/__init__.py +0 -4
- python_motion_planning-1.1.1/src/python_motion_planning/curve_generation/fem_pos_smooth.py +0 -114
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/__init__.py +0 -3
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/evolutionary_search/__init__.py +0 -4
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/evolutionary_search/aco.py +0 -186
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/evolutionary_search/evolutionary_search.py +0 -87
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/evolutionary_search/pso.py +0 -356
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/__init__.py +0 -28
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/a_star.py +0 -124
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/d_star.py +0 -291
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/d_star_lite.py +0 -188
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/dijkstra.py +0 -85
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/gbfs.py +0 -86
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/graph_search.py +0 -87
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/jps.py +0 -165
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/lazy_theta_star.py +0 -114
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/lpa_star.py +0 -230
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/s_theta_star.py +0 -133
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/theta_star.py +0 -171
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/graph_search/voronoi.py +0 -200
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/__init__.py +0 -6
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/informed_rrt.py +0 -152
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/rrt.py +0 -151
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/rrt_connect.py +0 -147
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/rrt_star.py +0 -77
- python_motion_planning-1.1.1/src/python_motion_planning/global_planner/sample_search/sample_search.py +0 -135
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/__init__.py +0 -15
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/apf.py +0 -144
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/dwa.py +0 -212
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/local_planner.py +0 -262
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/lqr.py +0 -146
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/mpc.py +0 -214
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/pid.py +0 -158
- python_motion_planning-1.1.1/src/python_motion_planning/local_planner/rpp.py +0 -147
- python_motion_planning-1.1.1/src/python_motion_planning/utils/__init__.py +0 -19
- python_motion_planning-1.1.1/src/python_motion_planning/utils/agent/__init__.py +0 -0
- python_motion_planning-1.1.1/src/python_motion_planning/utils/agent/agent.py +0 -135
- python_motion_planning-1.1.1/src/python_motion_planning/utils/environment/__init__.py +0 -0
- python_motion_planning-1.1.1/src/python_motion_planning/utils/environment/env.py +0 -117
- python_motion_planning-1.1.1/src/python_motion_planning/utils/environment/node.py +0 -85
- python_motion_planning-1.1.1/src/python_motion_planning/utils/environment/point2d.py +0 -96
- python_motion_planning-1.1.1/src/python_motion_planning/utils/environment/pose2d.py +0 -91
- python_motion_planning-1.1.1/src/python_motion_planning/utils/helper/__init__.py +0 -3
- python_motion_planning-1.1.1/src/python_motion_planning/utils/helper/math_helper.py +0 -65
- python_motion_planning-1.1.1/src/python_motion_planning/utils/planner/__init__.py +0 -0
- python_motion_planning-1.1.1/src/python_motion_planning/utils/planner/control_factory.py +0 -27
- python_motion_planning-1.1.1/src/python_motion_planning/utils/planner/curve_factory.py +0 -29
- python_motion_planning-1.1.1/src/python_motion_planning/utils/planner/planner.py +0 -40
- python_motion_planning-1.1.1/src/python_motion_planning/utils/planner/search_factory.py +0 -51
- python_motion_planning-1.1.1/src/python_motion_planning/utils/plot/__init__.py +0 -0
- python_motion_planning-1.1.1/src/python_motion_planning/utils/plot/plot.py +0 -274
- python_motion_planning-1.1.1/src/python_motion_planning.egg-info/SOURCES.txt +0 -67
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/LICENSE +0 -0
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/setup.cfg +0 -0
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/__init__.py +0 -0
- {python_motion_planning-1.1.1/src/python_motion_planning/curve_generation → python_motion_planning-2.0.dev1/src/python_motion_planning/curve_generator}/curve.py +0 -0
- {python_motion_planning-1.1.1 → python_motion_planning-2.0.dev1}/src/python_motion_planning.egg-info/dependency_links.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-motion-planning
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.dev1
|
|
4
4
|
Summary: Motion planning algorithms for Python
|
|
5
|
-
Maintainer-email:
|
|
5
|
+
Maintainer-email: Wu Maojia <omige@mail.nwpu.edu.cn>, Yang Haodong <913982779@qq.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
7
7
|
Version 3, 29 June 2007
|
|
8
8
|
|
|
@@ -687,9 +687,8 @@ License-File: LICENSE
|
|
|
687
687
|
Requires-Dist: numpy
|
|
688
688
|
Requires-Dist: scipy
|
|
689
689
|
Requires-Dist: matplotlib
|
|
690
|
-
Requires-Dist: cvxopt
|
|
691
690
|
Requires-Dist: osqp
|
|
692
|
-
Requires-Dist:
|
|
691
|
+
Requires-Dist: gymnasium
|
|
693
692
|
Dynamic: license-file
|
|
694
693
|
|
|
695
694
|
|
|
@@ -702,12 +701,12 @@ Dynamic: license-file
|
|
|
702
701
|
* `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.
|
|
703
702
|
* `Trajectory planning`: It plans the motion state to approach the global path based on kinematics, dynamics constraints and path sequence.
|
|
704
703
|
|
|
705
|
-
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**.
|
|
706
|
-
|
|
707
704
|
The theory analysis can be found at [motion-planning](https://blog.csdn.net/frigidwinter/category_11410243.html).
|
|
708
705
|
|
|
709
706
|
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.
|
|
710
707
|
|
|
708
|
+
This repository provides the implementations of common `Motion planning` algorithms. **Your stars and forks are welcome**. Submitting pull requests or joining our development team are also welcome. For trivial modification, please directly contribute to `dev` branch. For big modification, please [contact](#contact) us before you contribute.
|
|
709
|
+
|
|
711
710
|
# Quick Start
|
|
712
711
|
|
|
713
712
|
## Overview
|
|
@@ -715,28 +714,23 @@ The source file structure is shown below
|
|
|
715
714
|
|
|
716
715
|
```
|
|
717
716
|
python_motion_planning
|
|
718
|
-
├─
|
|
717
|
+
├─common
|
|
718
|
+
| ├─env
|
|
719
|
+
| | ├─map
|
|
720
|
+
| | ├─robot
|
|
721
|
+
| | └─world
|
|
722
|
+
| ├─utils
|
|
723
|
+
| └─visualizer
|
|
724
|
+
├─controller
|
|
725
|
+
| └─path_tracker
|
|
726
|
+
├─path_planner
|
|
719
727
|
| ├─graph_search
|
|
720
|
-
|
|
|
721
|
-
|
|
722
|
-
├─local_planner
|
|
723
|
-
├─curve_generation
|
|
724
|
-
└─utils
|
|
725
|
-
├─agent
|
|
726
|
-
├─environment
|
|
727
|
-
├─helper
|
|
728
|
-
├─planner
|
|
729
|
-
└─plot
|
|
728
|
+
| └─sample_search
|
|
729
|
+
└─curve_generation
|
|
730
730
|
```
|
|
731
731
|
|
|
732
|
-
* The global planning algorithm implementation is in the folder `global_planner` with `graph_search`, `sample_search` and `evolutionary search`.
|
|
733
|
-
|
|
734
|
-
* The local planning algorithm implementation is in the folder `local_planner`.
|
|
735
|
-
|
|
736
|
-
* The curve generation algorithm implementation is in the folder `curve_generation`.
|
|
737
|
-
|
|
738
732
|
## Install
|
|
739
|
-
*(Optional)* The code was tested in python=3.10. We recommend using `conda` to install the dependencies.
|
|
733
|
+
*(Optional)* The code was tested in python=3.10, though other similar versions should also work. We recommend using `conda` to install the dependencies.
|
|
740
734
|
|
|
741
735
|
```shell
|
|
742
736
|
conda create -n pmp python=3.10
|
|
@@ -746,150 +740,80 @@ conda activate pmp
|
|
|
746
740
|
To install the repository, please run the following command in shell.
|
|
747
741
|
|
|
748
742
|
```shell
|
|
749
|
-
pip install python-motion-planning
|
|
743
|
+
pip install python-motion-planning==2.0.dev1
|
|
750
744
|
```
|
|
751
745
|
|
|
752
746
|
## Run
|
|
753
|
-
Below are some simple examples.
|
|
754
|
-
|
|
755
|
-
1. Run A* with discrete environment (Grid)
|
|
756
|
-
```python
|
|
757
|
-
import python_motion_planning as pmp
|
|
758
|
-
|
|
759
|
-
# Create environment with custom obstacles
|
|
760
|
-
env = pmp.Grid(51, 31)
|
|
761
|
-
obstacles = env.obstacles
|
|
762
|
-
for i in range(10, 21):
|
|
763
|
-
obstacles.add((i, 15))
|
|
764
|
-
for i in range(15):
|
|
765
|
-
obstacles.add((20, i))
|
|
766
|
-
for i in range(15, 30):
|
|
767
|
-
obstacles.add((30, i))
|
|
768
|
-
for i in range(16):
|
|
769
|
-
obstacles.add((40, i))
|
|
770
|
-
env.update(obstacles)
|
|
771
|
-
|
|
772
|
-
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=env) # create planner
|
|
773
|
-
cost, path, expand = planner.plan() # plan
|
|
774
|
-
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
775
|
-
```
|
|
776
|
-
|
|
777
|
-
2. Run RRT with continuous environment (Map)
|
|
778
|
-
```python
|
|
779
|
-
import python_motion_planning as pmp
|
|
780
|
-
|
|
781
|
-
# Create environment with custom obstacles
|
|
782
|
-
env = pmp.Map(51, 31)
|
|
783
|
-
obs_rect = [
|
|
784
|
-
[14, 12, 8, 2],
|
|
785
|
-
[18, 22, 8, 3],
|
|
786
|
-
[26, 7, 2, 12],
|
|
787
|
-
[32, 14, 10, 2]
|
|
788
|
-
]
|
|
789
|
-
obs_circ = [
|
|
790
|
-
[7, 12, 3],
|
|
791
|
-
[46, 20, 2],
|
|
792
|
-
[15, 5, 2],
|
|
793
|
-
[37, 7, 3],
|
|
794
|
-
[37, 23, 3]
|
|
795
|
-
]
|
|
796
|
-
env.update(obs_rect=obs_rect, obs_circ=obs_circ)
|
|
797
|
-
|
|
798
|
-
planner = pmp.RRT(start=(18, 8), goal=(37, 18), env=env) # create planner
|
|
799
|
-
cost, path, expand = planner.plan() # plan
|
|
800
|
-
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
801
|
-
```
|
|
802
|
-
|
|
803
|
-
More examples can be found in the folder `examples` in the repository.
|
|
804
747
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
#
|
|
808
|
-
##
|
|
809
|
-
|
|
810
|
-
Planner
|
|
811
|
-
|
|
812
|
-
**GBFS
|
|
813
|
-
**Dijkstra
|
|
814
|
-
**A
|
|
815
|
-
**JPS
|
|
816
|
-
**D
|
|
817
|
-
**LPA
|
|
818
|
-
**D\* Lite
|
|
819
|
-
**Theta
|
|
820
|
-
**Lazy Theta
|
|
821
|
-
**S-Theta
|
|
822
|
-
**Anya
|
|
823
|
-
**Voronoi
|
|
824
|
-
**RRT
|
|
825
|
-
**RRT
|
|
826
|
-
**Informed RRT
|
|
827
|
-
**RRT-Connect
|
|
828
|
-
| **ACO** | [
|
|
829
|
-
| **GA** |
|
|
830
|
-
| **PSO** | [
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
##
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
| **
|
|
843
|
-
| **
|
|
844
|
-
| **
|
|
845
|
-
| **
|
|
846
|
-
| **
|
|
847
|
-
| **
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
|
748
|
+
Please refer to the Tutorials part of [online documentation](https://ai-winter.github.io/python_motion_planning/).
|
|
749
|
+
|
|
750
|
+
# Demos
|
|
751
|
+
## Path Planner
|
|
752
|
+
|
|
753
|
+
|Planner|2D Grid|3D Grid
|
|
754
|
+
|-------|-------|-------
|
|
755
|
+
**GBFS**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
756
|
+
**Dijkstra**||
|
|
757
|
+
**A\***||
|
|
758
|
+
**JPS**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
759
|
+
**D\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
760
|
+
**LPA\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
761
|
+
**D\* Lite**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
762
|
+
**Theta\***||
|
|
763
|
+
**Lazy Theta\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
764
|
+
**S-Theta\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
765
|
+
**Anya**|Not implemented|Not implemented
|
|
766
|
+
**Voronoi**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
767
|
+
**RRT**||
|
|
768
|
+
**RRT\***||
|
|
769
|
+
**Informed RRT**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
770
|
+
**RRT-Connect**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
771
|
+
| **ACO** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
772
|
+
| **GA** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
773
|
+
| **PSO** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
## Controller
|
|
777
|
+
|
|
778
|
+
We provide a toy simulator with simple physical simulation to test controllers (path-trakcers). The toy simulator supports multi-agents/multi-robots. The available robots include `CircularRobot` (Omnidirectional) and `DiffDriveRobot` (Only support moving forward and backward). Currently only 2D simulator is provided. 3D simulator has not been implemented.
|
|
779
|
+
|
|
780
|
+
In the following demos, the blue robot 1 is the `CircularRobot`, and the orange robot 2 is the `DiffDriveRobot`.
|
|
781
|
+
|
|
782
|
+
|Planner|2D|3D
|
|
783
|
+
|-------|-------|-------
|
|
784
|
+
|**Path Trakcer**||Not implemented
|
|
785
|
+
| **Pure Pursuit** ||Not implemented
|
|
786
|
+
| **PID** ||Not implemented
|
|
787
|
+
| **APF** ||Not implemented
|
|
788
|
+
| **DWA** ||Not implemented
|
|
789
|
+
| **RPP** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
790
|
+
| **LQR** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
791
|
+
| **MPC** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
792
|
+
| **MPPI** |Not implemented|Not implemented
|
|
793
|
+
| **TEB** |Not implemented|Not implemented
|
|
794
|
+
| **Lattice** |Not implemented|Not implemented
|
|
795
|
+
| **DQN** |Not implemented|Not implemented
|
|
796
|
+
| **DDPG** |Implemented in [V1.0](https://github.com/ai-winter/python_motion_planning/tree/v1.0), not migrated|Not implemented
|
|
797
|
+
|
|
798
|
+
## Curve Generator
|
|
799
|
+
|
|
800
|
+
The visualization of the curve generators has not been implemented in current version. They can be visualized in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1).
|
|
801
|
+
|
|
802
|
+
| Planner |2D|3D|
|
|
852
803
|
| ------- | -------------------------------------------------------- | --------------------------------------------------------
|
|
853
|
-
| **Polynomia** |
|
|
854
|
-
| **Bezier**
|
|
855
|
-
| **Cubic Spline**
|
|
856
|
-
| **BSpline**
|
|
857
|
-
| **Dubins**
|
|
858
|
-
| **Reeds-Shepp**
|
|
859
|
-
| **Fem-Pos Smoother**
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
# Papers
|
|
865
|
-
## Global Planning
|
|
866
|
-
|
|
867
|
-
* [A*: ](https://ieeexplore.ieee.org/document/4082128) A Formal Basis for the heuristic Determination of Minimum Cost Paths
|
|
868
|
-
* [JPS:](https://ojs.aaai.org/index.php/AAAI/article/view/7994) Online Graph Pruning for Pathfinding On Grid Maps
|
|
869
|
-
* [Lifelong Planning A*: ](https://www.cs.cmu.edu/~maxim/files/aij04.pdf) Lifelong Planning A*
|
|
870
|
-
* [D*: ](http://web.mit.edu/16.412j/www/html/papers/original_dstar_icra94.pdf) Optimal and Efficient Path Planning for Partially-Known Environments
|
|
871
|
-
* [D* Lite: ](http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf) D* Lite
|
|
872
|
-
* [Theta*: ](https://www.jair.org/index.php/jair/article/view/10676) Theta*: Any-Angle Path Planning on Grids
|
|
873
|
-
* [Lazy Theta*: ](https://ojs.aaai.org/index.php/AAAI/article/view/7566) Lazy Theta*: Any-Angle Path Planning and Path Length Analysis in 3D
|
|
874
|
-
* [S-Theta*: ](https://link.springer.com/chapter/10.1007/978-1-4471-4739-8_8) S-Theta*: low steering path-planning algorithm
|
|
875
|
-
* [Anya: ](http://www.grastien.net/ban/articles/hgoa-jair16.pdf) Optimal Any-Angle Pathfinding In Practice
|
|
876
|
-
* [RRT: ](http://msl.cs.uiuc.edu/~lavalle/papers/Lav98c.pdf) Rapidly-Exploring Random Trees: A New Tool for Path Planning
|
|
877
|
-
* [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
|
|
878
|
-
* [RRT*: ](https://journals.sagepub.com/doi/abs/10.1177/0278364911406761) Sampling-based algorithms for optimal motion planning
|
|
879
|
-
* [Informed RRT*: ](https://arxiv.org/abs/1404.2334) Optimal Sampling-based Path Planning Focused via Direct Sampling of an Admissible Ellipsoidal heuristic
|
|
880
|
-
* [ACO: ](http://www.cs.yale.edu/homes/lans/readings/routing/dorigo-ants-1999.pdf) Ant Colony Optimization: A New Meta-Heuristic
|
|
881
|
-
|
|
882
|
-
## Local Planning
|
|
883
|
-
|
|
884
|
-
* [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
|
|
885
|
-
* [APF: ](https://ieeexplore.ieee.org/document/1087247) Real-time obstacle avoidance for manipulators and mobile robots
|
|
886
|
-
* [RPP: ](https://arxiv.org/pdf/2305.20026.pdf) Regulated Pure Pursuit for Robot Path Tracking
|
|
887
|
-
* [DDPG: ](https://arxiv.org/abs/1509.02971) Continuous control with deep reinforcement learning
|
|
804
|
+
| **Polynomia** | |Not implemented
|
|
805
|
+
| **Bezier** ||Not implemented
|
|
806
|
+
| **Cubic Spline** ||Not implemented
|
|
807
|
+
| **BSpline** ||Not implemented
|
|
808
|
+
| **Dubins** ||Not implemented
|
|
809
|
+
| **Reeds-Shepp** ||Not implemented
|
|
810
|
+
| **Fem-Pos Smoother** ||Not implemented
|
|
888
811
|
|
|
889
|
-
|
|
812
|
+
# Contact
|
|
890
813
|
|
|
891
|
-
|
|
814
|
+
Long-term maintainers:
|
|
892
815
|
|
|
893
|
-
|
|
816
|
+
* [@omigeft](https://github.com/omigeft) (Wu Maojia)
|
|
817
|
+
* [@ai-winter](https://github.com/ai-winter) (Yang Haodong)
|
|
894
818
|
|
|
895
|
-
|
|
819
|
+
You can contact us via the information provided on our profile.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
|
|
2
|
+
# Introduction
|
|
3
|
+
|
|
4
|
+
`Motion planning` plans the state sequence of the robot without conflict between the start and goal.
|
|
5
|
+
|
|
6
|
+
`Motion planning` mainly includes `Path planning` and `Trajectory planning`.
|
|
7
|
+
|
|
8
|
+
* `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.
|
|
9
|
+
* `Trajectory planning`: It plans the motion state to approach the global path based on kinematics, dynamics constraints and path sequence.
|
|
10
|
+
|
|
11
|
+
The theory analysis can be found at [motion-planning](https://blog.csdn.net/frigidwinter/category_11410243.html).
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
This repository provides the implementations of common `Motion planning` algorithms. **Your stars and forks are welcome**. Submitting pull requests or joining our development team are also welcome. For trivial modification, please directly contribute to `dev` branch. For big modification, please [contact](#contact) us before you contribute.
|
|
16
|
+
|
|
17
|
+
# Quick Start
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
The source file structure is shown below
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
python_motion_planning
|
|
24
|
+
├─common
|
|
25
|
+
| ├─env
|
|
26
|
+
| | ├─map
|
|
27
|
+
| | ├─robot
|
|
28
|
+
| | └─world
|
|
29
|
+
| ├─utils
|
|
30
|
+
| └─visualizer
|
|
31
|
+
├─controller
|
|
32
|
+
| └─path_tracker
|
|
33
|
+
├─path_planner
|
|
34
|
+
| ├─graph_search
|
|
35
|
+
| └─sample_search
|
|
36
|
+
└─curve_generation
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
*(Optional)* The code was tested in python=3.10, though other similar versions should also work. We recommend using `conda` to install the dependencies.
|
|
41
|
+
|
|
42
|
+
```shell
|
|
43
|
+
conda create -n pmp python=3.10
|
|
44
|
+
conda activate pmp
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To install the repository, please run the following command in shell.
|
|
48
|
+
|
|
49
|
+
```shell
|
|
50
|
+
pip install python-motion-planning==2.0.dev1
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Run
|
|
54
|
+
|
|
55
|
+
Please refer to the Tutorials part of [online documentation](https://ai-winter.github.io/python_motion_planning/).
|
|
56
|
+
|
|
57
|
+
# Demos
|
|
58
|
+
## Path Planner
|
|
59
|
+
|
|
60
|
+
|Planner|2D Grid|3D Grid
|
|
61
|
+
|-------|-------|-------
|
|
62
|
+
**GBFS**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
63
|
+
**Dijkstra**||
|
|
64
|
+
**A\***||
|
|
65
|
+
**JPS**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
66
|
+
**D\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
67
|
+
**LPA\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
68
|
+
**D\* Lite**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
69
|
+
**Theta\***||
|
|
70
|
+
**Lazy Theta\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
71
|
+
**S-Theta\***|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
72
|
+
**Anya**|Not implemented|Not implemented
|
|
73
|
+
**Voronoi**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
74
|
+
**RRT**||
|
|
75
|
+
**RRT\***||
|
|
76
|
+
**Informed RRT**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
77
|
+
**RRT-Connect**|Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
78
|
+
| **ACO** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
79
|
+
| **GA** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
80
|
+
| **PSO** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Controller
|
|
84
|
+
|
|
85
|
+
We provide a toy simulator with simple physical simulation to test controllers (path-trakcers). The toy simulator supports multi-agents/multi-robots. The available robots include `CircularRobot` (Omnidirectional) and `DiffDriveRobot` (Only support moving forward and backward). Currently only 2D simulator is provided. 3D simulator has not been implemented.
|
|
86
|
+
|
|
87
|
+
In the following demos, the blue robot 1 is the `CircularRobot`, and the orange robot 2 is the `DiffDriveRobot`.
|
|
88
|
+
|
|
89
|
+
|Planner|2D|3D
|
|
90
|
+
|-------|-------|-------
|
|
91
|
+
|**Path Trakcer**||Not implemented
|
|
92
|
+
| **Pure Pursuit** ||Not implemented
|
|
93
|
+
| **PID** ||Not implemented
|
|
94
|
+
| **APF** ||Not implemented
|
|
95
|
+
| **DWA** ||Not implemented
|
|
96
|
+
| **RPP** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
97
|
+
| **LQR** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
98
|
+
| **MPC** |Implemented in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1), not migrated|Not implemented
|
|
99
|
+
| **MPPI** |Not implemented|Not implemented
|
|
100
|
+
| **TEB** |Not implemented|Not implemented
|
|
101
|
+
| **Lattice** |Not implemented|Not implemented
|
|
102
|
+
| **DQN** |Not implemented|Not implemented
|
|
103
|
+
| **DDPG** |Implemented in [V1.0](https://github.com/ai-winter/python_motion_planning/tree/v1.0), not migrated|Not implemented
|
|
104
|
+
|
|
105
|
+
## Curve Generator
|
|
106
|
+
|
|
107
|
+
The visualization of the curve generators has not been implemented in current version. They can be visualized in [V1.1.1](https://github.com/ai-winter/python_motion_planning/tree/v1.1.1).
|
|
108
|
+
|
|
109
|
+
| Planner |2D|3D|
|
|
110
|
+
| ------- | -------------------------------------------------------- | --------------------------------------------------------
|
|
111
|
+
| **Polynomia** | |Not implemented
|
|
112
|
+
| **Bezier** ||Not implemented
|
|
113
|
+
| **Cubic Spline** ||Not implemented
|
|
114
|
+
| **BSpline** ||Not implemented
|
|
115
|
+
| **Dubins** ||Not implemented
|
|
116
|
+
| **Reeds-Shepp** ||Not implemented
|
|
117
|
+
| **Fem-Pos Smoother** ||Not implemented
|
|
118
|
+
|
|
119
|
+
# Contact
|
|
120
|
+
|
|
121
|
+
Long-term maintainers:
|
|
122
|
+
|
|
123
|
+
* [@omigeft](https://github.com/omigeft) (Wu Maojia)
|
|
124
|
+
* [@ai-winter](https://github.com/ai-winter) (Yang Haodong)
|
|
125
|
+
|
|
126
|
+
You can contact us via the information provided on our profile.
|
|
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-motion-planning"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2.0.dev1"
|
|
8
8
|
description = "Motion planning algorithms for Python"
|
|
9
9
|
maintainers = [
|
|
10
|
-
{name = "
|
|
11
|
-
{name = "
|
|
10
|
+
{name = "Wu Maojia", email = "omige@mail.nwpu.edu.cn"},
|
|
11
|
+
{name = "Yang Haodong", email = "913982779@qq.com"}
|
|
12
12
|
]
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
license = {file = "LICENSE"}
|
|
@@ -17,9 +17,8 @@ dependencies = [
|
|
|
17
17
|
"numpy",
|
|
18
18
|
"scipy",
|
|
19
19
|
"matplotlib",
|
|
20
|
-
"cvxopt",
|
|
21
20
|
"osqp",
|
|
22
|
-
"
|
|
21
|
+
"gymnasium"
|
|
23
22
|
]
|
|
24
23
|
classifiers = [
|
|
25
24
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@file: map.py
|
|
3
|
+
@author: Wu Maojia
|
|
4
|
+
@update: 2025.10.3
|
|
5
|
+
"""
|
|
6
|
+
from typing import Iterable, Union
|
|
7
|
+
from abc import ABC, abstractmethod
|
|
8
|
+
|
|
9
|
+
import numpy as np
|
|
10
|
+
|
|
11
|
+
from python_motion_planning.common.env import Node
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BaseMap(ABC):
|
|
15
|
+
"""
|
|
16
|
+
Base class for Path Planning Map.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
bounds: The size of map in the world (shape: (n, 2) (n>=2)). bounds[i, 0] means the lower bound of the world in the i-th dimension. bounds[i, 1] means the upper bound of the world in the i-th dimension.
|
|
20
|
+
dtype: data type of coordinates
|
|
21
|
+
"""
|
|
22
|
+
def __init__(self, bounds: Iterable, dtype: np.dtype) -> None:
|
|
23
|
+
super().__init__()
|
|
24
|
+
self._bounds = np.asarray(bounds, dtype=float)
|
|
25
|
+
self._dtype = dtype
|
|
26
|
+
|
|
27
|
+
if len(self._bounds.shape) != 2 or self._bounds.shape[0] <= 1 or self._bounds.shape[1] != 2:
|
|
28
|
+
raise ValueError(f"The shape of bounds must be (n, 2) (n>=2) instead of {self._bounds.shape}")
|
|
29
|
+
|
|
30
|
+
for d in range(self._bounds.shape[0]):
|
|
31
|
+
if self._bounds[d, 0] >= self._bounds[d, 1]:
|
|
32
|
+
raise ValueError(f"The lower bound of the world in the {d}-th dimension must be smaller than the upper bound of the world in the {d}-th dimension.")
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def bounds(self) -> np.ndarray:
|
|
36
|
+
return self._bounds
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def dim(self) -> int:
|
|
40
|
+
return self._bounds.shape[0]
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def dtype(self) -> np.dtype:
|
|
44
|
+
return self._dtype
|
|
45
|
+
|
|
46
|
+
@abstractmethod
|
|
47
|
+
def map_to_world(self, point: tuple) -> tuple:
|
|
48
|
+
"""
|
|
49
|
+
Convert map coordinates to world coordinates.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
point: Point in map coordinates.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
point: Point in world coordinates.
|
|
56
|
+
"""
|
|
57
|
+
pass
|
|
58
|
+
|
|
59
|
+
@abstractmethod
|
|
60
|
+
def world_to_map(self, point: tuple) -> tuple:
|
|
61
|
+
"""
|
|
62
|
+
Convert world coordinates to map coordinates.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
point: Point in world coordinates.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
point: Point in map coordinates.
|
|
69
|
+
"""
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
@abstractmethod
|
|
73
|
+
def get_distance(self, p1: tuple, p2: tuple) -> float:
|
|
74
|
+
"""
|
|
75
|
+
Get the distance between two points.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
p1: First point.
|
|
79
|
+
p2: Second point.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
dist: Distance between two points.
|
|
83
|
+
"""
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
@abstractmethod
|
|
87
|
+
def get_neighbors(self, node: Node) -> list:
|
|
88
|
+
"""
|
|
89
|
+
Get neighbor nodes of a given node.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
node: Node to get neighbor nodes.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
nodes: List of neighbor nodes.
|
|
96
|
+
"""
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
@abstractmethod
|
|
100
|
+
def is_expandable(self, point: tuple) -> bool:
|
|
101
|
+
"""
|
|
102
|
+
Check if a point is expandable.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
point: Point to check.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
expandable: True if the point is expandable, False otherwise.
|
|
109
|
+
"""
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
@abstractmethod
|
|
113
|
+
def in_collision(self, p1: tuple, p2: tuple) -> bool:
|
|
114
|
+
"""
|
|
115
|
+
Check if the line of sight between two points is in collision.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
p1: Start point of the line.
|
|
119
|
+
p2: End point of the line.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
in_collision: True if the line of sight is in collision, False otherwise.
|
|
123
|
+
"""
|
|
124
|
+
pass
|
|
125
|
+
|