From d3a66015ad99c54b03bc3693857fbea825122208 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sat, 3 Dec 2022 02:05:24 -0800 Subject: [PATCH] Toyota: log EPS fault from LKA cmd message drop out (#26687) * log additional faults * bump opendbc --- opendbc | 2 +- selfdrive/car/toyota/carstate.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/opendbc b/opendbc index 3737675445..94fff4782b 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit 373767544559718d74bff58dd23890eea1d38a29 +Subproject commit 94fff4782be263efad10032a612b3c96a120c0b7 diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index dbbb8a6f04..250c6b65ae 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -85,10 +85,12 @@ class CarState(CarStateBase): ret.steeringTorqueEps = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_EPS"] * self.eps_torque_scale # we could use the override bit from dbc, but it's triggered at too high torque values ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD - # steer rate fault, goes to 21 or 25 for 1 frame, then 9 for ~2 seconds - ret.steerFaultTemporary = cp.vl["EPS_STATUS"]["LKA_STATE"] in (0, 9, 21, 25) + # steer rate fault: goes to 21 or 25 for 1 frame, then 9 for 2 seconds + # lka msg drop out: goes to 9 then 11 for a combined total of 2 seconds + ret.steerFaultTemporary = cp.vl["EPS_STATUS"]["LKA_STATE"] in (0, 9, 11, 21, 25) # 17 is a fault from a prolonged high torque delta between cmd and user - ret.steerFaultPermanent = cp.vl["EPS_STATUS"]["LKA_STATE"] == 17 + # 3 is a fault from the lka command message not being received by the EPS + ret.steerFaultPermanent = cp.vl["EPS_STATUS"]["LKA_STATE"] in (3, 17) if self.CP.carFingerprint in UNSUPPORTED_DSU_CAR: ret.cruiseState.available = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0