From bcaf05d5420520e8acb4a6ed466ab90d0b48e579 Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Mon, 15 Jul 2024 13:18:10 +0800 Subject: [PATCH] fixed zss crashing lexus IS --- selfdrive/car/toyota/carstate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 063427f14..c8dbfde5b 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -94,7 +94,11 @@ class CarState(CarStateBase): torque_sensor_angle_deg = cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE"] # dp - zss controller - ret.steeringAngleDeg = self.zssc.get_steering_angle_deg(cp.vl["PCM_CRUISE_2"]["MAIN_ON"], cp.vl["PCM_CRUISE"]["CRUISE_ACTIVE"], ret.steeringAngleDeg) + if self.CP.carFingerprint in UNSUPPORTED_DSU_CAR: + main_on = cp.vl["DSU_CRUISE"]["MAIN_ON"] != 0 + else: + main_on = cp.vl["PCM_CRUISE_2"]["MAIN_ON"] != 0 + ret.steeringAngleDeg = self.zssc.get_steering_angle_deg(main_on, cp.vl["PCM_CRUISE"]["CRUISE_ACTIVE"], ret.steeringAngleDeg) # On some cars, the angle measurement is non-zero while initializing if abs(torque_sensor_angle_deg) > 1e-3 and not bool(cp.vl["STEER_TORQUE_SENSOR"]["STEER_ANGLE_INITIALIZING"]):