mirror of https://github.com/1okko/openpilot.git
Hyundai CAN: Log ABS/ESP Activation to `espActive` (#32743)
* Hyundai CAN: Log active ABS to accFaulted * Add comments * `espActive` to CarState and CarEvent.EventName * re-order --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
parent
0922ab2b8d
commit
36eafc0dc6
|
@ -116,6 +116,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
|||
paramsdTemporaryError @50;
|
||||
paramsdPermanentError @119;
|
||||
actuatorsApiUnavailable @120;
|
||||
espActive @121;
|
||||
|
||||
radarCanErrorDEPRECATED @15;
|
||||
communityFeatureDisallowedDEPRECATED @62;
|
||||
|
@ -194,6 +195,7 @@ struct CarState {
|
|||
espDisabled @32 :Bool;
|
||||
accFaulted @42 :Bool;
|
||||
carFaultedNonCritical @47 :Bool; # some ECU is faulted, but car remains controllable
|
||||
espActive @51 :Bool;
|
||||
|
||||
# cruise state
|
||||
cruiseState @10 :CruiseState;
|
||||
|
|
|
@ -119,6 +119,7 @@ class CarState(CarStateBase):
|
|||
ret.brakeHoldActive = cp.vl["TCS15"]["AVH_LAMP"] == 2 # 0 OFF, 1 ERROR, 2 ACTIVE, 3 READY
|
||||
ret.parkingBrake = cp.vl["TCS13"]["PBRAKE_ACT"] == 1
|
||||
ret.espDisabled = cp.vl["TCS11"]["TCS_PAS"] == 1
|
||||
ret.espActive = cp.vl["TCS11"]["ABS_ACT"] == 1
|
||||
ret.accFaulted = cp.vl["TCS13"]["ACCEnable"] != 0 # 0 ACC CONTROL ENABLED, 1-3 ACC CONTROL DISABLED
|
||||
|
||||
if self.CP.flags & (HyundaiFlags.HYBRID | HyundaiFlags.EV):
|
||||
|
|
|
@ -280,6 +280,8 @@ class CarInterfaceBase(ABC):
|
|||
events.add(EventName.wrongCarMode)
|
||||
if cs_out.espDisabled:
|
||||
events.add(EventName.espDisabled)
|
||||
if cs_out.espActive:
|
||||
events.add(EventName.espActive)
|
||||
if cs_out.stockFcw:
|
||||
events.add(EventName.stockFcw)
|
||||
if cs_out.stockAeb:
|
||||
|
|
|
@ -831,6 +831,11 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
|
|||
ET.NO_ENTRY: NoEntryAlert("Cruise Fault: Restart the Car"),
|
||||
},
|
||||
|
||||
EventName.espActive: {
|
||||
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Electronic Stability Control Active"),
|
||||
ET.NO_ENTRY: NoEntryAlert("Electronic Stability Control Active"),
|
||||
},
|
||||
|
||||
EventName.controlsMismatch: {
|
||||
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Controls Mismatch"),
|
||||
ET.NO_ENTRY: NoEntryAlert("Controls Mismatch"),
|
||||
|
|
Loading…
Reference in New Issue