From 4a07ec504febca513aa09189cf29e2fbbe71de07 Mon Sep 17 00:00:00 2001 From: rav4kumar Date: Fri, 13 Sep 2024 17:41:33 -0700 Subject: [PATCH] 9-9-sm --- selfdrive/car/toyota/interface.py | 8 ++++---- .../lib/longitudinal_mpc_lib/long_mpc.py | 12 ++++++------ .../controls/lib/sunnypilot/accel_controller.py | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 9cdcae57b8..b33e8336a6 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -162,9 +162,9 @@ class CarInterface(CarInterfaceBase): # hand tuned (August 12, 2024) def custom_tss2_longitudinal_tuning(): - ret.vEgoStopping = 0.01 + ret.vEgoStopping = 0.10 ret.vEgoStarting = 0.01 - ret.stoppingDecelRate = 0.1 + ret.stoppingDecelRate = 0.2 def default_tss2_longitudinal_tuning(): ret.vEgoStopping = 0.01 @@ -178,8 +178,8 @@ class CarInterface(CarInterfaceBase): tune = ret.longitudinalTuning if candidate in TSS2_CAR or ret.enableGasInterceptorDEPRECATED: if sp_tss2_long_tune: - tune.kiBP = [0., 5., 12., 20., 27., 40.] - tune.kiV = [.35, .23, .20, .17, .10, .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() diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 8aa1d223fc..3413f2bf71 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -55,17 +55,17 @@ 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: return 1.0 elif personality==custom.LongitudinalPersonalitySP.standard: - return 0.5 + return 0.8 elif personality==custom.LongitudinalPersonalitySP.moderate: - return 0.3 + return 0.5 elif personality==custom.LongitudinalPersonalitySP.aggressive: - return 0.2 + return 0.3 elif personality==custom.LongitudinalPersonalitySP.overtake: return 0.1 else: @@ -98,8 +98,8 @@ def get_dynamic_personality(v_ego, personality=custom.LongitudinalPersonalitySP. x_vel = [0, 5., 5.01, 8.33, 8.34, 27.69, 27.7] y_dist = [0.0, 1.4, 1.4, 1.4, 1.45, 1.45, 1.50] elif personality==custom.LongitudinalPersonalitySP.aggressive: - x_vel = [0, 5., 5.01, 17.0, 17.01, 27.69, 27.7] - y_dist = [0.0, 1.2, 1.2, 1.2, 1.25, 1.25, 1.3] + x_vel = [0, 5., 5.01, 17.0, 17.01, 27.69, 27.7] + y_dist = [0.0, 1.2, 1.2, 1.2, 1.25, 1.25, 1.3] else: raise NotImplementedError("Dynamic personality not supported") return np.interp(v_ego, x_vel, y_dist) diff --git a/selfdrive/controls/lib/sunnypilot/accel_controller.py b/selfdrive/controls/lib/sunnypilot/accel_controller.py index 536fe97555..91e8359d93 100644 --- a/selfdrive/controls/lib/sunnypilot/accel_controller.py +++ b/selfdrive/controls/lib/sunnypilot/accel_controller.py @@ -29,20 +29,20 @@ from openpilot.common.numpy_fast import interp AccelPersonality = custom.AccelerationPersonality # accel personality by @arne182 modified by cgw and kumar -_DP_CRUISE_MIN_V = [-0.018, -0.28, -0.76, -0.76] -_DP_CRUISE_MIN_V_ECO = [-0.018, -0.26, -0.74, -0.74] -_DP_CRUISE_MIN_V_SPORT = [-0.018, -0.30, -0.78, -0.78] -_DP_CRUISE_MIN_BP = [0., 8.0, 16., 30.] +_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.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.95, .63, .51, .36, .17] -_DP_CRUISE_MAX_V_ECO = [2.0, 1.9, 1.60, 0.89, .55, .45, .32, .09] -_DP_CRUISE_MAX_V_SPORT = [2.0, 2.0, 1.95, 1.10, .84, .70, .50, .30] -_DP_CRUISE_MAX_BP = [0., 6.0, 8., 11., 20., 25., 30., 40.] +_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] +_DP_CRUISE_MAX_V_SPORT = [2.0, 2.0, 1.95, 1.15, .84, .70, .50, .30] +_DP_CRUISE_MAX_BP = [0., 6.0, 8., 11., 20., 25., 30., 40.]