navmodeld: only render necessary frames (#26698)

old-commit-hash: 6e0893299a
vw-mqb-aeb
Adeeb Shihadeh 3 years ago committed by GitHub
parent 3082c04e53
commit c2261c5372
  1. 1
      selfdrive/modeld/navmodeld.cc
  2. 2
      selfdrive/navd/map_renderer.cc

@ -21,7 +21,6 @@ void run_model(NavModelState &model, VisionIpcClient &vipc_client) {
while (!do_exit) {
VisionBuf *buf = vipc_client.recv(&extra);
if (buf == nullptr) continue;
if (extra.frame_id < last_frame_id + 10) continue; // Run at 2Hz
double t1 = millis_since_boot();
NavModelResult *model_res = navmodel_eval_frame(&model, buf);

@ -79,7 +79,7 @@ void MapRenderer::msgUpdate() {
auto orientation = location.getCalibratedOrientationNED();
bool localizer_valid = (location.getStatus() == cereal::LiveLocationKalman::Status::VALID) && pos.getValid();
if (localizer_valid) {
if (localizer_valid && (sm->rcv_frame("liveLocationKalman") % 10) == 0) {
updatePosition(QMapbox::Coordinate(pos.getValue()[0], pos.getValue()[1]), RAD2DEG(orientation.getValue()[2]));
}
}

Loading…
Cancel
Save