diff --git a/.gitmodules b/.gitmodules index a5d40c89..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +0,0 @@ -[submodule "PathTracking/rear_wheel_feedback/pycubicspline"] - path = PathTracking/rear_wheel_feedback/pycubicspline - url = https://github.com/AtsushiSakai/pycubicspline.git -[submodule "PathTracking/stanley_controller/pycubicspline"] - path = PathTracking/stanley_controller/pycubicspline - url = https://github.com/AtsushiSakai/pycubicspline -[submodule "PathTracking/lqr_speed_steer_control/pycubicspline"] - path = PathTracking/lqr_speed_steer_control/pycubicspline - url = https://github.com/AtsushiSakai/pycubicspline -[submodule "PathTracking/model_predictive_speed_and_steer_control/pycubicspline"] - path = PathTracking/model_predictive_speed_and_steer_control/pycubicspline - url = https://github.com/AtsushiSakai/pycubicspline diff --git a/PathTracking/lqr_speed_steer_control/pycubicspline b/PathTracking/lqr_speed_steer_control/pycubicspline deleted file mode 160000 index 34b741f7..00000000 --- a/PathTracking/lqr_speed_steer_control/pycubicspline +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34b741f7eee6cfbe851317ca36dab59fc560ba9a diff --git a/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py b/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py index f1fe6ae2..0028c0a8 100644 --- a/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py +++ b/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py @@ -5,12 +5,14 @@ Path tracking simulation with iterative linear model predictive control for spee author: Atsushi Sakai (@Atsushi_twi) """ +import sys +sys.path.append("../../PathPlanning/CubicSpline/") import numpy as np import math import cvxpy import matplotlib.pyplot as plt -from pycubicspline import pycubicspline +import cubic_spline_planner NX = 4 # x = x, y, v, yaw NU = 2 # a = [accel, steer] @@ -482,7 +484,8 @@ def smooth_yaw(yaw): def get_forward_course(dl): ax = [0.0, 60.0, 125.0, 50.0, 75.0, 30.0, -10.0] ay = [0.0, 0.0, 50.0, 65.0, 30.0, 50.0, -20.0] - cx, cy, cyaw, ck, s = pycubicspline.calc_spline_course(ax, ay, ds=dl) + cx, cy, cyaw, ck, s = cubic_spline_planner.calc_spline_course( + ax, ay, ds=dl) return cx, cy, cyaw, ck @@ -490,10 +493,12 @@ def get_forward_course(dl): def get_switch_back_course(dl): ax = [0.0, 30.0, 6.0, 20.0, 35.0] ay = [0.0, 0.0, 20.0, 35.0, 20.0] - cx, cy, cyaw, ck, s = pycubicspline.calc_spline_course(ax, ay, ds=dl) + cx, cy, cyaw, ck, s = cubic_spline_planner.calc_spline_course( + ax, ay, ds=dl) ax = [35.0, 10.0, 0.0, 0.0] ay = [20.0, 30.0, 5.0, 0.0] - cx2, cy2, cyaw2, ck2, s2 = pycubicspline.calc_spline_course(ax, ay, ds=dl) + cx2, cy2, cyaw2, ck2, s2 = cubic_spline_planner.calc_spline_course( + ax, ay, ds=dl) cyaw2 = [i - math.pi for i in cyaw2] cx.extend(cx2) cy.extend(cy2) diff --git a/PathTracking/model_predictive_speed_and_steer_control/pycubicspline b/PathTracking/model_predictive_speed_and_steer_control/pycubicspline deleted file mode 160000 index 34b741f7..00000000 --- a/PathTracking/model_predictive_speed_and_steer_control/pycubicspline +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 34b741f7eee6cfbe851317ca36dab59fc560ba9a diff --git a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py index 7c66dc6f..486deb6c 100644 --- a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py +++ b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py @@ -5,9 +5,13 @@ Path tracking simulation with rear wheel feedback steering control and PID speed author: Atsushi Sakai(@Atsushi_twi) """ +import sys +sys.path.append("../../PathPlanning/CubicSpline/") + import math import matplotlib.pyplot as plt -from pycubicspline import pycubicspline +import cubic_spline_planner + Kp = 1.0 # speed propotional gain # steering control parameter @@ -188,7 +192,8 @@ def main(): ay = [0.0, 0.0, 5.0, 6.5, 3.0, 5.0, -2.0] goal = [ax[-1], ay[-1]] - cx, cy, cyaw, ck, s = pycubicspline.calc_spline_course(ax, ay, ds=0.1) + cx, cy, cyaw, ck, s = cubic_spline_planner.calc_spline_course( + ax, ay, ds=0.1) target_speed = 10.0 / 3.6 sp = calc_speed_profile(cx, cy, cyaw, target_speed) diff --git a/PathTracking/stanley_controller/stanley_controller.py b/PathTracking/stanley_controller/stanley_controller.py index 0bc8504f..f287bef4 100644 --- a/PathTracking/stanley_controller/stanley_controller.py +++ b/PathTracking/stanley_controller/stanley_controller.py @@ -5,10 +5,12 @@ Path tracking simulation with Stanley steering control and PID speed control. author: Atsushi Sakai (@Atsushi_twi) """ +import sys +sys.path.append("../../PathPlanning/CubicSpline/") + import math import matplotlib.pyplot as plt - -from pycubicspline import pycubicspline +import cubic_spline_planner k = 0.5 # control gain @@ -100,7 +102,8 @@ def main(): ax = [0.0, 100.0, 100.0, 50.0, 60.0] ay = [0.0, 0.0, -30.0, -20.0, 0.0] - cx, cy, cyaw, ck, s = pycubicspline.calc_spline_course(ax, ay, ds=0.1) + cx, cy, cyaw, ck, s = cubic_spline_planner.calc_spline_course( + ax, ay, ds=0.1) target_speed = 30.0 / 3.6 # [m/s]