improve crc camera error (#22943)

old-commit-hash: 5296ca8d73
commatwo_master
Adeeb Shihadeh 3 years ago committed by GitHub
parent 85b0e69efd
commit 1ffe047666
  1. 19
      selfdrive/controls/lib/events.py

@ -171,10 +171,10 @@ class EngagementAlert(Alert):
class NormalPermanentAlert(Alert): class NormalPermanentAlert(Alert):
def __init__(self, alert_text_1: str, alert_text_2: str = "", duration: float = 0.2, priority: Priority = Priority.LOWER): def __init__(self, alert_text_1: str, alert_text_2: str = "", duration: float = 0.2, priority: Priority = Priority.LOWER, creation_delay: float = 0.):
super().__init__(alert_text_1, alert_text_2, super().__init__(alert_text_1, alert_text_2,
AlertStatus.normal, AlertSize.mid if len(alert_text_2) else AlertSize.small, AlertStatus.normal, AlertSize.mid if len(alert_text_2) else AlertSize.small,
priority, VisualAlert.none, AudibleAlert.none, duration), priority, VisualAlert.none, AudibleAlert.none, duration, creation_delay=creation_delay),
class StartupAlert(Alert): class StartupAlert(Alert):
@ -692,18 +692,21 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
}, },
EventName.roadCameraError: { EventName.roadCameraError: {
ET.PERMANENT: NormalPermanentAlert("Road Camera Error", "", ET.PERMANENT: NormalPermanentAlert("Camera Error",
duration=10.), duration=1.,
creation_delay=30.),
}, },
EventName.driverCameraError: { EventName.driverCameraError: {
ET.PERMANENT: NormalPermanentAlert("Driver Camera Error", "", ET.PERMANENT: NormalPermanentAlert("Camera Error",
duration=10.), duration=1.,
creation_delay=30.),
}, },
EventName.wideRoadCameraError: { EventName.wideRoadCameraError: {
ET.PERMANENT: NormalPermanentAlert("Wide Road Camera Error", "", ET.PERMANENT: NormalPermanentAlert("Camera Error",
duration=10.), duration=1.,
creation_delay=30.),
}, },
# Sometimes the USB stack on the device can get into a bad state # Sometimes the USB stack on the device can get into a bad state

Loading…
Cancel
Save