From b4bda8afeeb8776f3afad2ad81fe92fb7a0b395c Mon Sep 17 00:00:00 2001 From: Alfonso hernandez Date: Fri, 11 Oct 2024 10:39:29 +0200 Subject: [PATCH] feat: Prevent car to go on steering fault when user steering rate is high. --- selfdrive/car/toyota/carcontroller.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index d22431cd3c42d0..fdb355ad1cd4f9 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -79,8 +79,7 @@ def update(self, CC, CS, now_nanos): apply_steer = apply_meas_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, self.CCP) # Count up to MAX_STEER_RATE_FRAMES, at which point we need to cut torque to avoid a steering fault. - # We do not do this when in External Control Mode so that car safety is persistent after user takes control - if lat_active and not self.CCP.externalControlMode and abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE: + if lat_active and abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE: self.steer_rate_counter += 1 else: self.steer_rate_counter = 0