From febe8bf6362f92f541d5064d6385245c91f0c881 Mon Sep 17 00:00:00 2001 From: Jafar Al-Gharaibeh Date: Wed, 20 Oct 2021 23:36:22 -0500 Subject: [PATCH] Mazda: Fix OP steer warning in cars with lockout (#22612) Signed-off-by: Jafar Al-Gharaibeh old-commit-hash: ca1f96ac725f0cbacfad41c6f277cd86acbee9a1 --- selfdrive/car/mazda/carstate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/mazda/carstate.py b/selfdrive/car/mazda/carstate.py index 0507a8c3a2..a96c68b0e8 100644 --- a/selfdrive/car/mazda/carstate.py +++ b/selfdrive/car/mazda/carstate.py @@ -78,8 +78,9 @@ class CarState(CarStateBase): self.low_speed_lockout = False self.low_speed_alert = False - # Check if LKAS is disabled due to lack of driver torque - ret.steerWarning = (cp.vl["STEER_RATE"]["HANDS_OFF_5_SECONDS"] == 1) and (cp.vl["STEER_RATE"]["LKAS_BLOCK"] == 1) + # Check if LKAS is disabled due to lack of driver torque when all other states indicate + # it should be enabled (steer lockout) + ret.steerWarning = self.lkas_allowed and (cp.vl["STEER_RATE"]["LKAS_BLOCK"] == 1) self.acc_active_last = ret.cruiseState.enabled