From e2fd3e109bd051e27b8ac8f62ba889a3f8ba77bd Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 10 Aug 2024 11:17:38 -0400 Subject: [PATCH] more --- selfdrive/controls/controlsd.py | 9 +++++---- selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 6d1cc2b531..d58a226223 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -829,11 +829,12 @@ 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 (0.75 < ttc < 3.0) - if ttc <= 0.75 and self.prev_overtaking_accel_engaged and overtaking_accel_engaged: + (CS.vEgo > ((60 * CV.KPH_TO_MS) if self.is_metric else (40 * CV.MPH_TO_MS))) and \ + not (CS.leftBlinker and CS.rightBlinker) + 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: + if overtaking_accel_engaged and not self.prev_overtaking_accel_engaged and \ + long_plan.hasLead and long_plan.aTarget > -0.1 and (0.75 < ttc < 3.0): self.overtaking_accel_engaged = True elif not overtaking_accel_engaged: self.overtaking_accel_engaged = False diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 6fdad993ac..d8be674d3a 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -82,7 +82,7 @@ def get_T_FOLLOW(personality=custom.LongitudinalPersonalitySP.standard): elif personality==custom.LongitudinalPersonalitySP.aggressive: return 1.0 elif personality==custom.LongitudinalPersonalitySP.overtake: - return 0.3 + return 0.25 else: raise NotImplementedError("Longitudinal personality not supported")