From 40b7b28f8416497cd1337784d336c1dd4f5dd6e3 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 26 Jan 2022 21:03:51 -0800 Subject: [PATCH] just specify --- selfdrive/car/toyota/carstate.py | 2 +- selfdrive/car/toyota/interface.py | 2 +- selfdrive/car/toyota/values.py | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index c20434fb65..b9d1dc0d43 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -14,7 +14,7 @@ class CarState(CarStateBase): super().__init__(CP) can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) self.shifter_values = can_define.dv["GEAR_PACKET"]["GEAR"] - self.eps_torque_scale = EPS_SCALE[CP.carFingerprint] / 100. + self.eps_torque_scale = EPS_SCALE.get(CP.carFingerprint, 73) / 100. # On cars with cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE"] # the signal is zeroed to where the steering angle is at start. diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index f0c61eeb22..dc352fd2a2 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -20,7 +20,7 @@ class CarInterface(CarInterfaceBase): ret.carName = "toyota" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] - ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] + ret.safetyConfigs[0].safetyParam = EPS_SCALE.get(candidate, 73) / 100. ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay ret.steerLimitTimer = 0.4 diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index cab16b72af..497ff42ccd 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -1,4 +1,3 @@ -from collections import defaultdict from enum import IntFlag from cereal import car @@ -1686,7 +1685,7 @@ DBC = { } # These cars have non-standard EPS torque scale factors. All others are 73 -EPS_SCALE = defaultdict(lambda: 73, {CAR.PRIUS: 66, CAR.COROLLA: 88, CAR.LEXUS_IS: 77, CAR.LEXUS_RC: 77, CAR.LEXUS_CTH: 100}) +EPS_SCALE = {CAR.PRIUS: 66, CAR.COROLLA: 88, CAR.LEXUS_IS: 77, CAR.LEXUS_RC: 77, CAR.LEXUS_CTH: 100} # Toyota/Lexus Safety Sense 2.0 and 2.5 TSS2_CAR = {CAR.RAV4_TSS2, CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2, CAR.LEXUS_ES_TSS2, CAR.LEXUS_ESH_TSS2, CAR.RAV4H_TSS2,