mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
navmodeld: only render necessary frames (#26698)
This commit is contained in:
@@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user