Skip to content

fix(sdk): keep an imu sample that arrives after an image at its time - #619

Merged
Ravenwater merged 1 commit into
mainfrom
fix/imu-tie-after-image
Nov 10, 2026
Merged

Ravenwater merged 1 commit into
mainfrom
fix/imu-tie-after-image

Conversation

@Ravenwater

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #618, from CodeRabbit's last review on it.

When an image reaches the filter clock before the IMU sample with the same timestamp, the image holds the previous sample up to the clock (the causal hold of #616), and the sample then arrives with dt = 0. Both backends dropped it as a duplicate. The next interval then started from the rate interpolated between the older and the later sample, not from the sample itself, which breaks #616's two-endpoint convention.

Both backends now remember a sample that is new at the clock, without propagating again. True duplicates (a sample time already remembered) are still rejected.

Changes

  • sdk/include/branes/sdk/msckf_backend.hpp: process_imu keeps a new equal-clock sample.
  • sdk/include/branes/sdk/msckf/invariant_vio_backend.hpp: the same.
  • tests/sdk/filter_clock.cpp: one test per backend comparing image-first with IMU-first delivery at a tie. The gyro is constant up to the tie and steps after it, so the two orders must agree to roundoff. Without the fix they differ by 1.25e-3 rad, the predicted midpoint error.

Impact

EuRoC's replay delivers every IMU sample at or before a frame first (asl_replay.hpp), so this path never ran there. No recorded numbers or fixtures change.

Test Results

Suite gcc clang
full ctest pass 601/601 pass
filter_clock (new cases fail without the fix) pass pass

🤖 Generated with Claude Code

When an image reaches the filter clock before the IMU sample that shares
its timestamp, the image holds the previous sample up to the clock and the
sample then arrives with dt = 0. Both backends dropped it as a duplicate,
so the next interval started from the rate interpolated between the older
and the later sample instead of from the sample itself, breaking the
two-endpoint convention of #616. Both now remember a sample new at the
clock without propagating again, and still reject true duplicates.

EuRoC's replay delivers IMU samples at or before a frame first, so no
recorded number changes. The tests compare image-first with IMU-first
delivery; without the fix they differ by 1.25e-3 rad.

Raised in review of #618.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 21 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between fc0490f and 932a860.

Files selected for processing: 3

  • sdk/include/branes/sdk/msckf/invariant_vio_backend.hpp
  • sdk/include/branes/sdk/msckf_backend.hpp
  • tests/sdk/filter_clock.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Ravenwater Ravenwater self-assigned this Nov 10, 2026
@Ravenwater
Ravenwater merged commit 7e43d32 into main Nov 10, 2026
14 checks passed
@Ravenwater
Ravenwater deleted the fix/imu-tie-after-image branch November 10, 2026 04:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant