Subaru brake check (#1212)

old-commit-hash: 24e092ffabb86b3093222a0d0de62a312d7c874b
This commit is contained in:
rbiasini
2020-03-06 23:17:16 -08:00
committed by GitHub
parent f70e7ba371
commit 39f29c0cbe
4 changed files with 6 additions and 5 deletions
+1 -1
Submodule opendbc updated: 6252718a93...f308ca62e3
+1 -1
Submodule panda updated: c7d0d5fc7b...74c8ee0a7a
+3 -2
View File
@@ -63,7 +63,6 @@ class CarInterface(CarInterfaceBase):
be.type = car.CarState.ButtonEvent.Type.accelCruise
buttonEvents.append(be)
# TODO: add gearShifter to carState
events = self.create_common_events(ret, extra_gears=[car.CarState.GearShifter.unknown])
if ret.cruiseState.enabled and not self.cruise_enabled_prev:
@@ -72,12 +71,14 @@ class CarInterface(CarInterfaceBase):
events.append(create_event('pcmDisable', [ET.USER_DISABLE]))
# disable on gas pedal rising edge
if (ret.gasPressed and not self.gas_pressed_prev):
if (ret.gasPressed and not self.gas_pressed_prev) or \
(ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001)):
events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE]))
ret.events = events
self.gas_pressed_prev = ret.gasPressed
self.brake_pressed_prev = ret.brakePressed
self.cruise_enabled_prev = ret.cruiseState.enabled
self.CS.out = ret.as_reader()
+1 -1
View File
@@ -1 +1 @@
49d2241353626870070cf4dac71b5ac5b105910c
f48e39778dc502d62fa2eac515f886f7d7520ffa