ui: revert the 'alive' check to compare with scene.started_frame (#33794)

Revert the 'alive' check to compare with scene.started_frame
pull/33816/head
Dean Lee 6 months ago committed by GitHub
parent 4537a9d2ac
commit af73d6084d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      selfdrive/ui/qt/onroad/hud.cc
  2. 6
      selfdrive/ui/qt/onroad/model.cc

@ -13,7 +13,7 @@ void HudRenderer::updateState(const UIState &s) {
status = s.status; status = s.status;
const SubMaster &sm = *(s.sm); const SubMaster &sm = *(s.sm);
if (!sm.alive("carState")) { if (sm.rcv_frame("carState") < s.scene.started_frame) {
is_cruise_set = false; is_cruise_set = false;
set_speed = SET_SPEED_NA; set_speed = SET_SPEED_NA;
speed = 0.0; speed = 0.0;

@ -14,9 +14,11 @@ static int get_path_length_idx(const cereal::XYZTData::Reader &line, const float
} }
void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) { void ModelRenderer::draw(QPainter &painter, const QRect &surface_rect) {
auto &sm = *(uiState()->sm); auto *s = uiState();
auto &sm = *(s->sm);
// Check if data is up-to-date // Check if data is up-to-date
if (!(sm.alive("liveCalibration") && sm.alive("modelV2"))) { if (sm.rcv_frame("liveCalibration") < s->scene.started_frame ||
sm.rcv_frame("modelV2") < s->scene.started_frame) {
return; return;
} }

Loading…
Cancel
Save