fix not allowed engaged bug

This commit is contained in:
Jason Wen
2024-12-14 11:59:12 -05:00
parent 2d7009fa11
commit 2ebb2b33cd
+3 -6
View File
@@ -93,12 +93,6 @@ class ModularAssistiveDrivingSystem:
if self.events.has(EventName.parkBrake):
self.events.replace(EventName.parkBrake, EventName.silentParkBrake)
transition_paused_state()
if self.events.has(EventName.wrongCarMode):
self.events.replace(EventName.wrongCarMode, EventName.wrongCarModeNoEntry)
transition_paused_state()
if self.events.has(EventName.wrongCruiseMode):
self.events.replace(EventName.wrongCruiseMode, EventName.wrongCruiseModeNoEntry)
transition_paused_state()
if self.disengage_lateral_on_brake_toggle:
if CS.brakePressed:
@@ -130,6 +124,8 @@ class ModularAssistiveDrivingSystem:
self.events.add(EventName.lkasDisable)
else:
self.events.add(EventName.lkasEnable)
if be.type not in (ButtonType.accelCruise, ButtonType.resumeCruise, ButtonType.decelCruise, ButtonType.setCruise):
self.events.remove(EventName.wrongCruiseMode)
if not CS.cruiseState.available:
self.events.remove(EventName.buttonEnable)
@@ -139,6 +135,7 @@ class ModularAssistiveDrivingSystem:
self.events.remove(EventName.pcmDisable)
self.events.remove(EventName.buttonCancel)
self.events.remove(EventName.pedalPressed)
self.events.remove(EventName.wrongCarMode)
if self.mismatch_counter >= 200:
self.events.add(EventName.controlsMismatchLateral)