MADS: enforce certain soft disable events by user when in motion (#1298)

* MADS: enforce soft disable events by user when the vehicle is in motion

* flipped
This commit is contained in:
Jason Wen
2025-09-29 19:18:52 -04:00
committed by GitHub
parent db65937fc7
commit 90adc18032
+7 -6
View File
@@ -102,12 +102,13 @@ class ModularAssistiveDrivingSystem:
def update_events(self, CS: structs.CarState):
if not self.selfdrive.enabled and self.enabled:
if self.events.has(EventName.doorOpen):
self.replace_event(EventName.doorOpen, EventNameSP.silentDoorOpen)
self.transition_paused_state()
if self.events.has(EventName.seatbeltNotLatched):
self.replace_event(EventName.seatbeltNotLatched, EventNameSP.silentSeatbeltNotLatched)
self.transition_paused_state()
if CS.standstill:
if self.events.has(EventName.doorOpen):
self.replace_event(EventName.doorOpen, EventNameSP.silentDoorOpen)
self.transition_paused_state()
if self.events.has(EventName.seatbeltNotLatched):
self.replace_event(EventName.seatbeltNotLatched, EventNameSP.silentSeatbeltNotLatched)
self.transition_paused_state()
if self.events.has(EventName.wrongGear) and (CS.vEgo < 2.5 or CS.gearShifter == GearShifter.reverse):
self.replace_event(EventName.wrongGear, EventNameSP.silentWrongGear)
self.transition_paused_state()