fix(graph_msf): preserve IMU propagation across optimizer updates - #47
Merged
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
When graph states run below the IMU rate, an optimizer update can discard the IMU interval between its latest graph node and the latest received sample. The optimized state is also assigned the newer sample timestamp. At 400 Hz IMU and 40 Hz graph rates, the omitted interval can reach 22.5 ms.
Closest-IMU lookup also dereferences an invalid iterator when a request equals or exceeds the latest sample timestamp, or precedes the oldest sample.
Main change
Preserve the unfinished graph-step preintegration when starting optimizer catch-up. Keep the optimized timestamp and angular-velocity sample associated with the captured graph node. Initialization takes the measured gyro sample before bias correction. Direct callers of
initPoseVelocityBiasGraphmust supply that sample.Handle empty, single-sample, endpoint, and out-of-range IMU lookups safely. Preserve nearest-sample selection and tolerance checks. Protect lookup and buffer eviction with the same mutex.
Design decisions and tradeoffs
Copy the step preintegrator into the catch-up preintegrator without aliasing the objects. Preserve its bias linearization and Jacobians so prediction can apply the optimized bias. The latest IMU timestamp remains separate for measurement buffering.
Test plan
Optimizer handoff lost position integration.graph_config_testsuite against GTSAM 4.3 using FlexCode's Bazel overlay and--config re-amd64-ubuntu24.git diff --check.Passing regression run. No recording replay was run. Concurrent sample arrival during optimization was reviewed through the mutex and copy semantics, but is not simulated by these tests.
Co-authored by OpenAI Codex with user direction.