Skip to content

Commit 0b1ca74

Browse files
committed
change RS path code to correct one
1 parent d700425 commit 0b1ca74

3 files changed

Lines changed: 7 additions & 92 deletions

File tree

PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
66
"""
77

8+
import sys
9+
sys.path.append("../ReedsSheppPath/")
10+
811
import random
912
import math
1013
import copy
@@ -18,6 +21,7 @@
1821

1922

2023
target_speed = 10.0 / 3.6
24+
STEP_SIZE = 0.5
2125

2226

2327
class RRT():
@@ -217,7 +221,7 @@ def steer(self, rnd, nind):
217221

218222
px, py, pyaw, mode, clen = reeds_shepp_path_planning.reeds_shepp_path_planning(
219223
nearestNode.x, nearestNode.y, nearestNode.yaw,
220-
rnd.x, rnd.y, rnd.yaw, unicycle_model.curvature_max)
224+
rnd.x, rnd.y, rnd.yaw, unicycle_model.curvature_max, STEP_SIZE)
221225

222226
newNode = copy.deepcopy(nearestNode)
223227
newNode.x = px[-1]
@@ -227,7 +231,7 @@ def steer(self, rnd, nind):
227231
newNode.path_x = px
228232
newNode.path_y = py
229233
newNode.path_yaw = pyaw
230-
newNode.cost += clen
234+
newNode.cost += sum(clen)
231235
newNode.parent = nind
232236

233237
return newNode

PathPlanning/ClosedLoopRRTStar/reeds_shepp_path_planning.py

Lines changed: 0 additions & 90 deletions
This file was deleted.

tests/test_reeds_shepp_path_planning.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ class Test(TestCase):
77
def test1(self):
88
m.show_animation = False
99
m.main()
10+
m.test()

0 commit comments

Comments
 (0)