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>
pull/26632/head
Shane Smiskol 2 years ago committed by GitHub
parent c3e3047080
commit dbe512d167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cereal
  2. 5
      selfdrive/controls/controlsd.py
  3. 4
      selfdrive/controls/lib/events.py
  4. 2
      selfdrive/test/process_replay/ref_commit

@ -1 +1 @@
Subproject commit 3bae09cf6527674d7eda3a9956242aad94a8f3d2
Subproject commit 7f55399fde0b6a70c1bf7df4f86b90b0060e31ac

@ -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

Loading…
Cancel
Save