Skip to content

Commit 4676cc5

Browse files
authored
Merge pull request AtsushiSakai#214 from AtsushiSakai/develop
Fix RRT rewire bug and code clean up
2 parents c9a2bea + 7607456 commit 4676cc5

File tree

22 files changed

+1110
-1757
lines changed

22 files changed

+1110
-1757
lines changed

PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py

Lines changed: 127 additions & 123 deletions
Large diffs are not rendered by default.

PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py

Lines changed: 51 additions & 274 deletions
Large diffs are not rendered by default.

PathPlanning/DubinsPath/dubins_path_planning.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
77
"""
88
import math
9-
import numpy as np
9+
1010
import matplotlib.pyplot as plt
11+
import numpy as np
1112

1213
show_animation = True
1314

@@ -136,8 +137,8 @@ def LRL(alpha, beta, d):
136137
return t, p, q, mode
137138

138139

139-
def dubins_path_planning_from_origin(ex, ey, eyaw, c):
140-
# nomalize
140+
def dubins_path_planning_from_origin(ex, ey, eyaw, c, D_ANGLE):
141+
# normalize
141142
dx = ex
142143
dy = ey
143144
D = math.sqrt(dx ** 2.0 + dy ** 2.0)
@@ -165,12 +166,12 @@ def dubins_path_planning_from_origin(ex, ey, eyaw, c):
165166
bcost = cost
166167

167168
# print(bmode)
168-
px, py, pyaw = generate_course([bt, bp, bq], bmode, c)
169+
px, py, pyaw = generate_course([bt, bp, bq], bmode, c, D_ANGLE)
169170

170171
return px, py, pyaw, bmode, bcost
171172

172173

173-
def dubins_path_planning(sx, sy, syaw, ex, ey, eyaw, c):
174+
def dubins_path_planning(sx, sy, syaw, ex, ey, eyaw, c, D_ANGLE=np.deg2rad(10.0)):
174175
"""
175176
Dubins path plannner
176177
@@ -199,7 +200,7 @@ def dubins_path_planning(sx, sy, syaw, ex, ey, eyaw, c):
199200
leyaw = eyaw - syaw
200201

201202
lpx, lpy, lpyaw, mode, clen = dubins_path_planning_from_origin(
202-
lex, ley, leyaw, c)
203+
lex, ley, leyaw, c, D_ANGLE)
203204

204205
px = [math.cos(-syaw) * x + math.sin(-syaw)
205206
* y + sx for x, y in zip(lpx, lpy)]
@@ -210,7 +211,7 @@ def dubins_path_planning(sx, sy, syaw, ex, ey, eyaw, c):
210211
return px, py, pyaw, mode, clen
211212

212213

213-
def generate_course(length, mode, c):
214+
def generate_course(length, mode, c, D_ANGLE):
214215

215216
px = [0.0]
216217
py = [0.0]
@@ -221,7 +222,7 @@ def generate_course(length, mode, c):
221222
if m == "S":
222223
d = 1.0 * c
223224
else: # turning couse
224-
d = np.deg2rad(3.0)
225+
d = D_ANGLE
225226

226227
while pd < abs(l - d):
227228
# print(pd, l)

PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def planning(ox, oy, reso,
259259
return rx, ry
260260

261261

262-
def planning_animation(ox, oy, reso):
262+
def planning_animation(ox, oy, reso): # pragma: no cover
263263
px, py = planning(ox, oy, reso)
264264

265265
# animation
@@ -281,7 +281,7 @@ def planning_animation(ox, oy, reso):
281281
plt.pause(0.1)
282282

283283

284-
def main():
284+
def main(): # pragma: no cover
285285
print("start!!")
286286

287287
ox = [0.0, 20.0, 50.0, 100.0, 130.0, 40.0, 0.0]

0 commit comments

Comments
 (0)