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>
pull/25727/head
cydia2020 3 years ago committed by GitHub
parent 21972605e7
commit 2704e2cf4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      selfdrive/car/toyota/interface.py
  2. 7
      selfdrive/car/toyota/tunes.py

@ -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)

@ -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.]

Loading…
Cancel
Save