mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 11:32:21 +08:00
wait 5s before showing waiting for controls
old-commit-hash: d6571aa633ba3a4602bcb1cf5f8cbad134e18c10
This commit is contained in:
+2
-3
@@ -244,14 +244,13 @@ void ui_update(UIState *s) {
|
||||
}
|
||||
|
||||
// Handle controls timeout
|
||||
bool controls_timeout = ((s->sm)->frame - (s->sm)->rcv_frame("controlsState")) > 10*UI_FREQ;
|
||||
if (s->started && !s->scene.frontview && controls_timeout) {
|
||||
if (s->started && !s->scene.frontview && ((s->sm)->frame - s->started_frame) > 5*UI_FREQ) {
|
||||
if ((s->sm)->rcv_frame("controlsState") < s->started_frame) {
|
||||
// car is started, but controlsState hasn't been seen at all
|
||||
s->scene.alert_text1 = "openpilot Unavailable";
|
||||
s->scene.alert_text2 = "Waiting for controls to start";
|
||||
s->scene.alert_size = cereal::ControlsState::AlertSize::MID;
|
||||
} else {
|
||||
} else if (((s->sm)->frame - (s->sm)->rcv_frame("controlsState")) > 5*UI_FREQ) {
|
||||
// car is started, but controls is lagging or died
|
||||
if (s->scene.alert_text2 != "Controls Unresponsive") {
|
||||
s->sound->play(AudibleAlert::CHIME_WARNING_REPEAT);
|
||||
|
||||
Reference in New Issue
Block a user