python-motion-planning 1.0__tar.gz → 1.1.1__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.0 → python_motion_planning-1.1.1}/PKG-INFO +76 -54
- {python_motion_planning-1.0 → python_motion_planning-1.1.1}/README.md +73 -46
- {python_motion_planning-1.0 → python_motion_planning-1.1.1}/pyproject.toml +3 -9
- python_motion_planning-1.1.1/src/python_motion_planning/__init__.py +4 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/evolutionary_search/aco.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/evolutionary_search/evolutionary_search.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/evolutionary_search/pso.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/a_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/d_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/d_star_lite.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/dijkstra.py +23 -15
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/gbfs.py +23 -15
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/graph_search.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/jps.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/lazy_theta_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/lpa_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/s_theta_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/theta_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/voronoi.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/informed_rrt.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/rrt.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/rrt_connect.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/rrt_star.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/sample_search.py +3 -3
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/__init__.py +1 -5
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/environment/env.py +12 -29
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/planner/control_factory.py +0 -4
- {python_motion_planning-1.0/python_motion_planning → python_motion_planning-1.1.1/src}/python_motion_planning.egg-info/PKG-INFO +76 -54
- python_motion_planning-1.1.1/src/python_motion_planning.egg-info/SOURCES.txt +67 -0
- python_motion_planning-1.1.1/src/python_motion_planning.egg-info/requires.txt +6 -0
- python_motion_planning-1.1.1/src/python_motion_planning.egg-info/top_level.txt +1 -0
- python_motion_planning-1.0/python_motion_planning/local_planner/ddpg.py +0 -630
- python_motion_planning-1.0/python_motion_planning/local_planner/dqn.py +0 -687
- python_motion_planning-1.0/python_motion_planning/python_motion_planning.egg-info/SOURCES.txt +0 -68
- python_motion_planning-1.0/python_motion_planning/python_motion_planning.egg-info/requires.txt +0 -12
- python_motion_planning-1.0/python_motion_planning/python_motion_planning.egg-info/top_level.txt +0 -7
- {python_motion_planning-1.0 → python_motion_planning-1.1.1}/LICENSE +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1}/setup.cfg +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/bezier_curve.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/bspline_curve.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/cubic_spline.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/curve.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/dubins_curve.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/fem_pos_smooth.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/polynomial_curve.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/curve_generation/reeds_shepp.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/evolutionary_search/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/graph_search/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/global_planner/sample_search/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/apf.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/dwa.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/local_planner.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/lqr.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/mpc.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/pid.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/local_planner/rpp.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/agent/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/agent/agent.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/environment/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/environment/node.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/environment/point2d.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/environment/pose2d.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/helper/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/helper/math_helper.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/planner/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/planner/curve_factory.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/planner/planner.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/planner/search_factory.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/plot/__init__.py +0 -0
- {python_motion_planning-1.0 → python_motion_planning-1.1.1/src}/python_motion_planning/utils/plot/plot.py +0 -0
- {python_motion_planning-1.0/python_motion_planning → python_motion_planning-1.1.1/src}/python_motion_planning.egg-info/dependency_links.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-motion-planning
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Motion planning algorithms for Python
|
|
5
5
|
Maintainer-email: Yang Haodong <913982779@qq.com>, Wu Maojia <2223942063@qq.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -690,12 +690,7 @@ Requires-Dist: matplotlib
|
|
|
690
690
|
Requires-Dist: cvxopt
|
|
691
691
|
Requires-Dist: osqp
|
|
692
692
|
Requires-Dist: tqdm
|
|
693
|
-
|
|
694
|
-
Requires-Dist: torchvision
|
|
695
|
-
Requires-Dist: tensorboard==2.12.0
|
|
696
|
-
Requires-Dist: mkdocs
|
|
697
|
-
Requires-Dist: mkdocstrings
|
|
698
|
-
Requires-Dist: mkdocs-material
|
|
693
|
+
Dynamic: license-file
|
|
699
694
|
|
|
700
695
|
|
|
701
696
|
# Introduction
|
|
@@ -716,76 +711,98 @@ We also provide [ROS C++](https://github.com/ai-winter/ros_motion_planning) vers
|
|
|
716
711
|
# Quick Start
|
|
717
712
|
|
|
718
713
|
## Overview
|
|
719
|
-
The file structure is shown below
|
|
714
|
+
The source file structure is shown below
|
|
720
715
|
|
|
721
716
|
```
|
|
722
717
|
python_motion_planning
|
|
723
|
-
├─
|
|
724
|
-
├─
|
|
725
|
-
├─
|
|
726
|
-
└─
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
├─
|
|
732
|
-
├─
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
├─environment
|
|
736
|
-
├─helper
|
|
737
|
-
├─planner
|
|
738
|
-
└─plot
|
|
718
|
+
├─global_planner
|
|
719
|
+
| ├─graph_search
|
|
720
|
+
| ├─sample_search
|
|
721
|
+
| └─evolutionary_search
|
|
722
|
+
├─local_planner
|
|
723
|
+
├─curve_generation
|
|
724
|
+
└─utils
|
|
725
|
+
├─agent
|
|
726
|
+
├─environment
|
|
727
|
+
├─helper
|
|
728
|
+
├─planner
|
|
729
|
+
└─plot
|
|
739
730
|
```
|
|
731
|
+
|
|
740
732
|
* The global planning algorithm implementation is in the folder `global_planner` with `graph_search`, `sample_search` and `evolutionary search`.
|
|
733
|
+
|
|
741
734
|
* The local planning algorithm implementation is in the folder `local_planner`.
|
|
735
|
+
|
|
742
736
|
* The curve generation algorithm implementation is in the folder `curve_generation`.
|
|
743
737
|
|
|
744
|
-
##
|
|
745
|
-
The code was tested in python=3.10.
|
|
738
|
+
## Install
|
|
739
|
+
*(Optional)* The code was tested in python=3.10. We recommend using `conda` to install the dependencies.
|
|
740
|
+
|
|
741
|
+
```shell
|
|
742
|
+
conda create -n pmp python=3.10
|
|
743
|
+
conda activate pmp
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
To install the repository, please run the following command in shell.
|
|
746
747
|
|
|
747
748
|
```shell
|
|
748
|
-
pip install -
|
|
749
|
+
pip install python-motion-planning
|
|
749
750
|
```
|
|
750
751
|
|
|
751
752
|
## Run
|
|
752
753
|
Below are some simple examples.
|
|
753
754
|
|
|
754
|
-
1. Run
|
|
755
|
+
1. Run A* with discrete environment (Grid)
|
|
755
756
|
```python
|
|
756
757
|
import python_motion_planning as pmp
|
|
757
|
-
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
|
|
758
|
-
cost, path, expand = planner.plan()
|
|
759
|
-
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
760
|
-
```
|
|
761
758
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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
|
|
767
775
|
```
|
|
768
776
|
|
|
769
|
-
|
|
777
|
+
2. Run RRT with continuous environment (Map)
|
|
770
778
|
```python
|
|
771
779
|
import python_motion_planning as pmp
|
|
772
|
-
search_factory = pmp.SearchFactory()
|
|
773
|
-
planner = search_factory("a_star", start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
|
|
774
|
-
planner.run() # run both planning and animation
|
|
775
|
-
```
|
|
776
|
-
|
|
777
|
-
More examples can be found in the folder `examples`. You can also refer to the examples in the documentations generated using the following method.
|
|
778
|
-
|
|
779
|
-
## Documentation
|
|
780
780
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
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
|
|
786
801
|
```
|
|
787
802
|
|
|
788
|
-
|
|
803
|
+
More examples can be found in the folder `examples` in the repository.
|
|
804
|
+
|
|
805
|
+
For more details, you can refer to [online documentation](https://ai-winter.github.io/python_motion_planning/).
|
|
789
806
|
|
|
790
807
|
# Version
|
|
791
808
|
## Global Planner
|
|
@@ -814,6 +831,7 @@ Planner | Version
|
|
|
814
831
|
|
|
815
832
|
|
|
816
833
|
## Local Planner
|
|
834
|
+
|
|
817
835
|
| Planner | Version | Animation
|
|
818
836
|
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| --------------------------------------------------
|
|
819
837
|
| **PID** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/pid.py) | 
|
|
@@ -825,7 +843,8 @@ Planner | Version
|
|
|
825
843
|
| **MPC** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/mpc.py) | 
|
|
826
844
|
| **MPPI** |  |
|
|
827
845
|
| **Lattice** |  |
|
|
828
|
-
| **
|
|
846
|
+
| **DQN** |  |
|
|
847
|
+
| **DDPG** |  |
|
|
829
848
|
|
|
830
849
|
## Curve Generation
|
|
831
850
|
|
|
@@ -844,6 +863,7 @@ Planner | Version
|
|
|
844
863
|
|
|
845
864
|
# Papers
|
|
846
865
|
## Global Planning
|
|
866
|
+
|
|
847
867
|
* [A*: ](https://ieeexplore.ieee.org/document/4082128) A Formal Basis for the heuristic Determination of Minimum Cost Paths
|
|
848
868
|
* [JPS:](https://ojs.aaai.org/index.php/AAAI/article/view/7994) Online Graph Pruning for Pathfinding On Grid Maps
|
|
849
869
|
* [Lifelong Planning A*: ](https://www.cs.cmu.edu/~maxim/files/aij04.pdf) Lifelong Planning A*
|
|
@@ -867,7 +887,9 @@ Planner | Version
|
|
|
867
887
|
* [DDPG: ](https://arxiv.org/abs/1509.02971) Continuous control with deep reinforcement learning
|
|
868
888
|
|
|
869
889
|
## Curve Generation
|
|
890
|
+
|
|
870
891
|
* [Dubins: ]() On curves of minimal length with a constraint on average curvature, and with prescribed initial and terminal positions and tangents
|
|
871
892
|
|
|
872
893
|
# Acknowledgment
|
|
894
|
+
|
|
873
895
|
* Our visualization and animation framework of Python Version refers to [https://github.com/zhm-real/PathPlanning](https://github.com/zhm-real/PathPlanning). Thanks sincerely.
|
|
@@ -17,76 +17,98 @@ We also provide [ROS C++](https://github.com/ai-winter/ros_motion_planning) vers
|
|
|
17
17
|
# Quick Start
|
|
18
18
|
|
|
19
19
|
## Overview
|
|
20
|
-
The file structure is shown below
|
|
20
|
+
The source file structure is shown below
|
|
21
21
|
|
|
22
22
|
```
|
|
23
23
|
python_motion_planning
|
|
24
|
-
├─
|
|
25
|
-
├─
|
|
26
|
-
├─
|
|
27
|
-
└─
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
├─
|
|
33
|
-
├─
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
├─environment
|
|
37
|
-
├─helper
|
|
38
|
-
├─planner
|
|
39
|
-
└─plot
|
|
24
|
+
├─global_planner
|
|
25
|
+
| ├─graph_search
|
|
26
|
+
| ├─sample_search
|
|
27
|
+
| └─evolutionary_search
|
|
28
|
+
├─local_planner
|
|
29
|
+
├─curve_generation
|
|
30
|
+
└─utils
|
|
31
|
+
├─agent
|
|
32
|
+
├─environment
|
|
33
|
+
├─helper
|
|
34
|
+
├─planner
|
|
35
|
+
└─plot
|
|
40
36
|
```
|
|
37
|
+
|
|
41
38
|
* The global planning algorithm implementation is in the folder `global_planner` with `graph_search`, `sample_search` and `evolutionary search`.
|
|
39
|
+
|
|
42
40
|
* The local planning algorithm implementation is in the folder `local_planner`.
|
|
41
|
+
|
|
43
42
|
* The curve generation algorithm implementation is in the folder `curve_generation`.
|
|
44
43
|
|
|
45
|
-
##
|
|
46
|
-
The code was tested in python=3.10.
|
|
44
|
+
## Install
|
|
45
|
+
*(Optional)* The code was tested in python=3.10. We recommend using `conda` to install the dependencies.
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
conda create -n pmp python=3.10
|
|
49
|
+
conda activate pmp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To install the repository, please run the following command in shell.
|
|
47
53
|
|
|
48
54
|
```shell
|
|
49
|
-
pip install -
|
|
55
|
+
pip install python-motion-planning
|
|
50
56
|
```
|
|
51
57
|
|
|
52
58
|
## Run
|
|
53
59
|
Below are some simple examples.
|
|
54
60
|
|
|
55
|
-
1. Run
|
|
61
|
+
1. Run A* with discrete environment (Grid)
|
|
56
62
|
```python
|
|
57
63
|
import python_motion_planning as pmp
|
|
58
|
-
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
|
|
59
|
-
cost, path, expand = planner.plan()
|
|
60
|
-
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
61
|
-
```
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
# Create environment with custom obstacles
|
|
66
|
+
env = pmp.Grid(51, 31)
|
|
67
|
+
obstacles = env.obstacles
|
|
68
|
+
for i in range(10, 21):
|
|
69
|
+
obstacles.add((i, 15))
|
|
70
|
+
for i in range(15):
|
|
71
|
+
obstacles.add((20, i))
|
|
72
|
+
for i in range(15, 30):
|
|
73
|
+
obstacles.add((30, i))
|
|
74
|
+
for i in range(16):
|
|
75
|
+
obstacles.add((40, i))
|
|
76
|
+
env.update(obstacles)
|
|
77
|
+
|
|
78
|
+
planner = pmp.AStar(start=(5, 5), goal=(45, 25), env=env) # create planner
|
|
79
|
+
cost, path, expand = planner.plan() # plan
|
|
80
|
+
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
68
81
|
```
|
|
69
82
|
|
|
70
|
-
|
|
83
|
+
2. Run RRT with continuous environment (Map)
|
|
71
84
|
```python
|
|
72
85
|
import python_motion_planning as pmp
|
|
73
|
-
search_factory = pmp.SearchFactory()
|
|
74
|
-
planner = search_factory("a_star", start=(5, 5), goal=(45, 25), env=pmp.Grid(51, 31))
|
|
75
|
-
planner.run() # run both planning and animation
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
More examples can be found in the folder `examples`. You can also refer to the examples in the documentations generated using the following method.
|
|
79
|
-
|
|
80
|
-
## Documentation
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
# Create environment with custom obstacles
|
|
88
|
+
env = pmp.Map(51, 31)
|
|
89
|
+
obs_rect = [
|
|
90
|
+
[14, 12, 8, 2],
|
|
91
|
+
[18, 22, 8, 3],
|
|
92
|
+
[26, 7, 2, 12],
|
|
93
|
+
[32, 14, 10, 2]
|
|
94
|
+
]
|
|
95
|
+
obs_circ = [
|
|
96
|
+
[7, 12, 3],
|
|
97
|
+
[46, 20, 2],
|
|
98
|
+
[15, 5, 2],
|
|
99
|
+
[37, 7, 3],
|
|
100
|
+
[37, 23, 3]
|
|
101
|
+
]
|
|
102
|
+
env.update(obs_rect=obs_rect, obs_circ=obs_circ)
|
|
103
|
+
|
|
104
|
+
planner = pmp.RRT(start=(18, 8), goal=(37, 18), env=env) # create planner
|
|
105
|
+
cost, path, expand = planner.plan() # plan
|
|
106
|
+
planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
87
107
|
```
|
|
88
108
|
|
|
89
|
-
|
|
109
|
+
More examples can be found in the folder `examples` in the repository.
|
|
110
|
+
|
|
111
|
+
For more details, you can refer to [online documentation](https://ai-winter.github.io/python_motion_planning/).
|
|
90
112
|
|
|
91
113
|
# Version
|
|
92
114
|
## Global Planner
|
|
@@ -115,6 +137,7 @@ Planner | Version
|
|
|
115
137
|
|
|
116
138
|
|
|
117
139
|
## Local Planner
|
|
140
|
+
|
|
118
141
|
| Planner | Version | Animation
|
|
119
142
|
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| --------------------------------------------------
|
|
120
143
|
| **PID** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/pid.py) | 
|
|
@@ -126,7 +149,8 @@ Planner | Version
|
|
|
126
149
|
| **MPC** | [](https://github.com/ai-winter/python_motion_planning/blob/master/local_planner/mpc.py) | 
|
|
127
150
|
| **MPPI** |  |
|
|
128
151
|
| **Lattice** |  |
|
|
129
|
-
| **
|
|
152
|
+
| **DQN** |  |
|
|
153
|
+
| **DDPG** |  |
|
|
130
154
|
|
|
131
155
|
## Curve Generation
|
|
132
156
|
|
|
@@ -145,6 +169,7 @@ Planner | Version
|
|
|
145
169
|
|
|
146
170
|
# Papers
|
|
147
171
|
## Global Planning
|
|
172
|
+
|
|
148
173
|
* [A*: ](https://ieeexplore.ieee.org/document/4082128) A Formal Basis for the heuristic Determination of Minimum Cost Paths
|
|
149
174
|
* [JPS:](https://ojs.aaai.org/index.php/AAAI/article/view/7994) Online Graph Pruning for Pathfinding On Grid Maps
|
|
150
175
|
* [Lifelong Planning A*: ](https://www.cs.cmu.edu/~maxim/files/aij04.pdf) Lifelong Planning A*
|
|
@@ -168,7 +193,9 @@ Planner | Version
|
|
|
168
193
|
* [DDPG: ](https://arxiv.org/abs/1509.02971) Continuous control with deep reinforcement learning
|
|
169
194
|
|
|
170
195
|
## Curve Generation
|
|
196
|
+
|
|
171
197
|
* [Dubins: ]() On curves of minimal length with a constraint on average curvature, and with prescribed initial and terminal positions and tangents
|
|
172
198
|
|
|
173
199
|
# Acknowledgment
|
|
200
|
+
|
|
174
201
|
* Our visualization and animation framework of Python Version refers to [https://github.com/zhm-real/PathPlanning](https://github.com/zhm-real/PathPlanning). Thanks sincerely.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-motion-planning"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.1"
|
|
8
8
|
description = "Motion planning algorithms for Python"
|
|
9
9
|
maintainers = [
|
|
10
10
|
{name = "Yang Haodong", email = "913982779@qq.com"},
|
|
@@ -19,13 +19,7 @@ dependencies = [
|
|
|
19
19
|
"matplotlib",
|
|
20
20
|
"cvxopt",
|
|
21
21
|
"osqp",
|
|
22
|
-
"tqdm"
|
|
23
|
-
"torch",
|
|
24
|
-
"torchvision",
|
|
25
|
-
"tensorboard==2.12.0",
|
|
26
|
-
"mkdocs",
|
|
27
|
-
"mkdocstrings",
|
|
28
|
-
"mkdocs-material"
|
|
22
|
+
"tqdm"
|
|
29
23
|
]
|
|
30
24
|
classifiers = [
|
|
31
25
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
@@ -37,4 +31,4 @@ classifiers = [
|
|
|
37
31
|
Repository = "https://github.com/ai-winter/python_motion_planning"
|
|
38
32
|
|
|
39
33
|
[tool.setuptools.packages.find]
|
|
40
|
-
where = ["
|
|
34
|
+
where = ["src"]
|
|
@@ -8,7 +8,7 @@ import random
|
|
|
8
8
|
from bisect import bisect_left
|
|
9
9
|
|
|
10
10
|
from .evolutionary_search import EvolutionarySearcher
|
|
11
|
-
from python_motion_planning.utils import Env, Node
|
|
11
|
+
from python_motion_planning.utils import Env, Node, Grid
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class ACO(EvolutionarySearcher):
|
|
@@ -18,7 +18,7 @@ class ACO(EvolutionarySearcher):
|
|
|
18
18
|
Parameters:
|
|
19
19
|
start (tuple): start point coordinate
|
|
20
20
|
goal (tuple): goal point coordinate
|
|
21
|
-
env (
|
|
21
|
+
env (Grid): environment
|
|
22
22
|
heuristic_type (str): heuristic function type, default is euclidean
|
|
23
23
|
n_ants (int): number of ants
|
|
24
24
|
alpha (float): pheromone and heuristic factor weight coefficient
|
|
@@ -37,7 +37,7 @@ class ACO(EvolutionarySearcher):
|
|
|
37
37
|
References:
|
|
38
38
|
[1] Ant Colony Optimization: A New Meta-Heuristic
|
|
39
39
|
"""
|
|
40
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
40
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str = "euclidean",
|
|
41
41
|
n_ants: int = 50, alpha: float = 1.0, beta: float = 5.0, rho: float = 0.1, Q: float = 1.0,
|
|
42
42
|
max_iter: int = 100) -> None:
|
|
43
43
|
super().__init__(start, goal, env, heuristic_type)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"""
|
|
7
7
|
import math
|
|
8
8
|
|
|
9
|
-
from python_motion_planning.utils import Env, Node, Planner
|
|
9
|
+
from python_motion_planning.utils import Env, Node, Planner, Grid
|
|
10
10
|
|
|
11
11
|
class EvolutionarySearcher(Planner):
|
|
12
12
|
"""
|
|
@@ -15,10 +15,10 @@ class EvolutionarySearcher(Planner):
|
|
|
15
15
|
Parameters:
|
|
16
16
|
start (tuple): start point coordinate
|
|
17
17
|
goal (tuple): goal point coordinate
|
|
18
|
-
env (
|
|
18
|
+
env (Grid): environment
|
|
19
19
|
heuristic_type (str): heuristic function type
|
|
20
20
|
"""
|
|
21
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
21
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str="euclidean") -> None:
|
|
22
22
|
super().__init__(start, goal, env)
|
|
23
23
|
# heuristic type
|
|
24
24
|
self.heuristic_type = heuristic_type
|
|
@@ -8,7 +8,7 @@ import random, math
|
|
|
8
8
|
from copy import deepcopy
|
|
9
9
|
|
|
10
10
|
from .evolutionary_search import EvolutionarySearcher
|
|
11
|
-
from python_motion_planning.utils import Env, MathHelper
|
|
11
|
+
from python_motion_planning.utils import Env, MathHelper, Grid
|
|
12
12
|
from python_motion_planning.curve_generation import BSpline
|
|
13
13
|
|
|
14
14
|
GEN_MODE_CIRCLE = 0
|
|
@@ -22,7 +22,7 @@ class PSO(EvolutionarySearcher):
|
|
|
22
22
|
Parameters:
|
|
23
23
|
start (tuple): start point coordinate
|
|
24
24
|
goal (tuple): goal point coordinate
|
|
25
|
-
env (
|
|
25
|
+
env (Grid): environment
|
|
26
26
|
heuristic_type (str): heuristic function type
|
|
27
27
|
n_particles (int): number of particles
|
|
28
28
|
w_inertial (float): inertial weight
|
|
@@ -41,7 +41,7 @@ class PSO(EvolutionarySearcher):
|
|
|
41
41
|
>>> planner.plot.animation(path, str(planner), cost, cost_curve=cost_curve) # animation
|
|
42
42
|
>>> planner.run() # run both planning and animation
|
|
43
43
|
"""
|
|
44
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
44
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str = "euclidean",
|
|
45
45
|
n_particles: int = 300, point_num: int = 5, w_inertial: float = 1.0,
|
|
46
46
|
w_cognitive: float = 1.0, w_social: float = 1.0, max_speed: int = 6,
|
|
47
47
|
max_iter: int = 200, init_mode: int = GEN_MODE_RANDOM) -> None:
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import heapq
|
|
8
8
|
|
|
9
9
|
from .graph_search import GraphSearcher
|
|
10
|
-
from python_motion_planning.utils import Env, Node
|
|
10
|
+
from python_motion_planning.utils import Env, Grid, Node
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class AStar(GraphSearcher):
|
|
@@ -17,7 +17,7 @@ class AStar(GraphSearcher):
|
|
|
17
17
|
Parameters:
|
|
18
18
|
start (tuple): start point coordinate
|
|
19
19
|
goal (tuple): goal point coordinate
|
|
20
|
-
env (
|
|
20
|
+
env (Grid): environment
|
|
21
21
|
heuristic_type (str): heuristic function type
|
|
22
22
|
|
|
23
23
|
Examples:
|
|
@@ -30,7 +30,7 @@ class AStar(GraphSearcher):
|
|
|
30
30
|
References:
|
|
31
31
|
[1] A Formal Basis for the heuristic Determination of Minimum Cost Paths
|
|
32
32
|
"""
|
|
33
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
33
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str = "euclidean") -> None:
|
|
34
34
|
super().__init__(start, goal, env, heuristic_type)
|
|
35
35
|
|
|
36
36
|
def __str__(self) -> str:
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@update: 2024.6.23
|
|
6
6
|
"""
|
|
7
7
|
from .graph_search import GraphSearcher
|
|
8
|
-
from python_motion_planning.utils import Env, Node
|
|
8
|
+
from python_motion_planning.utils import Env, Node, Grid
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class DNode(Node):
|
|
@@ -41,7 +41,7 @@ class DStar(GraphSearcher):
|
|
|
41
41
|
Parameters:
|
|
42
42
|
start (tuple): start point coordinate
|
|
43
43
|
goal (tuple): goal point coordinate
|
|
44
|
-
env (
|
|
44
|
+
env (Grid): environment
|
|
45
45
|
|
|
46
46
|
Examples:
|
|
47
47
|
>>> import python_motion_planning as pmp
|
|
@@ -53,7 +53,7 @@ class DStar(GraphSearcher):
|
|
|
53
53
|
References:
|
|
54
54
|
[1]Optimal and Efficient Path Planning for Partially-Known Environments
|
|
55
55
|
"""
|
|
56
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
56
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid) -> None:
|
|
57
57
|
super().__init__(start, goal, env, None)
|
|
58
58
|
self.start = DNode(start, None, 'NEW', float('inf'), float("inf"))
|
|
59
59
|
self.goal = DNode(goal, None, 'NEW', 0, float('inf'))
|
|
@@ -8,7 +8,7 @@ import heapq
|
|
|
8
8
|
|
|
9
9
|
from .graph_search import GraphSearcher
|
|
10
10
|
from .lpa_star import LPAStar, LNode
|
|
11
|
-
from python_motion_planning.utils import Env
|
|
11
|
+
from python_motion_planning.utils import Env, Grid
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class DStarLite(LPAStar):
|
|
@@ -18,7 +18,7 @@ class DStarLite(LPAStar):
|
|
|
18
18
|
Parameters:
|
|
19
19
|
start (tuple): start point coordinate
|
|
20
20
|
goal (tuple): goal point coordinate
|
|
21
|
-
env (
|
|
21
|
+
env (Grid): environment
|
|
22
22
|
heuristic_type (str): heuristic function type
|
|
23
23
|
|
|
24
24
|
Examples:
|
|
@@ -31,7 +31,7 @@ class DStarLite(LPAStar):
|
|
|
31
31
|
References:
|
|
32
32
|
[1] D* Lite
|
|
33
33
|
"""
|
|
34
|
-
def __init__(self, start: tuple, goal: tuple, env:
|
|
34
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str = "euclidean") -> None:
|
|
35
35
|
GraphSearcher.__init__(self, start, goal, env, heuristic_type)
|
|
36
36
|
# start and goal
|
|
37
37
|
self.start = LNode(start, float('inf'), float('inf'), None)
|
|
@@ -7,11 +7,27 @@
|
|
|
7
7
|
import heapq
|
|
8
8
|
|
|
9
9
|
from .a_star import AStar
|
|
10
|
-
from python_motion_planning.utils import Env
|
|
10
|
+
from python_motion_planning.utils import Env, Grid
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Dijkstra(AStar):
|
|
14
|
-
|
|
14
|
+
"""
|
|
15
|
+
Class for Dijkstra motion planning.
|
|
16
|
+
|
|
17
|
+
Parameters:
|
|
18
|
+
start (tuple): start point coordinate
|
|
19
|
+
goal (tuple): goal point coordinate
|
|
20
|
+
env (Grid): environment
|
|
21
|
+
heuristic_type (str): heuristic function type
|
|
22
|
+
|
|
23
|
+
Examples:
|
|
24
|
+
>>> import python_motion_planning as pmp
|
|
25
|
+
>>> planner = pmp.Dijkstra((5, 5), (45, 25), pmp.Grid(51, 31))
|
|
26
|
+
>>> cost, path, expand = planner.plan() # planning results only
|
|
27
|
+
>>> planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
28
|
+
>>> planner.run() # run both planning and animation
|
|
29
|
+
"""
|
|
30
|
+
def __init__(self, start: tuple, goal: tuple, env: Grid, heuristic_type: str = "euclidean") -> None:
|
|
15
31
|
super().__init__(start, goal, env, heuristic_type)
|
|
16
32
|
|
|
17
33
|
def __str__(self) -> str:
|
|
@@ -19,20 +35,12 @@ class Dijkstra(AStar):
|
|
|
19
35
|
|
|
20
36
|
def plan(self) -> tuple:
|
|
21
37
|
"""
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Parameters:
|
|
25
|
-
start (tuple): start point coordinate
|
|
26
|
-
goal (tuple): goal point coordinate
|
|
27
|
-
env (Env): environment
|
|
28
|
-
heuristic_type (str): heuristic function type
|
|
38
|
+
Dijkstra motion plan function.
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
>>> planner.plot.animation(path, str(planner), cost, expand) # animation
|
|
35
|
-
>>> planner.run() # run both planning and animation
|
|
40
|
+
Returns:
|
|
41
|
+
cost (float): path cost
|
|
42
|
+
path (list): planning path
|
|
43
|
+
expand (list): all nodes that planner has searched
|
|
36
44
|
"""
|
|
37
45
|
# OPEN list (priority queue) and CLOSED list (hash table)
|
|
38
46
|
OPEN = []
|