Skip to content

Commit 73e1c0b

Browse files
authored
Add "Code Link" sections and rename classes for consistency (#1214)
This commit adds "Code Link" sections to documentation across various path planning modules, linking to relevant class and function APIs. Additionally, several class renaming changes were made, such as `Dijkstra` to `DijkstraPlanner` and `eta3_trajectory` to `Eta3SplineTrajectory`, to enhance naming consistency. Minor fixes include file restructuring and image renaming for the RRT module.
1 parent a38da41 commit 73e1c0b

File tree

33 files changed

+277
-25
lines changed

33 files changed

+277
-25
lines changed

PathPlanning/Dijkstra/dijkstra.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
show_animation = True
1313

1414

15-
class Dijkstra:
15+
class DijkstraPlanner:
1616

1717
def __init__(self, ox, oy, resolution, robot_radius):
1818
"""
@@ -246,7 +246,7 @@ def main():
246246
plt.grid(True)
247247
plt.axis("equal")
248248

249-
dijkstra = Dijkstra(ox, oy, grid_size, robot_radius)
249+
dijkstra = DijkstraPlanner(ox, oy, grid_size, robot_radius)
250250
rx, ry = dijkstra.planning(sx, sy, gx, gy)
251251

252252
if show_animation: # pragma: no cover

PathPlanning/Eta3SplineTrajectory/eta3_spline_trajectory.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, actual_vel, max_vel):
2929
self.message = f'Actual velocity {actual_vel} does not equal desired max velocity {max_vel}!'
3030

3131

32-
class eta3_trajectory(Eta3Path):
32+
class Eta3SplineTrajectory(Eta3Path):
3333
"""
3434
eta3_trajectory
3535
@@ -300,8 +300,8 @@ def test1(max_vel=0.5):
300300
trajectory_segments.append(Eta3PathSegment(
301301
start_pose=start_pose, end_pose=end_pose, eta=eta, kappa=kappa))
302302

303-
traj = eta3_trajectory(trajectory_segments,
304-
max_vel=max_vel, max_accel=0.5)
303+
traj = Eta3SplineTrajectory(trajectory_segments,
304+
max_vel=max_vel, max_accel=0.5)
305305

306306
# interpolate at several points along the path
307307
times = np.linspace(0, traj.total_time, 101)
@@ -334,8 +334,8 @@ def test2(max_vel=0.5):
334334
trajectory_segments.append(Eta3PathSegment(
335335
start_pose=start_pose, end_pose=end_pose, eta=eta, kappa=kappa))
336336

337-
traj = eta3_trajectory(trajectory_segments,
338-
max_vel=max_vel, max_accel=0.5)
337+
traj = Eta3SplineTrajectory(trajectory_segments,
338+
max_vel=max_vel, max_accel=0.5)
339339

340340
# interpolate at several points along the path
341341
times = np.linspace(0, traj.total_time, 101)
@@ -400,8 +400,8 @@ def test3(max_vel=2.0):
400400
start_pose=start_pose, end_pose=end_pose, eta=eta, kappa=kappa))
401401

402402
# construct the whole path
403-
traj = eta3_trajectory(trajectory_segments,
404-
max_vel=max_vel, max_accel=0.5, max_jerk=1)
403+
traj = Eta3SplineTrajectory(trajectory_segments,
404+
max_vel=max_vel, max_accel=0.5, max_jerk=1)
405405

406406
# interpolate at several points along the path
407407
times = np.linspace(0, traj.total_time, 1001)

docs/modules/5_path_planning/bezier_path/bezier_path_main.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ You can get different Beizer course:
1313

1414
.. image:: Figure_2.png
1515

16+
Code Link
17+
~~~~~~~~~~~~~~~
18+
19+
.. autofunction:: PathPlanning.BezierPath.bezier_path.calc_4points_bezier_path
20+
21+
1622
Reference
23+
~~~~~~~~~~~~~~~
1724

1825
- `Continuous Curvature Path Generation Based on Bezier Curves for
1926
Autonomous
20-
Vehicles <https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=b00b657c3e0e828c589132a14825e7119772003d>`
27+
Vehicles <https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=b00b657c3e0e828c589132a14825e7119772003d>`__

docs/modules/5_path_planning/bspline_path/bspline_path_main.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ The default spline degree is 3, so curvature changes smoothly.
105105

106106
.. image:: interp_and_curvature.png
107107

108-
API
109-
++++
108+
Code link
109+
++++++++++
110110

111111
.. autofunction:: PathPlanning.BSplinePath.bspline_path.interpolate_b_spline_path
112112

@@ -133,8 +133,8 @@ The default spline degree is 3, so curvature changes smoothly.
133133

134134
.. image:: approx_and_curvature.png
135135

136-
API
137-
++++
136+
Code Link
137+
++++++++++
138138

139139
.. autofunction:: PathPlanning.BSplinePath.bspline_path.approximate_b_spline_path
140140

docs/modules/5_path_planning/bugplanner/bugplanner_main.rst

+8
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ This is a 2D planning with Bug algorithm.
55

66
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/BugPlanner/animation.gif
77

8+
Code Link
9+
~~~~~~~~~~~~~~~
10+
11+
.. autofunction:: PathPlanning.BugPlanning.bug.main
12+
13+
Reference
14+
~~~~~~~~~~~~
15+
816
- `ECE452 Bug Algorithms <https://web.archive.org/web/20201103052224/https://sites.google.com/site/ece452bugalgorithms/>`_

docs/modules/5_path_planning/catmull_rom_spline/catmull_rom_spline_main.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Catmull-Rom Spline API
8888

8989
This section provides an overview of the functions used for Catmull-Rom spline path planning.
9090

91-
API
92-
++++
91+
Code Link
92+
++++++++++
9393

9494
.. autofunction:: PathPlanning.Catmull_RomSplinePath.catmull_rom_spline_path.catmull_rom_point
9595

docs/modules/5_path_planning/clothoid_path/clothoid_path_main.rst

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ The final clothoid path can be calculated with the path parameters and Fresnel i
7373
&y(s)=y_{0}+\int_{0}^{s} \sin \left(\frac{1}{2} \kappa^{\prime} \tau^{2}+\kappa \tau+\vartheta_{0}\right) \mathrm{d} \tau
7474
\end{aligned}
7575
76+
Code Link
77+
~~~~~~~~~~~~~
78+
79+
.. autofunction:: PathPlanning.ClothoidPath.clothoid_path_planner.generate_clothoid_path
80+
7681

7782
References
7883
~~~~~~~~~~

docs/modules/5_path_planning/coverage_path/coverage_path_main.rst

+21
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ This is a 2D grid based sweep coverage path planner simulation:
88

99
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/GridBasedSweepCPP/animation.gif
1010

11+
Code Link
12+
+++++++++++++
13+
14+
.. autofunction:: PathPlanning.GridBasedSweepCPP.grid_based_sweep_coverage_path_planner.planning
15+
1116
Spiral Spanning Tree
1217
~~~~~~~~~~~~~~~~~~~~
1318

@@ -17,6 +22,14 @@ This is a 2D grid based spiral spanning tree coverage path planner simulation:
1722
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/SpiralSpanningTreeCPP/animation2.gif
1823
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/SpiralSpanningTreeCPP/animation3.gif
1924

25+
Code Link
26+
+++++++++++++
27+
28+
.. autofunction:: PathPlanning.SpiralSpanningTreeCPP.spiral_spanning_tree_coverage_path_planner.main
29+
30+
Reference
31+
+++++++++++++
32+
2033
- `Spiral-STC: An On-Line Coverage Algorithm of Grid Environments by a Mobile Robot <https://ieeexplore.ieee.org/abstract/document/1013479>`_
2134

2235

@@ -29,6 +42,14 @@ This is a 2D grid based wavefront coverage path planner simulation:
2942
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/WavefrontCPP/animation2.gif
3043
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/WavefrontCPP/animation3.gif
3144

45+
Code Link
46+
+++++++++++++
47+
48+
.. autofunction:: PathPlanning.WavefrontCPP.wavefront_coverage_path_planner.wavefront
49+
50+
Reference
51+
+++++++++++++
52+
3253
- `Planning paths of complete coverage of an unstructured environment by a mobile robot <https://pinkwink.kr/attachment/[email protected]>`_
3354

3455

docs/modules/5_path_planning/cubic_spline/cubic_spline_main.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ the second derivative by:
171171

172172
These equations can be calculated by differentiating the cubic polynomial.
173173

174-
API
175-
===
174+
Code Link
175+
==========
176176

177177
This is the 1D cubic spline class API:
178178

@@ -199,8 +199,8 @@ Curvature of each point can be also calculated analytically by:
199199

200200
:math:`\kappa=\frac{y^{\prime \prime} x^{\prime}-x^{\prime \prime} y^{\prime}}{\left(x^{\prime2}+y^{\prime2}\right)^{\frac{2}{3}}}`
201201

202-
API
203-
===
202+
Code Link
203+
==========
204204

205205
.. autoclass:: PathPlanning.CubicSpline.cubic_spline_planner.CubicSpline2D
206206
:members:

docs/modules/5_path_planning/dubins_path/dubins_path_main.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You can generate a path from these information and the maximum curvature informa
6262
A path type which has minimum course length among 6 types is selected,
6363
and then a path is constructed based on the selected type and its distances.
6464

65-
API
65+
Code Link
6666
~~~~~~~~~~~~~~~~~~~~
6767

6868
.. autofunction:: PathPlanning.DubinsPath.dubins_path_planner.plan_dubins_path

docs/modules/5_path_planning/dynamic_window_approach/dynamic_window_approach_main.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ Dynamic Window Approach
55

66
This is a 2D navigation sample code with Dynamic Window Approach.
77

8+
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/DynamicWindowApproach/animation.gif
9+
10+
Code Link
11+
+++++++++++++
12+
13+
.. autofunction:: PathPlanning.DynamicWindowApproach.dynamic_window_approach.dwa_control
14+
15+
16+
Reference
17+
~~~~~~~~~~~~
18+
819
- `The Dynamic Window Approach to Collision
920
Avoidance <https://www.ri.cmu.edu/pub_files/pub1/fox_dieter_1997_1/fox_dieter_1997_1.pdf>`__
1021

11-
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/DynamicWindowApproach/animation.gif

docs/modules/5_path_planning/elastic_bands/elastic_bands_main.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ This is a path planning with Elastic Bands.
55

66
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/ElasticBands/animation.gif
77

8+
Code Link
9+
+++++++++++++
10+
11+
.. autoclass:: PathPlanning.ElasticBands.elastic_bands.ElasticBands
12+
813

914
Core Concept
1015
~~~~~~~~~~~~
@@ -69,6 +74,6 @@ Dynamic Path Maintenance
6974
- Remove redundant nodes if adjacent nodes are too close
7075

7176
References
72-
~~~~~~~~~~~~~~~~~~~~~~~
77+
+++++++++++++
7378

7479
- `Elastic Bands: Connecting Path Planning and Control <http://www8.cs.umu.se/research/ifor/dl/Control/elastic%20bands.pdf>`__

docs/modules/5_path_planning/eta3_spline/eta3_spline_main.rst

+7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ Eta^3 Spline path planning
77

88
This is a path planning with Eta^3 spline.
99

10+
Code Link
11+
~~~~~~~~~~~~~~~
12+
13+
.. autoclass:: PathPlanning.Eta3SplineTrajectory.eta3_spline_trajectory.Eta3SplineTrajectory
14+
15+
1016
Reference
17+
~~~~~~~~~~~~~~~
1118

1219
- `\\eta^3-Splines for the Smooth Path Generation of Wheeled Mobile
1320
Robots <https://ieeexplore.ieee.org/document/4339545/>`__

docs/modules/5_path_planning/frenet_frame_path/frenet_frame_path_main.rst

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ The cyan line is the target course and black crosses are obstacles.
77

88
The red line is predicted path.
99

10+
Code Link
11+
~~~~~~~~~~~~~~
12+
13+
.. autofunction:: PathPlanning.FrenetOptimalTrajectory.frenet_optimal_trajectory.main
14+
15+
1016
High Speed and Velocity Keeping Scenario
1117
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1218

docs/modules/5_path_planning/grid_base_search/grid_base_search_main.rst

+50
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ This is a 2D grid based path planning with Breadth first search algorithm.
1010

1111
In the animation, cyan points are searched nodes.
1212

13+
Code Link
14+
+++++++++++++
15+
16+
.. autofunction:: PathPlanning.BreadthFirstSearch.breadth_first_search.BreadthFirstSearchPlanner
17+
18+
1319
Depth First Search
1420
~~~~~~~~~~~~~~~~~~~~
1521

@@ -19,6 +25,12 @@ This is a 2D grid based path planning with Depth first search algorithm.
1925

2026
In the animation, cyan points are searched nodes.
2127

28+
Code Link
29+
+++++++++++++
30+
31+
.. autofunction:: PathPlanning.DepthFirstSearch.depth_first_search.DepthFirstSearchPlanner
32+
33+
2234
.. _dijkstra:
2335

2436
Dijkstra algorithm
@@ -30,6 +42,12 @@ This is a 2D grid based shortest path planning with Dijkstra's algorithm.
3042

3143
In the animation, cyan points are searched nodes.
3244

45+
Code Link
46+
+++++++++++++
47+
48+
.. autofunction:: PathPlanning.Dijkstra.dijkstra.DijkstraPlanner
49+
50+
3351
.. _a*-algorithm:
3452

3553
A\* algorithm
@@ -43,6 +61,12 @@ In the animation, cyan points are searched nodes.
4361

4462
Its heuristic is 2D Euclid distance.
4563

64+
Code Link
65+
+++++++++++++
66+
67+
.. autofunction:: PathPlanning.AStar.a_star.AStarPlanner
68+
69+
4670
Bidirectional A\* algorithm
4771
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4872

@@ -52,6 +76,12 @@ This is a 2D grid based shortest path planning with bidirectional A star algorit
5276

5377
In the animation, cyan points are searched nodes.
5478

79+
Code Link
80+
+++++++++++++
81+
82+
.. autofunction:: PathPlanning.BidirectionalAStar.bidirectional_a_star.BidirectionalAStarPlanner
83+
84+
5585
.. _D*-algorithm:
5686

5787
D\* algorithm
@@ -63,7 +93,14 @@ This is a 2D grid based shortest path planning with D star algorithm.
6393

6494
The animation shows a robot finding its path avoiding an obstacle using the D* search algorithm.
6595

96+
Code Link
97+
+++++++++++++
98+
99+
.. autoclass:: PathPlanning.DStar.dstar.Dstar
100+
101+
66102
Reference
103+
++++++++++++
67104

68105
- `D* search Wikipedia <https://en.wikipedia.org/wiki/D*>`__
69106

@@ -74,7 +111,13 @@ This is a 2D grid based path planning and replanning with D star lite algorithm.
74111

75112
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/DStarLite/animation.gif
76113

114+
Code Link
115+
+++++++++++++
116+
117+
.. autoclass:: PathPlanning.DStarLite.d_star_lite.DStarLite
118+
77119
Reference
120+
++++++++++++
78121

79122
- `Improved Fast Replanning for Robot Navigation in Unknown Terrain <http://www.cs.cmu.edu/~maxim/files/dlite_icra02.pdf>`_
80123

@@ -88,7 +131,14 @@ This is a 2D grid based path planning with Potential Field algorithm.
88131

89132
In the animation, the blue heat map shows potential value on each grid.
90133

134+
Code Link
135+
+++++++++++++
136+
137+
.. autofunction:: PathPlanning.PotentialFieldPlanning.potential_field_planning.potential_field_planning
138+
139+
91140
Reference
141+
++++++++++++
92142

93143
- `Robotic Motion Planning:Potential
94144
Functions <https://www.cs.cmu.edu/~motionplanning/lecture/Chap4-Potential-Field_howie.pdf>`__

docs/modules/5_path_planning/hybridastar/hybridastar_main.rst

+5
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ Hybrid a star
44
This is a simple vehicle model based hybrid A\* path planner.
55

66
.. image:: https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/PathPlanning/HybridAStar/animation.gif
7+
8+
Code Link
9+
+++++++++++++
10+
11+
.. autofunction:: PathPlanning.HybridAStar.hybrid_a_star.hybrid_a_star_planning

0 commit comments

Comments
 (0)