From a458b91e4fa43141c7199cc29ce45263cba8191f Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Fri, 1 Feb 2019 18:34:05 +0900 Subject: [PATCH] fix incorrect code --- .../Planar_Two_Link_IK.ipynb | 3 --- .../RRTStarDubins/dubins_path_planning.py | 15 ++++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ArmNavigation/two_joint_arm_to_point_control/Planar_Two_Link_IK.ipynb b/ArmNavigation/two_joint_arm_to_point_control/Planar_Two_Link_IK.ipynb index c692cde2..a96f0ea2 100644 --- a/ArmNavigation/two_joint_arm_to_point_control/Planar_Two_Link_IK.ipynb +++ b/ArmNavigation/two_joint_arm_to_point_control/Planar_Two_Link_IK.ipynb @@ -8,9 +8,6 @@ "\n", "![TwoJointArmToPointControl](https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/ArmNavigation/two_joint_arm_to_point_control/animation.gif)\n", "\n", - "\n", - "\n", - "\n", "This is two joint arm to a point control simulation.\n", "\n", "This is a interactive simulation.\n", diff --git a/PathPlanning/RRTStarDubins/dubins_path_planning.py b/PathPlanning/RRTStarDubins/dubins_path_planning.py index 83221c1e..22bceda7 100644 --- a/PathPlanning/RRTStarDubins/dubins_path_planning.py +++ b/PathPlanning/RRTStarDubins/dubins_path_planning.py @@ -7,6 +7,7 @@ author Atsushi Sakai (@Atsushi_twi) """ import math import matplotlib.pyplot as plt +import numpy as np def mod2pi(theta): @@ -224,7 +225,7 @@ def generate_course(length, mode, c): for m, l in zip(mode, length): pd = 0.0 - if m is "S": + if m == "S": d = 1.0 / c else: # turning couse d = np.deg2rad(3.0) @@ -234,11 +235,11 @@ def generate_course(length, mode, c): px.append(px[-1] + d * c * math.cos(pyaw[-1])) py.append(py[-1] + d * c * math.sin(pyaw[-1])) - if m is "L": # left turn + if m == "L": # left turn pyaw.append(pyaw[-1] + d) - elif m is "S": # Straight + elif m == "S": # Straight pyaw.append(pyaw[-1]) - elif m is "R": # right turn + elif m == "R": # right turn pyaw.append(pyaw[-1] - d) pd += d @@ -246,11 +247,11 @@ def generate_course(length, mode, c): px.append(px[-1] + d * c * math.cos(pyaw[-1])) py.append(py[-1] + d * c * math.sin(pyaw[-1])) - if m is "L": # left turn + if m == "L": # left turn pyaw.append(pyaw[-1] + d) - elif m is "S": # Straight + elif m == "S": # Straight pyaw.append(pyaw[-1]) - elif m is "R": # right turn + elif m == "R": # right turn pyaw.append(pyaw[-1] - d) pd += d