TSS2 Tune

Added toggle to customize the driving dynamics of TTS2 vehicles.

Credit goes to DragonPilot!

https: //github.com/dragonpilot-community/dragonpilot
Co-Authored-By: eFini <16603033+efinilan@users.noreply.github.com>
Co-Authored-By: Kumar <36933347+rav4kumar@users.noreply.github.com>
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent c9298a885f
commit 882713b26e
3 changed files with 16 additions and 2 deletions

View File

@@ -263,7 +263,19 @@ class CarInterface(CarInterfaceBase):
tune = ret.longitudinalTuning
tune.deadzoneBP = [0., 9.]
tune.deadzoneV = [.0, .15]
if candidate in TSS2_CAR or ret.enableGasInterceptor:
if (candidate in TSS2_CAR or ret.enableGasInterceptor) and Params().get_bool("TSS2Tune"):
# TSS2 tune - Credit goes to the DragonPilot team!
tune.kpBP = [0., 5., 20.]
tune.kpV = [1.3, 1.0, 0.7]
# In MPH = [ 0., 2, 5, 11, 27, 45, 52, 67, 90]
tune.kiBP = [ 0., 1., 2., 5., 12., 20., 23., 30., 40.]
tune.kiV = [.33, .33, .313, .245, .215, .17, .10, .01, .001]
if candidate in TSS2_CAR:
ret.vEgoStopping = 0.1 # car is near 0.1 to 0.2 when car starts requesting stopping accel
ret.vEgoStarting = 0.1 # needs to be > or == vEgoStopping
ret.stopAccel = -0.40 # Toyota requests -0.4 when stopped
ret.stoppingDecelRate = 0.5 # reach stopping target smoothly
elif candidate in TSS2_CAR or ret.enableGasInterceptor:
tune.kpBP = [0., 5., 20.]
tune.kpV = [1.3, 1.0, 0.7]
tune.kiBP = [0., 5., 12., 20., 27.]