|
|
@ -32,6 +32,7 @@ class CarInterfaceBase(ABC): |
|
|
|
self.steering_unpressed = 0 |
|
|
|
self.steering_unpressed = 0 |
|
|
|
self.low_speed_alert = False |
|
|
|
self.low_speed_alert = False |
|
|
|
self.silent_steer_warning = True |
|
|
|
self.silent_steer_warning = True |
|
|
|
|
|
|
|
self.disengage_on_gas = params.get("DisengageOnGas", encoding='utf8') |
|
|
|
|
|
|
|
|
|
|
|
if CarState is not None: |
|
|
|
if CarState is not None: |
|
|
|
self.CS = CarState(CP) |
|
|
|
self.CS = CarState(CP) |
|
|
@ -123,7 +124,7 @@ class CarInterfaceBase(ABC): |
|
|
|
events.add(EventName.wrongCarMode) |
|
|
|
events.add(EventName.wrongCarMode) |
|
|
|
if cs_out.espDisabled: |
|
|
|
if cs_out.espDisabled: |
|
|
|
events.add(EventName.espDisabled) |
|
|
|
events.add(EventName.espDisabled) |
|
|
|
if cs_out.gasPressed: |
|
|
|
if cs_out.gasPressed and self.disengage_on_gas: |
|
|
|
events.add(EventName.gasPressed) |
|
|
|
events.add(EventName.gasPressed) |
|
|
|
if cs_out.stockFcw: |
|
|
|
if cs_out.stockFcw: |
|
|
|
events.add(EventName.stockFcw) |
|
|
|
events.add(EventName.stockFcw) |
|
|
@ -152,7 +153,7 @@ class CarInterfaceBase(ABC): |
|
|
|
events.add(EventName.steerUnavailable) |
|
|
|
events.add(EventName.steerUnavailable) |
|
|
|
|
|
|
|
|
|
|
|
# Disable on rising edge of gas or brake. Also disable on brake when speed > 0. |
|
|
|
# Disable on rising edge of gas or brake. Also disable on brake when speed > 0. |
|
|
|
if (cs_out.gasPressed and not self.CS.out.gasPressed) or \ |
|
|
|
if (self.disengage_on_gas and cs_out.gasPressed and not self.CS.out.gasPressed) or \ |
|
|
|
(cs_out.brakePressed and (not self.CS.out.brakePressed or not cs_out.standstill)): |
|
|
|
(cs_out.brakePressed and (not self.CS.out.brakePressed or not cs_out.standstill)): |
|
|
|
events.add(EventName.pedalPressed) |
|
|
|
events.add(EventName.pedalPressed) |
|
|
|
|
|
|
|
|
|
|
|