silent park brake

This commit is contained in:
Jason Wen
2024-11-26 13:57:42 -05:00
parent 1e11b6311f
commit bcff9ca4ce
4 changed files with 16 additions and 2 deletions
+1
View File
@@ -197,6 +197,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
silentReverseGear @160;
silentDoorOpen @161;
silentSeatbeltNotLatched @162;
silentParkBrake @163;
soundsUnavailableDEPRECATED @47;
}
+9
View File
@@ -1054,6 +1054,15 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"),
},
EventName.silentParkBrake: {
ET.WARNING: Alert(
"",
"",
AlertStatus.normal, AlertSize.mid,
Priority.LOW, VisualAlert.none, AudibleAlert.none, 0.),
ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"),
},
}
+3
View File
@@ -60,6 +60,9 @@ class ModularAssistiveDrivingSystem:
if self.events.has(EventName.seatbeltNotLatched):
self.events.replace(EventName.seatbeltNotLatched, EventName.silentSeatbeltNotLatched)
transition_paused_state()
if self.events.has(EventName.parkBrake):
self.events.replace(EventName.parkBrake, EventName.silentParkBrake)
transition_paused_state()
if self.disengage_lateral_on_brake_toggle:
if self.events.has(EventName.pedalPressed):
+3 -2
View File
@@ -10,9 +10,10 @@ ACTIVE_STATES = (State.enabled, State.softDisabling, State.overriding)
ENABLED_STATES = (State.paused, *ACTIVE_STATES)
GEARS_ALLOW_PAUSED_SILENT = [EventName.silentWrongGear, EventName.silentReverseGear, EventName.silentBrakeHold,
EventName.silentDoorOpen, EventName.silentSeatbeltNotLatched]
EventName.silentDoorOpen, EventName.silentSeatbeltNotLatched, EventName.parkBrake]
GEARS_ALLOW_PAUSED = [EventName.wrongGear, EventName.reverseGear, EventName.brakeHold,
EventName.doorOpen, EventName.seatbeltNotLatched, *GEARS_ALLOW_PAUSED_SILENT]
EventName.doorOpen, EventName.seatbeltNotLatched, EventName.silentParkBrake,
*GEARS_ALLOW_PAUSED_SILENT]
class StateMachine: