Disable below steer speed event after it's been shown

This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent c5b7bd3e08
commit a5412fdba2
2 changed files with 9 additions and 1 deletions

View File

@@ -369,8 +369,13 @@ class CarInterface(CarInterfaceBase):
events.add(EventName.belowEngageSpeed) events.add(EventName.belowEngageSpeed)
if ret.cruiseState.standstill: if ret.cruiseState.standstill:
events.add(EventName.resumeRequired) 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) 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: if (self.CP.flags & GMFlags.CC_LONG.value) and ret.vEgo < self.CP.minEnableSpeed and ret.cruiseState.enabled:
events.add(EventName.speedTooLow) events.add(EventName.speedTooLow)

View File

@@ -102,6 +102,9 @@ class CarInterfaceBase(ABC):
# FrogPilot variables # FrogPilot variables
params = Params() params = Params()
self.belowSteerSpeed_shown = False
self.disable_belowSteerSpeed = False
@staticmethod @staticmethod
def get_pid_accel_limits(CP, current_speed, cruise_speed, frogpilot_variables): def get_pid_accel_limits(CP, current_speed, cruise_speed, frogpilot_variables):
if frogpilot_variables.sport_plus: if frogpilot_variables.sport_plus: