add alerts for lkmode

This commit is contained in:
Rick Lan
2019-07-11 09:46:04 +10:00
parent c9db3ef937
commit a9e94ef9bb
3 changed files with 21 additions and 1 deletions
+2
View File
@@ -76,6 +76,8 @@ struct CarEvent @0x9b1657f34caf3ad3 {
controlsFailed @51;
sensorDataInvalid @52;
commIssue @53;
manualSteeringRequired @54;
manualSteeringRequiredBlinkersOn @55;
}
}
+5 -1
View File
@@ -489,7 +489,11 @@ class CarInterface(object):
# wait 1.0s before throwing the alert to avoid it popping when you turn off the car
if self.cp_cam.can_invalid_cnt >= 100 and self.CS.CP.carFingerprint not in HONDA_BOSCH and self.CP.enableCamera:
events.append(create_event('invalidGiraffeHonda', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
if self.CS.steer_error:
if not self.CS.lkMode:
events.append(create_event('manualSteeringRequired', [ET.WARNING]))
elif self.CS.lkMode and (self.CS.left_blinker_on or self.CS.right_blinker_on):
events.append(create_event('manualSteeringRequiredBlinkersOn', [ET.WARNING]))
elif self.CS.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
elif self.CS.steer_warning:
events.append(create_event('steerTempUnavailable', [ET.WARNING]))
+14
View File
@@ -661,4 +661,18 @@ ALERTS = [
"",
AlertStatus.normal, AlertSize.small,
Priority.LOWEST, VisualAlert.steerRequired, AudibleAlert.none, .0, .0, .1),
Alert(
"manualSteeringRequired",
"STEERING REQUIRED: Lane Keeping OFF",
"",
AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .0, .1, .1, alert_rate=0.25),
Alert(
"manualSteeringRequiredBlinkersOn",
"STEERING REQUIRED: Blinkers ON",
"",
AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .0, .1, .1, alert_rate=0.25),
]