CarState: add invalidLkasSetting (#33700)

* invalidLkasSetting

* clean up car specific a bit

* clean this up

* deprecate!

* bump

* this was just broken lol

* updaterefs
This commit is contained in:
Shane Smiskol
2024-10-01 23:06:57 -07:00
committed by GitHub
parent c19c18cfdb
commit 98e1d840de
5 changed files with 10 additions and 16 deletions
+2 -1
View File
@@ -103,7 +103,6 @@ struct OnroadEvent @0x9b1657f34caf3ad3 {
selfdriveInitializing @98;
usbError @99;
cruiseMismatch @106;
lkasDisabled @107;
canBusMissing @111;
selfdrivedLagging @112;
resumeBlocked @113;
@@ -150,6 +149,7 @@ struct OnroadEvent @0x9b1657f34caf3ad3 {
highCpuUsageDEPRECATED @105;
startupNoFwDEPRECATED @104;
lowSpeedLockoutDEPRECATED @31;
lkasDisabledDEPRECATED @107;
}
}
@@ -199,6 +199,7 @@ struct CarState {
steeringPressed @9 :Bool; # if the user is using the steering wheel
steerFaultTemporary @35 :Bool; # temporary EPS fault
steerFaultPermanent @36 :Bool; # permanent EPS fault
invalidLkasSetting @55 :Bool; # stock LKAS is incorrectly configured (i.e. on or off)
stockAeb @30 :Bool;
stockFcw @31 :Bool;
espDisabled @32 :Bool;
+3 -6
View File
@@ -50,15 +50,10 @@ class CarSpecificEvents:
elif self.CP.carName == 'nissan':
events = self.create_common_events(CS.out, CS_prev, extra_gears=[GearShifter.brake])
if CS.lkas_enabled: # type: ignore[attr-defined]
events.add(EventName.invalidLkasSetting)
elif self.CP.carName == 'mazda':
events = self.create_common_events(CS.out, CS_prev)
if CS.lkas_disabled: # type: ignore[attr-defined]
events.add(EventName.lkasDisabled)
elif CS.low_speed_alert: # type: ignore[attr-defined]
if CS.low_speed_alert: # type: ignore[attr-defined]
events.add(EventName.belowSteerSpeed)
elif self.CP.carName == 'chrysler':
@@ -211,6 +206,8 @@ class CarSpecificEvents:
events.add(EventName.gasPressedOverride)
if CS.vehicleSensorsInvalid:
events.add(EventName.vehicleSensorsInvalid)
if CS.invalidLkasSetting:
events.add(EventName.invalidLkasSetting)
# Handle button presses
for b in CS.buttonEvents:
+3 -7
View File
@@ -394,8 +394,9 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
},
EventName.invalidLkasSetting: {
ET.PERMANENT: NormalPermanentAlert("Stock LKAS is on",
"Turn off stock LKAS to engage"),
ET.PERMANENT: NormalPermanentAlert("Invalid LKAS setting",
"Toggle stock LKAS on or off to engage"),
ET.NO_ENTRY: NoEntryAlert("Invalid LKAS setting"),
},
EventName.cruiseMismatch: {
@@ -945,11 +946,6 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
ET.NO_ENTRY: NoEntryAlert("Slow down to engage"),
},
EventName.lkasDisabled: {
ET.PERMANENT: NormalPermanentAlert("LKAS Disabled: Enable LKAS to engage"),
ET.NO_ENTRY: NoEntryAlert("LKAS Disabled"),
},
EventName.vehicleSensorsInvalid: {
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("Vehicle Sensors Invalid"),
ET.PERMANENT: NormalPermanentAlert("Vehicle Sensors Calibrating", "Drive to Calibrate"),
+1 -1
View File
@@ -1 +1 @@
2384c1fdb2db449fb6b09f5dc47b3314f4b1cfcf
1b4480f5ebf5a4003dde22f19bbcf989294bc724