mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-29 02:43:47 +08:00
Subaru brake check (#1212)
old-commit-hash: 24e092ffabb86b3093222a0d0de62a312d7c874b
This commit is contained in:
+1
-1
Submodule opendbc updated: 6252718a93...f308ca62e3
+1
-1
Submodule panda updated: c7d0d5fc7b...74c8ee0a7a
@@ -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 @@
|
||||
49d2241353626870070cf4dac71b5ac5b105910c
|
||||
f48e39778dc502d62fa2eac515f886f7d7520ffa
|
||||
Reference in New Issue
Block a user