better alert when controls takes too long to start

old-commit-hash: f8ce6502a9
commatwo_master
Adeeb Shihadeh 5 years ago
parent 24adb459c3
commit 3d56b4cc35
  1. 9
      selfdrive/ui/ui.cc

@ -514,7 +514,6 @@ static void ui_update(UIState *s) {
s->vision_connect_firstrun = false; s->vision_connect_firstrun = false;
s->controls_timeout = 6 * UI_FREQ;
s->alert_blinking_alpha = 1.0; s->alert_blinking_alpha = 1.0;
s->alert_blinked = false; s->alert_blinked = false;
} }
@ -813,6 +812,10 @@ int main(int argc, char* argv[]) {
if (!s->started) { if (!s->started) {
// always process events offroad // always process events offroad
check_messages(s); check_messages(s);
if (s->started) {
s->controls_timeout = 5 * UI_FREQ;
}
} else { } else {
set_awake(s, true); set_awake(s, true);
// Car started, fetch a new rgb image from ipc // Car started, fetch a new rgb image from ipc
@ -860,11 +863,9 @@ int main(int argc, char* argv[]) {
} else if (s->started) { } else if (s->started) {
if (!s->controls_seen) { if (!s->controls_seen) {
// car is started, but controlsState hasn't been seen at all // 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_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; s->scene.alert_size = cereal::ControlsState::AlertSize::MID;
update_status(s, STATUS_WARNING);
} else { } else {
// car is started, but controls is lagging or died // car is started, but controls is lagging or died
LOGE("Controls unresponsive"); LOGE("Controls unresponsive");

Loading…
Cancel
Save