FrogPilot features - Disable resume required event after it's been shown

This commit is contained in:
FrogAi
2024-05-09 22:17:49 -07:00
parent 5014e37f25
commit d4998dad76
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -328,8 +328,14 @@ class CarInterface(CarInterfaceBase):
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)):
events.add(EventName.belowEngageSpeed)
if ret.cruiseState.standstill and not self.CP.autoResumeSng:
if ret.cruiseState.standstill and not (self.CP.autoResumeSng or self.disable_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:
events.add(EventName.belowSteerSpeed)
self.belowSteerSpeed_shown = True
+2
View File
@@ -117,6 +117,8 @@ class CarInterfaceBase(ABC):
self.belowSteerSpeed_shown = False
self.disable_belowSteerSpeed = False
self.disable_resumeRequired = False
self.resumeRequired_shown = False
def apply(self, c: car.CarControl, now_nanos: int, frogpilot_toggles) -> tuple[car.CarControl.Actuators, list[tuple[int, int, bytes, int]]]:
return self.CC.update(c, self.CS, now_nanos, frogpilot_toggles)