log steer faults

pull/27494/head
Shane Smiskol 3 years ago
parent ed92466df2
commit 535b4e2b3a
  1. 7
      selfdrive/car/toyota/carstate.py

@ -86,11 +86,16 @@ 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
# 3 is a fault from the lka/lta command message not being received by the EPS
if self.CP.steerControlType == car.CarParams.SteerControlType.angle:
ret.steerFaultTemporary = cp.vl["EPS_STATUS"]["LTA_STATE"] not in (1, 3, 5) # TODO: set actual codes. 1 is inactive, 5 is active, 3 is below
ret.steerFaultPermanent = cp.vl["EPS_STATUS"]["LTA_STATE"] in (3,) # TODO: any more?
else:
# 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
# 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:

Loading…
Cancel
Save