Skip to content

Commit a458b91

Browse files
committed
fix incorrect code
1 parent 621211a commit a458b91

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

ArmNavigation/two_joint_arm_to_point_control/Planar_Two_Link_IK.ipynb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"\n",
99
"![TwoJointArmToPointControl](https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/ArmNavigation/two_joint_arm_to_point_control/animation.gif)\n",
1010
"\n",
11-
"\n",
12-
"\n",
13-
"\n",
1411
"This is two joint arm to a point control simulation.\n",
1512
"\n",
1613
"This is a interactive simulation.\n",

PathPlanning/RRTStarDubins/dubins_path_planning.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88
import math
99
import matplotlib.pyplot as plt
10+
import numpy as np
1011

1112

1213
def mod2pi(theta):
@@ -224,7 +225,7 @@ def generate_course(length, mode, c):
224225

225226
for m, l in zip(mode, length):
226227
pd = 0.0
227-
if m is "S":
228+
if m == "S":
228229
d = 1.0 / c
229230
else: # turning couse
230231
d = np.deg2rad(3.0)
@@ -234,23 +235,23 @@ def generate_course(length, mode, c):
234235
px.append(px[-1] + d * c * math.cos(pyaw[-1]))
235236
py.append(py[-1] + d * c * math.sin(pyaw[-1]))
236237

237-
if m is "L": # left turn
238+
if m == "L": # left turn
238239
pyaw.append(pyaw[-1] + d)
239-
elif m is "S": # Straight
240+
elif m == "S": # Straight
240241
pyaw.append(pyaw[-1])
241-
elif m is "R": # right turn
242+
elif m == "R": # right turn
242243
pyaw.append(pyaw[-1] - d)
243244
pd += d
244245

245246
d = l - pd
246247
px.append(px[-1] + d * c * math.cos(pyaw[-1]))
247248
py.append(py[-1] + d * c * math.sin(pyaw[-1]))
248249

249-
if m is "L": # left turn
250+
if m == "L": # left turn
250251
pyaw.append(pyaw[-1] + d)
251-
elif m is "S": # Straight
252+
elif m == "S": # Straight
252253
pyaw.append(pyaw[-1])
253-
elif m is "R": # right turn
254+
elif m == "R": # right turn
254255
pyaw.append(pyaw[-1] - d)
255256
pd += d
256257

0 commit comments

Comments
 (0)