alert text simplification (#23186)

* alert text simplification

* little more

* user triggered

* little more

* less annoying ldw

* Update selfdrive/controls/lib/events.py

* update refs

* revert
old-commit-hash: 4627d201b6
commatwo_master
Adeeb Shihadeh 4 years ago committed by GitHub
parent c686a1adc8
commit 853dc0d016
  1. 47
      selfdrive/controls/lib/events.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -153,6 +153,13 @@ class SoftDisableAlert(Alert):
AudibleAlert.warningSoft, 2.), AudibleAlert.warningSoft, 2.),
# less harsh version of SoftDisable, where the condition is user-triggered
class UserSoftDisableAlert(SoftDisableAlert):
def __init__(self, alert_text_2):
super().__init__(alert_text_2),
self.alert_text_1 = "openpilot will disengage"
class ImmediateDisableAlert(Alert): class ImmediateDisableAlert(Alert):
def __init__(self, alert_text_2): def __init__(self, alert_text_2):
super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2, super().__init__("TAKE CONTROL IMMEDIATELY", alert_text_2,
@ -247,7 +254,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
}, },
EventName.controlsInitializing: { EventName.controlsInitializing: {
ET.NO_ENTRY: NoEntryAlert("Controls Initializing"), ET.NO_ENTRY: NoEntryAlert("System Initializing"),
}, },
EventName.startup: { EventName.startup: {
@ -281,7 +288,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
}, },
EventName.invalidLkasSetting: { EventName.invalidLkasSetting: {
ET.PERMANENT: NormalPermanentAlert("Stock LKAS is turned on", ET.PERMANENT: NormalPermanentAlert("Stock LKAS is on",
"Turn off stock LKAS to engage"), "Turn off stock LKAS to engage"),
}, },
@ -293,8 +300,8 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
# detects the use of a community feature it switches to dashcam mode # detects the use of a community feature it switches to dashcam mode
# until these features are allowed using a toggle in settings. # until these features are allowed using a toggle in settings.
EventName.communityFeatureDisallowed: { EventName.communityFeatureDisallowed: {
ET.PERMANENT: NormalPermanentAlert("openpilot Not Available", ET.PERMANENT: NormalPermanentAlert("openpilot Unavailable",
"Enable Community Features in Settings to Engage"), "Enable Community Features in Settings"),
}, },
# openpilot doesn't recognize the car. This switches openpilot into a # openpilot doesn't recognize the car. This switches openpilot into a
@ -325,9 +332,9 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.ldw: { EventName.ldw: {
ET.PERMANENT: Alert( ET.PERMANENT: Alert(
"TAKE CONTROL",
"Lane Departure Detected", "Lane Departure Detected",
AlertStatus.userPrompt, AlertSize.mid, "",
AlertStatus.userPrompt, AlertSize.small,
Priority.LOW, VisualAlert.ldw, AudibleAlert.prompt, 3.), Priority.LOW, VisualAlert.ldw, AudibleAlert.prompt, 3.),
}, },
@ -335,7 +342,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.gasPressed: { EventName.gasPressed: {
ET.PRE_ENABLE: Alert( ET.PRE_ENABLE: Alert(
"openpilot will not brake while gas pressed", "Release Gas Pedal to Engage",
"", "",
AlertStatus.normal, AlertSize.small, AlertStatus.normal, AlertSize.small,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.), Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.),
@ -364,7 +371,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.preDriverDistracted: { EventName.preDriverDistracted: {
ET.WARNING: Alert( ET.WARNING: Alert(
"KEEP EYES ON ROAD: Driver Distracted", "Pay Attention",
"", "",
AlertStatus.normal, AlertSize.small, AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .1), Priority.LOW, VisualAlert.none, AudibleAlert.none, .1),
@ -372,7 +379,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.promptDriverDistracted: { EventName.promptDriverDistracted: {
ET.WARNING: Alert( ET.WARNING: Alert(
"KEEP EYES ON ROAD", "Pay Attention",
"Driver Distracted", "Driver Distracted",
AlertStatus.userPrompt, AlertSize.mid, AlertStatus.userPrompt, AlertSize.mid,
Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1),
@ -388,7 +395,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.preDriverUnresponsive: { EventName.preDriverUnresponsive: {
ET.WARNING: Alert( ET.WARNING: Alert(
"TOUCH STEERING WHEEL: No Face Detected", "Touch Steering Wheel: No Face Detected",
"", "",
AlertStatus.normal, AlertSize.small, AlertStatus.normal, AlertSize.small,
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.none, .1, alert_rate=0.75), Priority.LOW, VisualAlert.steerRequired, AudibleAlert.none, .1, alert_rate=0.75),
@ -396,7 +403,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.promptDriverUnresponsive: { EventName.promptDriverUnresponsive: {
ET.WARNING: Alert( ET.WARNING: Alert(
"TOUCH STEERING WHEEL", "Touch Steering Wheel",
"Driver Unresponsive", "Driver Unresponsive",
AlertStatus.userPrompt, AlertSize.mid, AlertStatus.userPrompt, AlertSize.mid,
Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1), Priority.MID, VisualAlert.steerRequired, AudibleAlert.promptDistracted, .1),
@ -421,7 +428,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.resumeRequired: { EventName.resumeRequired: {
ET.WARNING: Alert( ET.WARNING: Alert(
"STOPPED", "STOPPED",
"Press Resume to Move", "Press Resume to Go",
AlertStatus.userPrompt, AlertSize.mid, AlertStatus.userPrompt, AlertSize.mid,
Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), Priority.LOW, VisualAlert.none, AudibleAlert.none, .2),
}, },
@ -464,7 +471,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.steerSaturated: { EventName.steerSaturated: {
ET.WARNING: Alert( ET.WARNING: Alert(
"TAKE CONTROL", "Take Control",
"Turn Exceeds Steering Limit", "Turn Exceeds Steering Limit",
AlertStatus.userPrompt, AlertSize.mid, AlertStatus.userPrompt, AlertSize.mid,
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 1.), Priority.LOW, VisualAlert.steerRequired, AudibleAlert.promptRepeat, 1.),
@ -517,12 +524,12 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.parkBrake: { EventName.parkBrake: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Park Brake Engaged"), ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"),
}, },
EventName.pedalPressed: { EventName.pedalPressed: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Pedal Pressed During Attempt", ET.NO_ENTRY: NoEntryAlert("Pedal Pressed",
visual_alert=VisualAlert.brakePressed), visual_alert=VisualAlert.brakePressed),
}, },
@ -533,7 +540,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
EventName.wrongCruiseMode: { EventName.wrongCruiseMode: {
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage), ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
ET.NO_ENTRY: NoEntryAlert("Enable Adaptive Cruise"), ET.NO_ENTRY: NoEntryAlert("Adaptive Cruise Disabled"),
}, },
EventName.steerTempUnavailable: { EventName.steerTempUnavailable: {
@ -579,7 +586,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
}, },
EventName.wrongGear: { EventName.wrongGear: {
ET.SOFT_DISABLE: SoftDisableAlert("Gear not D"), ET.SOFT_DISABLE: UserSoftDisableAlert("Gear not D"),
ET.NO_ENTRY: NoEntryAlert("Gear not D"), ET.NO_ENTRY: NoEntryAlert("Gear not D"),
}, },
@ -601,12 +608,12 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
}, },
EventName.doorOpen: { EventName.doorOpen: {
ET.SOFT_DISABLE: SoftDisableAlert("Door Open"), ET.SOFT_DISABLE: UserSoftDisableAlert("Door Open"),
ET.NO_ENTRY: NoEntryAlert("Door Open"), ET.NO_ENTRY: NoEntryAlert("Door Open"),
}, },
EventName.seatbeltNotLatched: { EventName.seatbeltNotLatched: {
ET.SOFT_DISABLE: SoftDisableAlert("Seatbelt Unlatched"), ET.SOFT_DISABLE: UserSoftDisableAlert("Seatbelt Unlatched"),
ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"), ET.NO_ENTRY: NoEntryAlert("Seatbelt Unlatched"),
}, },
@ -789,7 +796,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
Priority.HIGH, VisualAlert.none, AudibleAlert.disengage, 3.), Priority.HIGH, VisualAlert.none, AudibleAlert.disengage, 3.),
}, },
# When the car is driving faster than most cars in the training data the model outputs can be unpredictable # When the car is driving faster than most cars in the training data, the model outputs can be unpredictable.
EventName.speedTooHigh: { EventName.speedTooHigh: {
ET.WARNING: Alert( ET.WARNING: Alert(
"Speed Too High", "Speed Too High",

@ -1 +1 @@
7dad09224e82177e1da44b89a253c343be45dd38 c09fc7b1409529a9991428845ee14f0e37d95b2d
Loading…
Cancel
Save