Skip to content

Commit 2723a0a

Browse files
committed
fix bug of reedsshepppath
1 parent 47cd9c0 commit 2723a0a

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

PathPlanning/CRRRTStar/cr_rrt_star_car.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def DrawGraph(self, rnd=None):
349349
for (ox, oy, size) in obstacleList:
350350
plt.plot(ox, oy, "ok", ms=30 * size)
351351

352-
reeds_shepp_path_planning.plot_arrow(
352+
reeds_shepp_path_planning.plot_arro/Users/atsushisakai/Dropbox/Program/berkeley/RacerCourseOptimization/cvxpy/stanford/mpc_path_planner_common.pyw(
353353
self.start.x, self.start.y, self.start.yaw)
354354
reeds_shepp_path_planning.plot_arrow(
355355
self.end.x, self.end.y, self.end.yaw)

PathPlanning/DubinsPath/dubins_path_planning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ def LRL(alpha, beta, d):
132132
c_ab = math.cos(alpha - beta)
133133

134134
mode = ["L", "R", "L"]
135-
tmp_lrl = (6. - d * d + 2 * c_ab + 2 * d * (- sa + sb)) / 8.
135+
tmp_lrl = (6.0 - d * d + 2.0 * c_ab + 2.0 * d * (- sa + sb)) / 8.0
136136
if abs(tmp_lrl) > 1:
137137
return None, None, None, mode
138138
p = mod2pi(2 * math.pi - math.acos(tmp_lrl))
139-
t = mod2pi(-alpha - math.atan2(ca - cb, d + sa - sb) + p / 2.)
139+
t = mod2pi(-alpha - math.atan2(ca - cb, d + sa - sb) + p / 2.0)
140140
q = mod2pi(mod2pi(beta) - alpha - t + mod2pi(p))
141141

142142
return t, p, q, mode

PathPlanning/RRTStarCar_reeds_sheep/reeds_shepp_path_planning.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def plot_arrow(x, y, yaw, length=1.0, width=0.5, fc="r", ec="k"):
3030

3131
def reeds_shepp_path_planning(start_x, start_y, start_yaw,
3232
end_x, end_y, end_yaw, curvature):
33+
step_size = 0.1
3334
q0 = [start_x, start_y, start_yaw]
3435
q1 = [end_x, end_y, end_yaw]
35-
step_size = 0.1
36-
qs = reeds_shepp.path_sample(q0, q1, curvature, step_size)
36+
qs = reeds_shepp.path_sample(q0, q1, 1.0 / curvature, step_size)
3737
xs = [q[0] for q in qs]
3838
ys = [q[1] for q in qs]
3939
yaw = [q[2] for q in qs]
@@ -42,8 +42,8 @@ def reeds_shepp_path_planning(start_x, start_y, start_yaw,
4242
ys.append(end_y)
4343
yaw.append(end_yaw)
4444

45-
clen = reeds_shepp.path_length(q0, q1, curvature)
46-
pathtypeTuple = reeds_shepp.path_type(q0, q1, curvature)
45+
clen = reeds_shepp.path_length(q0, q1, 1.0 / curvature)
46+
pathtypeTuple = reeds_shepp.path_type(q0, q1, 1.0 / curvature)
4747

4848
ptype = ""
4949
for t in pathtypeTuple:

PathPlanning/RRTStarCar_reeds_sheep/rrt_star_car.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class RRT():
2222
"""
2323

2424
def __init__(self, start, goal, obstacleList, randArea,
25-
goalSampleRate=10, maxIter=2000):
25+
goalSampleRate=10, maxIter=1000):
2626
u"""
2727
Setting Parameter
2828
@@ -48,6 +48,7 @@ def Planning(self, animation=True):
4848

4949
self.nodeList = [self.start]
5050
for i in range(self.maxIter):
51+
print(i)
5152
rnd = self.get_random_point()
5253
nind = self.GetNearestListIndex(self.nodeList, rnd)
5354

@@ -317,4 +318,4 @@ def __init__(self, x, y, yaw):
317318

318319
plt.show()
319320

320-
matplotrecorder.save_movie("animation.gif", 0.1)
321+
# matplotrecorder.save_movie("animation.gif", 0.1)

0 commit comments

Comments
 (0)