From 6321b745ff5cb1cbe9e25054753b42ed7d3dd466 Mon Sep 17 00:00:00 2001 From: FrogAi <91348155+FrogAi@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:34:47 -0700 Subject: [PATCH] Disable below steer speed event after it's been shown --- selfdrive/car/gm/interface.py | 7 ++++++- selfdrive/car/interfaces.py | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index a6f895d0..bdd1b107 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -369,8 +369,13 @@ class CarInterface(CarInterfaceBase): events.add(EventName.belowEngageSpeed) if ret.cruiseState.standstill: events.add(EventName.resumeRequired) - if ret.vEgo < self.CP.minSteerSpeed: + if ret.vEgo < self.CP.minSteerSpeed and not self.disable_belowSteerSpeed: events.add(EventName.belowSteerSpeed) + self.belowSteerSpeed_shown = True + + # Disable the "belowSteerSpeed" event after it's been shown once to not annoy the driver + if self.belowSteerSpeed_shown and ret.vEgo > self.CP.minSteerSpeed: + self.disable_belowSteerSpeed = True if (self.CP.flags & GMFlags.CC_LONG.value) and ret.vEgo < self.CP.minEnableSpeed and ret.cruiseState.enabled: events.add(EventName.speedTooLow) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index ea59e3b3..b423803e 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -102,6 +102,9 @@ class CarInterfaceBase(ABC): # FrogPilot variables params = Params() + self.belowSteerSpeed_shown = False + self.disable_belowSteerSpeed = False + @staticmethod def get_pid_accel_limits(CP, current_speed, cruise_speed, frogpilot_variables): if frogpilot_variables.sport_plus: