mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-26 14:02:06 +08:00
fix not allowed engaged bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user