Controls - Speed Limit Controller - Speed Limit Changed Alert

This commit is contained in:
FrogAi
2024-05-10 21:46:31 -07:00
parent 003fae06ed
commit c7e9da599b
2 changed files with 11 additions and 0 deletions
+3
View File
@@ -917,6 +917,9 @@ class Controls:
self.events.add(EventName.openpilotCrashed)
self.openpilot_crashed_triggered = True
if self.frogpilot_toggles.speed_limit_alert and self.speed_limit_changed:
self.events.add(EventName.speedLimitChanged)
if self.sm.frame * DT_CTRL == 5.5 and self.CP.lateralTuning.which() == "torque" and self.CI.use_nnff:
self.events.add(EventName.torqueNNLoad)
+8
View File
@@ -1014,6 +1014,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
Priority.HIGH, VisualAlert.wrongGear, AudibleAlert.promptRepeat, 4.),
},
EventName.speedLimitChanged: {
ET.PERMANENT: Alert(
"Speed limit changed",
"",
AlertStatus.frogpilot, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.prompt, 3.),
},
EventName.torqueNNLoad: {
ET.PERMANENT: torque_nn_load_alert,
},