ui: always check for longitudinal control (#33788)

should always check in case card publishes CP before we start camera paintGL
This commit is contained in:
Shane Smiskol
2024-10-14 14:35:38 -07:00
committed by GitHub
parent fa4a3e3c63
commit bf04c4799a
+1 -4
View File
@@ -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();