mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-12 08:22:05 +08:00
Toyota: fill steerFaultPermanent (#24410)
* Toyota: fill steerFaultPermanent * same behavior as before, 0 is also fault (0 is most likely initializing) * think this was just wrong (2 or 10 would mean we think it's a fault)
This commit is contained in:
@@ -54,8 +54,7 @@ class CarController:
|
||||
apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, self.torque_rate_limits)
|
||||
self.steer_rate_limited = new_steer != apply_steer
|
||||
|
||||
# Cut steering while we're in a known fault state (2s)
|
||||
if not CC.latActive or CS.steer_state in (9, 25):
|
||||
if not CC.latActive:
|
||||
apply_steer = 0
|
||||
apply_steer_req = 0
|
||||
else:
|
||||
|
||||
@@ -82,7 +82,10 @@ 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
|
||||
ret.steerFaultTemporary = cp.vl["EPS_STATUS"]["LKA_STATE"] not in (1, 5)
|
||||
# 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)
|
||||
# 17 is a fault from a prolonged high torque delta between cmd and user
|
||||
ret.steerFaultPermanent = cp.vl["EPS_STATUS"]["LKA_STATE"] == 17
|
||||
|
||||
if self.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC):
|
||||
ret.cruiseState.available = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0
|
||||
@@ -120,8 +123,6 @@ class CarState(CarStateBase):
|
||||
ret.stockAeb = bool(cp_cam.vl["PRE_COLLISION"]["PRECOLLISION_ACTIVE"] and cp_cam.vl["PRE_COLLISION"]["FORCE"] < -1e-5)
|
||||
|
||||
ret.espDisabled = cp.vl["ESP_CONTROL"]["TC_DISABLED"] != 0
|
||||
# 2 is standby, 10 is active. TODO: check that everything else is really a faulty state
|
||||
self.steer_state = cp.vl["EPS_STATUS"]["LKA_STATE"]
|
||||
|
||||
if self.CP.enableBsm:
|
||||
ret.leftBlindspot = (cp.vl["BSM"]["L_ADJACENT"] == 1) or (cp.vl["BSM"]["L_APPROACHING"] == 1)
|
||||
|
||||
Reference in New Issue
Block a user