mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-26 16:32:06 +08:00
controlsd: preEnable on brake at a standstill (#26273)
* pre-enable on brake at standstill * test by getting rid of noTarget * Update events.py * rename * stash what we got so far * cmt * not sure if best way to fix, but enabled with current states defs is fine * no noEntry in preEnabled * bumpcereal * uncomment * Update ref_commit Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
+1
-1
Submodule cereal updated: 3bae09cf65...7f55399fde
@@ -249,6 +249,9 @@ class Controls:
|
||||
(CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)):
|
||||
self.events.add(EventName.pedalPressed)
|
||||
|
||||
if CS.brakePressed and CS.standstill:
|
||||
self.events.add(EventName.preEnableStandstill)
|
||||
|
||||
if CS.gasPressed:
|
||||
self.events.add(EventName.gasPressedOverride)
|
||||
|
||||
@@ -579,7 +582,7 @@ class Controls:
|
||||
# Check which actuators can be enabled
|
||||
CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \
|
||||
CS.vEgo > self.CP.minSteerSpeed and not CS.standstill
|
||||
CC.longActive = self.active and not self.events.any(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl
|
||||
CC.longActive = self.enabled and not self.events.any(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl
|
||||
|
||||
actuators = CC.actuators
|
||||
actuators.longControlState = self.LoC.long_control_state
|
||||
|
||||
@@ -615,9 +615,9 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
|
||||
visual_alert=VisualAlert.brakePressed),
|
||||
},
|
||||
|
||||
EventName.pedalPressedPreEnable: {
|
||||
EventName.preEnableStandstill: {
|
||||
ET.PRE_ENABLE: Alert(
|
||||
"Release Pedal to Engage",
|
||||
"Release Brake to Engage",
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.small,
|
||||
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.),
|
||||
|
||||
@@ -1 +1 @@
|
||||
ddfaab44ae64a0d064b847e81080993b51b6b423
|
||||
f17412941a0e8229eea308c33189a5bdb1a17ae8
|
||||
|
||||
Reference in New Issue
Block a user