Toyota: longitudinal tune condition cleanup (#25676)

* Toyota: clean up long tunes a bit

* Update selfdrive/car/toyota/interface.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
cydia2020
2022-09-11 09:42:28 +10:00
committed by GitHub
parent 21972605e7
commit 2704e2cf4d
2 changed files with 6 additions and 8 deletions
+3 -4
View File
@@ -230,11 +230,10 @@ class CarInterface(CarInterfaceBase):
# to a negative value, so it won't matter.
ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else MIN_ACC_SPEED
if ret.enableGasInterceptor:
set_long_tune(ret.longitudinalTuning, LongTunes.PEDAL)
elif candidate in TSS2_CAR:
if candidate in TSS2_CAR or ret.enableGasInterceptor:
set_long_tune(ret.longitudinalTuning, LongTunes.TSS2)
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly
if candidate in TSS2_CAR:
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly
else:
set_long_tune(ret.longitudinalTuning, LongTunes.TSS)
+3 -4
View File
@@ -2,9 +2,8 @@
from enum import Enum
class LongTunes(Enum):
PEDAL = 0
TSS2 = 1
TSS = 2
TSS2 = 0
TSS = 1
class LatTunes(Enum):
INDI_PRIUS = 0
@@ -28,7 +27,7 @@ class LatTunes(Enum):
###### LONG ######
def set_long_tune(tune, name):
# Improved longitudinal tune
if name == LongTunes.TSS2 or name == LongTunes.PEDAL:
if name == LongTunes.TSS2:
tune.deadzoneBP = [0., 8.05]
tune.deadzoneV = [.0, .14]
tune.kpBP = [0., 5., 20.]