From 97f0405ab770948e53a0fd9b7159fb36172c9b8b Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Wed, 24 Oct 2018 18:30:52 +0900 Subject: [PATCH] replace math.degrees to np.rad2deg --- PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py | 4 ++-- PathPlanning/CubicSpline/cubic_spline_planner.py | 2 +- PathPlanning/DubinsPath/dubins_path_planning.py | 2 +- PathPlanning/FrenetOptimalTrajectory/cubic_spline_planner.py | 2 +- .../QuinticPolynomialsPlanner/quintic_polynomials_planner.py | 2 +- PathPlanning/RRTDubins/dubins_path_planning.py | 2 +- PathPlanning/RRTStarDubins/dubins_path_planning.py | 2 +- .../lqr_speed_steer_control/lqr_speed_steer_control.py | 2 +- PathTracking/lqr_steer_control/lqr_steer_control.py | 2 +- PathTracking/rear_wheel_feedback/rear_wheel_feedback.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py b/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py index ec369325..8199c2d9 100644 --- a/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py +++ b/PathPlanning/ClosedLoopRRTStar/closed_loop_rrt_star_car.py @@ -436,7 +436,7 @@ def main(): plt.pause(0.001) flg, ax = plt.subplots(1) - plt.plot(t, [math.degrees(iyaw) for iyaw in yaw[:-1]], '-r') + plt.plot(t, [np.rad2deg(iyaw) for iyaw in yaw[:-1]], '-r') plt.xlabel("time[s]") plt.ylabel("Yaw[deg]") plt.grid(True) @@ -455,7 +455,7 @@ def main(): plt.grid(True) flg, ax = plt.subplots(1) - plt.plot(t, [math.degrees(td) for td in d], '-r') + plt.plot(t, [np.rad2deg(td) for td in d], '-r') plt.xlabel("time[s]") plt.ylabel("Steering angle[deg]") plt.grid(True) diff --git a/PathPlanning/CubicSpline/cubic_spline_planner.py b/PathPlanning/CubicSpline/cubic_spline_planner.py index 6483a8bf..cffe1c3b 100644 --- a/PathPlanning/CubicSpline/cubic_spline_planner.py +++ b/PathPlanning/CubicSpline/cubic_spline_planner.py @@ -219,7 +219,7 @@ def main(): plt.legend() flg, ax = plt.subplots(1) - plt.plot(s, [math.degrees(iyaw) for iyaw in ryaw], "-r", label="yaw") + plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]") diff --git a/PathPlanning/DubinsPath/dubins_path_planning.py b/PathPlanning/DubinsPath/dubins_path_planning.py index 3f04249d..6063290e 100644 --- a/PathPlanning/DubinsPath/dubins_path_planning.py +++ b/PathPlanning/DubinsPath/dubins_path_planning.py @@ -37,7 +37,7 @@ def LSL(alpha, beta, d): t = mod2pi(-alpha + tmp1) p = math.sqrt(p_squared) q = mod2pi(beta - tmp1) - # print(math.degrees(t), p, math.degrees(q)) + # print(np.rad2deg(t), p, np.rad2deg(q)) return t, p, q, mode diff --git a/PathPlanning/FrenetOptimalTrajectory/cubic_spline_planner.py b/PathPlanning/FrenetOptimalTrajectory/cubic_spline_planner.py index d1df728c..490098ff 100644 --- a/PathPlanning/FrenetOptimalTrajectory/cubic_spline_planner.py +++ b/PathPlanning/FrenetOptimalTrajectory/cubic_spline_planner.py @@ -219,7 +219,7 @@ def main(): plt.legend() flg, ax = plt.subplots(1) - plt.plot(s, [math.degrees(iyaw) for iyaw in ryaw], "-r", label="yaw") + plt.plot(s, [np.rad2deg(iyaw) for iyaw in ryaw], "-r", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]") diff --git a/PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py b/PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py index 1fa331bc..ffa7a88e 100644 --- a/PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py +++ b/PathPlanning/QuinticPolynomialsPlanner/quintic_polynomials_planner.py @@ -201,7 +201,7 @@ def main(): plt.plot(x, y, "-r") plt.subplots() - plt.plot(time, [math.degrees(i) for i in yaw], "-r") + plt.plot(time, [np.rad2deg(i) for i in yaw], "-r") plt.xlabel("Time[s]") plt.ylabel("Yaw[deg]") plt.grid(True) diff --git a/PathPlanning/RRTDubins/dubins_path_planning.py b/PathPlanning/RRTDubins/dubins_path_planning.py index 43186a85..915d81e8 100644 --- a/PathPlanning/RRTDubins/dubins_path_planning.py +++ b/PathPlanning/RRTDubins/dubins_path_planning.py @@ -38,7 +38,7 @@ def LSL(alpha, beta, d): t = mod2pi(-alpha + tmp1) p = math.sqrt(p_squared) q = mod2pi(beta - tmp1) - # print(math.degrees(t), p, math.degrees(q)) + # print(np.rad2deg(t), p, np.rad2deg(q)) return t, p, q, mode diff --git a/PathPlanning/RRTStarDubins/dubins_path_planning.py b/PathPlanning/RRTStarDubins/dubins_path_planning.py index 71860274..35ed991d 100644 --- a/PathPlanning/RRTStarDubins/dubins_path_planning.py +++ b/PathPlanning/RRTStarDubins/dubins_path_planning.py @@ -33,7 +33,7 @@ def LSL(alpha, beta, d): t = mod2pi(-alpha + tmp1) p = math.sqrt(p_squared) q = mod2pi(beta - tmp1) - # print(math.degrees(t), p, math.degrees(q)) + # print(np.rad2deg(t), p, np.rad2deg(q)) return t, p, q, mode diff --git a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py index ee2e7470..23ee89b9 100644 --- a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py +++ b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py @@ -272,7 +272,7 @@ def main(): plt.legend() flg, ax = plt.subplots(1) - plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") + plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]") diff --git a/PathTracking/lqr_steer_control/lqr_steer_control.py b/PathTracking/lqr_steer_control/lqr_steer_control.py index bc29e25b..ece3e97b 100644 --- a/PathTracking/lqr_steer_control/lqr_steer_control.py +++ b/PathTracking/lqr_steer_control/lqr_steer_control.py @@ -271,7 +271,7 @@ def main(): plt.legend() flg, ax = plt.subplots(1) - plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") + plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]") diff --git a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py index 19dff265..d75fcfed 100644 --- a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py +++ b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py @@ -219,7 +219,7 @@ def main(): plt.legend() flg, ax = plt.subplots(1) - plt.plot(s, [math.degrees(iyaw) for iyaw in cyaw], "-r", label="yaw") + plt.plot(s, [np.rad2deg(iyaw) for iyaw in cyaw], "-r", label="yaw") plt.grid(True) plt.legend() plt.xlabel("line length[m]")