From 0b4170dcc2b31dd2463493f63f4032d01208f3ed Mon Sep 17 00:00:00 2001 From: Kumar <36933347+rav4kumar@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:39:25 -0700 Subject: [PATCH] gd --- selfdrive/car/toyota/interface.py | 10 +++++---- .../lib/longitudinal_mpc_lib/long_mpc.py | 2 +- .../lib/sunnypilot/accel_controller.py | 21 +++++++------------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index c862f5d130..e1ed15812f 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -178,12 +178,14 @@ class CarInterface(CarInterfaceBase): tune = ret.longitudinalTuning if candidate in TSS2_CAR or ret.enableGasInterceptorDEPRECATED: if sp_tss2_long_tune: - tune.kiBP = [0., 1., 8., 12., 20., 27., 40.] - tune.kiV = [.35, .3162, .1965, .1965, .184, .101, .06] + tune.kiBP = [0., 5., 12., 20., 27., 40.] + tune.kiV = [.35, .2286, .2086, .1716, .10, .06] + #tune.kiBP = [0., 1., 8., 12., 20., 27., 40.] + #tune.kiV = [.35, .3168, .1965, .1965, .184, .101, .06] custom_tss2_longitudinal_tuning() else: - tune.kiBP = [5., 35.] - tune.kiV = [1.5, 0.5] + tune.kpBP = [0., 5., 20.] + tune.kpV = [2.3, 1.0, 0.7] if candidate in TSS2_CAR: default_tss2_longitudinal_tuning() else: diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index d714c7c720..c3d5376ab5 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -55,7 +55,7 @@ T_IDXS = np.array(T_IDXS_LST) FCW_IDXS = T_IDXS < 5.0 T_DIFFS = np.diff(T_IDXS, prepend=[0.]) COMFORT_BRAKE = 2.5 -STOP_DISTANCE = 6.0 +STOP_DISTANCE = 5.0 def get_jerk_factor(personality=custom.LongitudinalPersonalitySP.standard): if personality==custom.LongitudinalPersonalitySP.relaxed: diff --git a/selfdrive/controls/lib/sunnypilot/accel_controller.py b/selfdrive/controls/lib/sunnypilot/accel_controller.py index f096f11986..c1fde85557 100644 --- a/selfdrive/controls/lib/sunnypilot/accel_controller.py +++ b/selfdrive/controls/lib/sunnypilot/accel_controller.py @@ -29,20 +29,15 @@ from openpilot.common.numpy_fast import interp AccelPersonality = custom.AccelerationPersonality # accel personality by @arne182 modified by cgw and kumar -#_DP_CRUISE_MIN_V = [-1.0, -1.0] -#_DP_CRUISE_MIN_V_ECO = [-1.0, -1.0] -#_DP_CRUISE_MIN_V_SPORT = [-1.0, -1.0] -#_DP_CRUISE_MIN_BP = [0., 40.] +_DP_CRUISE_MIN_V = [-0.45, -0.45, -0.25, -0.25, -0.38, -0.38, -1.00] +_DP_CRUISE_MIN_V_ECO = [-0.40, -0.40, -0.20, -0.20, -0.36, -0.36, -1.00] +_DP_CRUISE_MIN_V_SPORT = [-0.50, -0.50, -0.30, -0.30, -0.42, -0.42, -1.00] +_DP_CRUISE_MIN_BP = [0., 0.05, 3.12, 10., 10.01, 20., 30., 55.] -#_DP_CRUISE_MIN_V = [-0.95, -0.95, -0.45, -0.45, -0.50, -0.50, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.0, -1.0] -#_DP_CRUISE_MIN_V_ECO = [-0.90, -0.90, -0.40, -0.40, -0.40, -0.40, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.0, -1.0] -#_DP_CRUISE_MIN_V_SPORT = [-1.00, -1.00, -0.50, -0.50, -0.60, -0.60, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.0, -1.0] -#_DP_CRUISE_MIN_BP = [0., 5.0, 5.01, 8.0, 8.01, 12.10, 12.11, 16., 16.01, 20., 20.01, 25., 25.01, 30.] - -_DP_CRUISE_MIN_V = [-0.09, -0.09, -0.09, -0.09, -0.20, -0.20, -0.35, -0.35, -0.54, -0.54, -0.79, -0.79, -1.0, -1.0] -_DP_CRUISE_MIN_V_ECO = [-0.08, -0.08, -0.08, -0.08, -0.19, -0.19, -0.34, -0.34, -0.52, -0.52, -0.78, -0.78, -1.0, -1.0] -_DP_CRUISE_MIN_V_SPORT = [-0.10, -0.10, -0.10, -0.10, -0.21, -0.21, -0.36, -0.36, -0.56, -0.56, -0.80, -0.80, -1.0, -1.0] -_DP_CRUISE_MIN_BP = [0., 4.0, 4.01, 7.0, 7.01, 12., 12.01, 16., 16.01, 20., 20.01, 25., 25.01, 30.] +#_DP_CRUISE_MIN_V = [-0.09, -0.09, -0.09, -0.09, -0.20, -0.20, -0.35, -0.35, -0.54, -0.54, -0.79, -0.79, -1.0, -1.0] +#_DP_CRUISE_MIN_V_ECO = [-0.08, -0.08, -0.08, -0.08, -0.19, -0.19, -0.34, -0.34, -0.52, -0.52, -0.78, -0.78, -1.0, -1.0] +#_DP_CRUISE_MIN_V_SPORT = [-0.10, -0.10, -0.10, -0.10, -0.21, -0.21, -0.36, -0.36, -0.56, -0.56, -0.80, -0.80, -1.0, -1.0] +#_DP_CRUISE_MIN_BP = [0., 4.0, 4.01, 7.0, 7.01, 12., 12.01, 16., 16.01, 20., 20.01, 25., 25.01, 30.] _DP_CRUISE_MAX_V = [2.0, 2.0, 1.75, 0.96, .64, .54, .38, .17] _DP_CRUISE_MAX_V_ECO = [2.0, 1.9, 1.60, 0.89, .55, .45, .32, .09]