From 07d1094f84b6a84b7b2ee592bd0d023bcdefe244 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sun, 16 Jan 2022 01:09:24 +0800 Subject: [PATCH] ui: fix invalid line vertices on startup (#23541) old-commit-hash: 6bd0e4b087d63ceda6911009bb5e1984f349a320 --- selfdrive/ui/ui.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index c33b61c19e..bfb805fd59 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -109,12 +109,6 @@ static void update_state(UIState *s) { SubMaster &sm = *(s->sm); UIScene &scene = s->scene; - if (sm.updated("modelV2")) { - update_model(s, sm["modelV2"].getModelV2()); - } - if (sm.updated("radarState") && sm.rcv_frame("modelV2") >= s->scene.started_frame) { - update_leads(s, sm["radarState"].getRadarState(), sm["modelV2"].getModelV2().getPosition()); - } if (sm.updated("liveCalibration")) { auto rpy_list = sm["liveCalibration"].getLiveCalibration().getRpyCalib(); Eigen::Vector3d rpy; @@ -131,6 +125,14 @@ static void update_state(UIState *s) { } } } + if (s->worldObjectsVisible()) { + if (sm.updated("modelV2")) { + update_model(s, sm["modelV2"].getModelV2()); + } + if (sm.updated("radarState") && sm.rcv_frame("modelV2") >= s->scene.started_frame) { + update_leads(s, sm["radarState"].getRadarState(), sm["modelV2"].getModelV2().getPosition()); + } + } if (sm.updated("pandaStates")) { auto pandaStates = sm["pandaStates"].getPandaStates(); if (pandaStates.size() > 0) {