ReviewOS

stacks/drone

Sensors: calibrate and replay time-aligned IMU, GNSS and pressure samples

#3
Open chris opened this 8 days ago ·
8 days ago

What to build

Capture one real board IMU plus GNSS/barometer data into a typed sensor stream and reproduce the same stream through the simulator.

Acceptance criteria

  • Specify units, frames, covariance, sensor identity, monotonic capture time and quality flags.
  • Implement calibration, temperature compensation, dropout/stuck-sensor detection and independent sample-age checks.
  • Retain a reproducible physical capture/replay dataset and tests for timestamp skew and axis conventions. Synthetic replay and failure tests are implemented; measured capture remains open.

Implemented software slice

Commit 9583ba9 adds:

  • Separate neutral-only Pico 2 sensor image with original ICM-42688-P SPI, BMP280 I2C and receive-only u-blox NAV-PVT acquisition.
  • Bounded DS v1 records with boot/source identity, capture/read timestamps, sequence, uncertainty, quality and CRC. Shared UART preserves partial frames and prioritizes awaited runtime replies.
  • TypeScript SI conversion, right-handed mount mapping, bias/scale/thermal correction, diagonal noise variance, GNSS accuracy checks, independent age/dropout and repeated-value detection.
  • Qualified clock anchors/refresh records and replay on the existing simulation clock. EOF produces stale sensors while simulation continues. IMU filter delay and GNSS measurement epoch remain explicitly unvalidated.
  • Native Stacks sensors:replay, sensors:inspect and runtime:build --sensors commands shared with the compiled standalone CLI.
  • Independently encoded synthetic fixture, 24 sensor tests, native register/parser/codec and mixed-UART tests, sensor UF2 CI build and retained build evidence.

Local validation: 97 Bun tests, 12,451 assertions, two native CTest contracts, five Python tests, lint, application/runtime/view typechecks and roadmap check passed. Both firmware profiles cross-compiled with pinned tools. Standalone replay/inspection ran outside the checkout.

CI passed for both application checks and Pico firmware profiles.

See sensor guide, ADR 3, and software build evidence.

Remaining hardware acceptance

  • Capture all three physical devices on a disabled-load assembly; record board, sensor and mount identities.
  • Measure stationary/six-orientation calibration, thermal sweeps and noise. Bind measured profiles to the correct assembly.
  • Measure acquisition, filter/group and serialization delays and clock assumptions. Align GNSS navigation epochs with PPS/TIM-TP.
  • Run dropout/stuck fault injection on hardware and retain reproducible traces.
  • Complete issue #2 timing/watchdog/reset gates before relying on this runtime.

The retained dataset is scripted register data, not physical evidence. Logical device IDs are not silicon serial numbers. No estimator fusion or actuator authority is added. This issue remains open and in progress.

Blocked by

  • #2 Native runtime: run a deterministic sensor-to-actuator bench loop

Sign in to comment on this issue.