controls: disengage on regen paddle independently (#26453)

* add regen braking field that's just used to add a pedalPressed

* bump

* bump

* Update ref_commit

* we want the standstill check

we want the standstill check

* see what diff is now

* Update ref_commit
old-commit-hash: 74b6e22a7d
taco
Shane Smiskol 2 years ago committed by GitHub
parent 2dc299e937
commit 1ea7e49e8d
  1. 2
      cereal
  2. 2
      selfdrive/car/gm/carstate.py
  3. 4
      selfdrive/car/tests/test_models.py
  4. 3
      selfdrive/controls/controlsd.py
  5. 2
      selfdrive/test/process_replay/ref_commit

@ -1 +1 @@
Subproject commit cdba1aafec5e36505ef6ace675568e1f15003c47
Subproject commit afafa0a2a537d775842ab2e1bf20cb9a33b34f9a

@ -63,7 +63,7 @@ class CarState(CarStateBase):
# Regen braking is braking
if self.CP.transmissionType == TransmissionType.direct:
ret.brakePressed = ret.brakePressed or pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0
ret.regenBraking = pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0
ret.gas = pt_cp.vl["AcceleratorPedal2"]["AcceleratorPedal2"] / 254.
ret.gasPressed = ret.gas > 1e-5

@ -251,8 +251,8 @@ class TestCarModelBase(unittest.TestCase):
if CS.brakePressed and not self.safety.get_brake_pressed_prev():
if self.CP.carFingerprint in (HONDA.PILOT, HONDA.PASSPORT, HONDA.RIDGELINE) and CS.brake > 0.05:
brake_pressed = False
safety_brake_pressed = self.safety.get_brake_pressed_prev() or self.safety.get_regen_braking_prev()
checks['brakePressed'] += brake_pressed != safety_brake_pressed
checks['brakePressed'] += brake_pressed != self.safety.get_brake_pressed_prev()
checks['regenBraking'] += CS.regenBraking != self.safety.get_regen_braking_prev()
if self.CP.pcmCruise:
# On most pcmCruise cars, openpilot's state is always tied to the PCM's cruise state.

@ -250,7 +250,8 @@ class Controls:
# Disable on rising edge of accelerator or brake. Also disable on brake when speed > 0
if (CS.gasPressed and not self.CS_prev.gasPressed and self.disengage_on_accelerator) or \
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)):
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)) or \
(CS.regenBraking and (not self.CS_prev.regenBraking or not CS.standstill)):
self.events.add(EventName.pedalPressed)
if CS.gasPressed:

@ -1 +1 @@
a36f7e2fd922fcadca6f8a3d777f4db787cba016
9e37e8ee8013515cfd75cf352a1a2b9aa447c441

Loading…
Cancel
Save