mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-07 17:25:40 +08:00
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:
@@ -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.]
|
||||
|
||||
Reference in New Issue
Block a user