This commit is contained in:
Kumar
2024-08-29 16:33:57 -07:00
committed by GitHub
parent 3c04bc747d
commit eb3d99fcd5
3 changed files with 10 additions and 13 deletions
+3 -6
View File
@@ -164,22 +164,19 @@ class CarInterface(CarInterfaceBase):
def custom_tss2_longitudinal_tuning():
ret.vEgoStopping = 0.01
ret.vEgoStarting = 0.01
ret.stoppingDecelRate = 0.0074
ret.stoppingDecelRate = 0.007
def default_tss2_longitudinal_tuning():
ret.vEgoStopping = 0.25
ret.vEgoStarting = 0.25
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly
def default_longitudinal_tuning():
tune.kiBP = [0., 5., 35.]
tune.kiV = [3.6, 2.4, 1.5]
tune = ret.longitudinalTuning
if candidate in TSS2_CAR or ret.enableGasInterceptorDEPRECATED:
if sp_tss2_long_tune:
tune.kiBP = [0., 5., 8., 12., 20., 27., 36., 50]
tune.kiV = [0.35, 0.2294, 0.2212, 0.2054, 0.172, 0.12, 0.08, 0.06]
tune.kiBP = [ 0., 5., 12., 20., 27., 40.]
tune.kiV = [.35, .228, .205, .195, .10, .01]
custom_tss2_longitudinal_tuning()
else:
tune.kpV = [0.0]
@@ -91,16 +91,16 @@ def get_T_FOLLOW(personality=custom.LongitudinalPersonalitySP.standard):
def get_dynamic_personality(v_ego, personality=custom.LongitudinalPersonalitySP.standard):
if personality==custom.LongitudinalPersonalitySP.relaxed:
x_vel = [0, 5., 5.01, 20., 27.7]
y_dist = [1.0, 1.0, 1.75, 1.75, 1.83]
y_dist = [0.0, 1.0, 1.75, 1.75, 1.83]
elif personality==custom.LongitudinalPersonalitySP.standard:
x_vel = [0, 20., 27.7]
y_dist = [1.70, 1.70, 1.70]
y_dist = [0.0, 1.70, 1.70]
elif personality==custom.LongitudinalPersonalitySP.moderate:
x_vel = [0, 27.69, 27.7]
y_dist = [1.40, 1.40, 1.45]
y_dist = [0.0, 1.40, 1.45]
elif personality==custom.LongitudinalPersonalitySP.aggressive:
x_vel = [0, 5., 20.0, 20.01, 27.69, 27.7]
y_dist = [0.80, 1.10, 1.10, 1.12, 1.12, 1.20]
y_dist = [0.0, 1.10, 1.10, 1.12, 1.12, 1.20]
else:
raise NotImplementedError("Dynamic personality not supported")
return np.interp(v_ego, x_vel, y_dist)
@@ -29,9 +29,9 @@ from openpilot.common.numpy_fast import interp
AccelPersonality = custom.AccelerationPersonality
# accel personality by @arne182 modified by cgw and kumar
_DP_CRUISE_MIN_V = [-0.030, -0.030, -0.078, -0.078, -0.15, -0.15, -0.79, -0.79, -0.79, -0.79, -1.0, -1.0]
_DP_CRUISE_MIN_V_ECO = [-0.030, -0.030, -0.075, -0.075, -0.14, -0.14, -0.78, -0.78, -0.88, -0.88, -1.0, -1.0]
_DP_CRUISE_MIN_V_SPORT = [-0.030, -0.030, -0.080, -0.080, -0.70, -0.70, -0.80, -0.80, -0.90, -0.90, -1.0, -1.0]
_DP_CRUISE_MIN_V = [-0.69, -0.69, -0.69, -0.69, -0.69, -0.69, -0.79, -0.79, -0.79, -0.79, -1.0, -1.0]
_DP_CRUISE_MIN_V_ECO = [-0.68, -0.68, -0.68, -0.68, -0.68, -0.68, -0.78, -0.78, -0.88, -0.88, -1.0, -1.0]
_DP_CRUISE_MIN_V_SPORT = [-0.70, -0.70, -0.70, -0.70, -0.70, -0.70, -0.80, -0.80, -0.90, -0.90, -1.0, -1.0]
_DP_CRUISE_MIN_BP = [0., 3.0, 3.01, 10., 10.01, 14., 14.01, 18., 18.01, 22., 22.01, 30.]
_DP_CRUISE_MAX_V = [2.0, 2.0, 2.0, 1.80, 1.11, .70, .54, .38, .17]