Fix handling of image vs pico timestamps in localizer
The localizer internally operates off of "pico time" because
we use the pico timestamps for accelerometer dt. However, since
we only calculate the pico offset once at boot, we don't
want to allow pico <-> pi time drift to affect processing of images.
Change-Id: I0f649fb964a01cc7f985b1439aed12eae1ccb424
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2022/localizer/localizer.cc b/y2022/localizer/localizer.cc
index 954bffc..3f8e13d 100644
--- a/y2022/localizer/localizer.cc
+++ b/y2022/localizer/localizer.cc
@@ -954,6 +954,7 @@
model_based_.TallyRejection(RejectionReason::IMAGE_FROM_FUTURE);
continue;
}
+ capture_time -= pico_offset_error_;
model_based_.HandleImageMatch(
capture_time, target_estimate_fetchers_[camera_index].get(),
camera_index);