navmodeld: only render necessary frames (#26698)

This commit is contained in:
Adeeb Shihadeh
2022-12-05 17:41:32 -08:00
committed by GitHub
parent f36e8bc3c7
commit 6e0893299a
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -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);
+1 -1
View File
@@ -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]));
}
}