From ffeee5c91b854e73f7f20d2396b01af54dd78ee1 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 19 Jan 2021 14:56:56 +0100 Subject: [PATCH] qt ui: sync fps with camera old-commit-hash: 978d0c8964fb3cc0c3c1a9241b6c4bb1fdbad5c9 --- selfdrive/ui/qt/home.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 2315af4e50..d388490d64 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -251,6 +251,10 @@ void GLWindow::timerUpdate() { if (ui_state.started != onroad) { onroad = ui_state.started; emit offroadTransition(!onroad); + + // Change timeout to 0 when onroad, this will call timerUpdate continously. + // This puts visionIPC in charge of update frequency, reducing video latency + timer->start(onroad ? 0 : 1000 / UI_FREQ); } handle_display_state(&ui_state, false);