diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 488ace9fe2..df5d66ebc9 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -834,8 +834,8 @@ class Controls: self.prev_overtaking_accel_engaged = self.overtaking_accel_engaged ttc = self.sm['radarState'].leadOne.dRel / CS.vEgo if CS.vEgo > 0 else 255 overtaking_accel_engaged = self.overtaking_accel and overtaking_accel_allowed and \ - CS.vEgo > (60 * CV.KPH_TO_MS) if self.is_metric else (40 * CV.MPH_TO_MS) and long_plan.hasLead and \ - long_plan.aTarget > -0.2 and not (CS.leftBlinker and CS.rightBlinker) and ttc > 0.75 + (CS.vEgo > ((60 * CV.KPH_TO_MS) if self.is_metric else (40 * CV.MPH_TO_MS))) and long_plan.hasLead and \ + long_plan.aTarget > -0.2 and not (CS.leftBlinker and CS.rightBlinker) and (0.75 < ttc < 3.0) if ttc <= 0.75 and self.prev_overtaking_accel_engaged and overtaking_accel_engaged: overtaking_accel_engaged = False if overtaking_accel_engaged and not self.prev_overtaking_accel_engaged: