From bf04c4799ae2d46a2c53ea558b09c5efd719f2b3 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 14 Oct 2024 14:35:38 -0700 Subject: [PATCH] ui: always check for longitudinal control (#33788) should always check in case card publishes CP before we start camera paintGL --- selfdrive/ui/qt/onroad/model.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/selfdrive/ui/qt/onroad/model.cc b/selfdrive/ui/qt/onroad/model.cc index 595bb489a2..d1e3c7bde2 100644 --- a/selfdrive/ui/qt/onroad/model.cc +++ b/selfdrive/ui/qt/onroad/model.cc @@ -15,10 +15,6 @@ static int get_path_length_idx(const cereal::XYZTData::Reader &line, const float void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) { auto &sm = *(uiState()->sm); - if (sm.updated("carParams")) { - longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl(); - } - // Check if data is up-to-date if (!(sm.alive("liveCalibration") && sm.alive("modelV2"))) { return; @@ -26,6 +22,7 @@ void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) { clip_region = surface_rect.adjusted(-CLIP_MARGIN, -CLIP_MARGIN, CLIP_MARGIN, CLIP_MARGIN); experimental_mode = sm["selfdriveState"].getSelfdriveState().getExperimentalMode(); + longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl(); painter.save();