From 3d56b4cc3521dd16f244d259c82dba80440def83 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 23 Jun 2020 15:55:58 -0700 Subject: [PATCH] better alert when controls takes too long to start old-commit-hash: f8ce6502a9d66008d3a90b521707c4d1cbc51756 --- selfdrive/ui/ui.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index d622d61563..32c1543e5a 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -514,7 +514,6 @@ static void ui_update(UIState *s) { s->vision_connect_firstrun = false; - s->controls_timeout = 6 * UI_FREQ; s->alert_blinking_alpha = 1.0; s->alert_blinked = false; } @@ -813,6 +812,10 @@ int main(int argc, char* argv[]) { if (!s->started) { // always process events offroad check_messages(s); + + if (s->started) { + s->controls_timeout = 5 * UI_FREQ; + } } else { set_awake(s, true); // Car started, fetch a new rgb image from ipc @@ -860,11 +863,9 @@ int main(int argc, char* argv[]) { } else if (s->started) { if (!s->controls_seen) { // car is started, but controlsState hasn't been seen at all - LOGE("Controls failed to start"); s->scene.alert_text1 = "openpilot Unavailable"; - s->scene.alert_text2 = "Controls Failed to Start"; + s->scene.alert_text2 = "Waiting for controls to start"; s->scene.alert_size = cereal::ControlsState::AlertSize::MID; - update_status(s, STATUS_WARNING); } else { // car is started, but controls is lagging or died LOGE("Controls unresponsive");