Skip to content

Commit 84b1f36

Browse files
authored
Alert for stock LKAS (#36969)
* alert stock lkas * high * i didn't do this
1 parent a5348b8 commit 84b1f36

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

cereal/log.capnp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct OnroadEvent @0xc4fa6047f024e718 {
8787
laneChange @50;
8888
lowMemory @51;
8989
stockAeb @52;
90+
stockLkas @98;
9091
ldw @53;
9192
carUnrecognized @54;
9293
invalidLkasSetting @55;

selfdrive/car/car_specific.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ def create_common_events(self, CS: structs.CarState, CS_prev: car.CarState):
119119
events.add(EventName.stockFcw)
120120
if CS.stockAeb:
121121
events.add(EventName.stockAeb)
122+
if CS.stockLkas:
123+
events.add(EventName.stockLkas)
122124
if CS.vEgo > MAX_CTRL_SPEED:
123125
events.add(EventName.speedTooHigh)
124126
if CS.cruiseState.nonAdaptive:

selfdrive/selfdrived/events.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,15 @@ def invalid_lkas_setting_alert(CP: car.CarParams, CS: car.CarState, sm: messagin
477477
ET.NO_ENTRY: NoEntryAlert("Stock AEB: Risk of Collision"),
478478
},
479479

480+
EventName.stockLkas: {
481+
ET.PERMANENT: Alert(
482+
"TAKE CONTROL",
483+
"Stock LKAS: Lane Departure Detected",
484+
AlertStatus.critical, AlertSize.full,
485+
Priority.HIGH, VisualAlert.fcw, AudibleAlert.none, 2.),
486+
ET.NO_ENTRY: NoEntryAlert("Stock LKAS: Lane Departure Detected"),
487+
},
488+
480489
EventName.fcw: {
481490
ET.PERMANENT: Alert(
482491
"BRAKE!",

0 commit comments

Comments
 (0)