Disable resume required event after it's been shown

This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent 5582056a82
commit f016bd7e16
2 changed files with 10 additions and 1 deletions

View File

@@ -365,8 +365,14 @@ class CarInterface(CarInterfaceBase):
if below_min_enable_speed and not (ret.standstill and ret.brake >= 20 and if below_min_enable_speed and not (ret.standstill and ret.brake >= 20 and
(self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.carFingerprint in SDGM_CAR)): (self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.carFingerprint in SDGM_CAR)):
events.add(EventName.belowEngageSpeed) events.add(EventName.belowEngageSpeed)
if ret.cruiseState.standstill: if ret.cruiseState.standstill and not self.disable_resumeRequired:
events.add(EventName.resumeRequired) events.add(EventName.resumeRequired)
self.resumeRequired_shown = True
# Disable the "resumeRequired" event after it's been shown once to not annoy the driver
if self.resumeRequired_shown and not ret.cruiseState.standstill:
self.disable_resumeRequired = True
if ret.vEgo < self.CP.minSteerSpeed and not self.disable_belowSteerSpeed: if ret.vEgo < self.CP.minSteerSpeed and not self.disable_belowSteerSpeed:
events.add(EventName.belowSteerSpeed) events.add(EventName.belowSteerSpeed)
self.belowSteerSpeed_shown = True self.belowSteerSpeed_shown = True

View File

@@ -94,6 +94,9 @@ class CarInterfaceBase(ABC):
self.belowSteerSpeed_shown = False self.belowSteerSpeed_shown = False
self.disable_belowSteerSpeed = False self.disable_belowSteerSpeed = False
self.resumeRequired_shown = False
self.disable_resumeRequired = False
@staticmethod @staticmethod
def get_pid_accel_limits(CP, current_speed, cruise_speed, sport_plus): def get_pid_accel_limits(CP, current_speed, cruise_speed, sport_plus):
if sport_plus: if sport_plus: