Skip to content

Unify IMU API#1737

Merged
MaticTonin merged 9 commits intodevelopfrom
dev_mt_IMU_API
Apr 17, 2026
Merged

Unify IMU API#1737
MaticTonin merged 9 commits intodevelopfrom
dev_mt_IMU_API

Conversation

@MaticTonin
Copy link
Copy Markdown
Collaborator

@MaticTonin MaticTonin commented Mar 28, 2026

Purpose

Specification

None / not applicable

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

None / not applicable

Summary by CodeRabbit

  • New Features

    • Added an uncalibrated accelerometer stream and a reworked IMU calibration API exposing noise parameters, per-sensor 3×4 calibration matrices, and decomposition accessors (bias/scale/shear/rotation).
  • Documentation

    • Clarified IMU sensor descriptions to distinguish raw, uncalibrated, and calibrated outputs and frame alignments.
  • Examples

    • IMU example now uses calibrated streams, applies a rotation-based calibration helper, and reports latency in milliseconds.
  • Tests

    • Tests extended to validate runtime calibration, uncalibrated stream behavior, calibration decomposition, and 100Hz scenarios.
  • Chores

    • Updated device-side configuration identifiers.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Refactors IMU calibration from flat per-sensor vectors to canonical 3×4 matrix payloads, adds decomposition + noise parameter types, updates EEPROM layout, CalibrationHandler API/impl, Python bindings, example, tests, and IMU enums; bumps device-side config hashes.

Changes

Cohort / File(s) Summary
IMU Types & EEPROM
include/depthai/common/ImuParameters.hpp, include/depthai/common/EepromData.hpp
Introduce ImuCalibrationDecomposition, ImuNoiseParameters, ImuCalibrationParams; replace ImuModelParams and separate accel/gyro flat vectors with imuCalibrationParams (3×4 matrices + noise).
CalibrationHandler API & Impl
include/depthai/device/CalibrationHandler.hpp, src/device/CalibrationHandler.cpp
Remove flat-vector getters/setters; add matrix-based getters/setters (get*/set*Calibration), getImuNoiseParameters/setImuNoiseParameters, getImuParameters/setImuParameters; add decomposition accessors (bias/scale/shear/rotation), Eigen-based validation/decomposition, lazy caches and invalidation utilities.
Python Bindings
bindings/python/src/CalibrationHandlerBindings.cpp, bindings/python/src/pipeline/CommonBindings.cpp
Remove old flat accessors; expose ImuCalibrationDecomposition, ImuNoiseParameters, ImuCalibrationParams; add matrix getters/setters and decomposition accessors; update EepromData binding to use imuCalibrationParams.
IMU Enum & Docs
include/depthai/properties/IMUProperties.hpp, bindings/python/src/pipeline/node/IMUBindings.cpp
Add ACCELEROMETER_UNCALIBRATED enum entry and documentation clarifications; expose new enum value to Python.
Examples & Tests
examples/python/IMU/imu_gyroscope_accelerometer.py, tests/src/ondevice_tests/.../imu_test.cpp, tests/src/onhost_tests/calibration_handler_test.cpp
Example switched to calibrated streams and applies 3×4 affine rotations; on-device tests added/updated to validate calibrated vs uncalibrated behavior and runtime calibration effects; on-host tests updated for new params, decomposition and round-trip checks.
Build Config Updates
cmake/Depthai/DepthaiDeviceRVC4Config.cmake, cmake/Depthai/DepthaiDeviceSideConfig.cmake
Bump device-side commit/version hashes to match firmware supporting new IMU calibration layout.
Bindings: IMU sensor addition
bindings/python/src/pipeline/node/IMUBindings.cpp
Expose IMUSensor.ACCELEROMETER_UNCALIBRATED to Python.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application / Example
    participant Pipeline as Pipeline
    participant Device as DepthAI Device
    participant CalHandler as CalibrationHandler / EEPROM

    App->>Device: readCalibration()
    Device->>CalHandler: getImuParameters()
    CalHandler-->>Device: ImuCalibrationParams (noise + 3x4 accel/gyro)
    Device-->>App: calibration payload

    App->>Device: setAccelerometerCalibration(3x4), setGyroscopeCalibration(3x4)
    Device->>CalHandler: setImuParameters(...) / setImuNoiseParameters(...)
    CalHandler-->>Device: ack (cache updated)

    Pipeline->>Device: request IMU stream (ACCELEROMETER / ACCELEROMETER_UNCALIBRATED)
    Device->>Pipeline: IMU packets (calibrated vs uncalibrated)
    Pipeline-->>App: deliver IMU frames
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested labels

testable

Suggested reviewers

  • whoactuallycares
  • pheec

Poem

🐰
I nudge the matrices, turn axes bright,
Bias and shear now hop to right.
From vectors flat to rotations grand,
IMU hops truer across the land. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Unify IMU API" directly and accurately summarizes the primary change in the PR, which refactors IMU calibration accessors across Python bindings, C++ headers, and implementation to use a unified, canonical matrix-based API instead of the previous flat parameter vectors.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_mt_IMU_API

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MaticTonin MaticTonin requested review from banulucian, pheec and whoactuallycares and removed request for banulucian March 28, 2026 01:08
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/python/src/CalibrationHandlerBindings.cpp`:
- Around line 145-156: Add DOC() docstring macros to the newly added IMU
calibration Python bindings so they expose documentation to users; specifically
wrap the binding registrations like getAccelerometerCalibration,
getGyroscopeCalibration, getImuNoiseParameters, getImuParameters,
getAccelerometerBias, getGyroscopeBias, getAccelerometerScale,
getGyroscopeScale, getAccelerometerShear, getGyroscopeShear,
getAccelerometerRotation and getGyroscopeRotation with the same DOC("...") macro
pattern used elsewhere in this file, and also add DOC() for the related bindings
around lines referenced (the ones at 254-257) so all new methods have consistent
docstrings. Ensure each DOC contains a brief description and parameter/return
info matching the C++ method semantics.

In `@bindings/python/src/pipeline/CommonBindings.cpp`:
- Around line 78-84: The ImuCalibrationDecomposition pybind11 binding is missing
the DOC() macro like the other types; update the
py::class_<ImuCalibrationDecomposition> declaration to include DOC(dai,
ImuCalibrationDecomposition) so the binding mirrors
ImuNoiseParameters/ImuCalibrationParams and pulls in the C++ header
documentation for ImuCalibrationDecomposition.

In `@bindings/python/src/pipeline/node/IMUBindings.cpp`:
- Line 32: The new enum binding for ACCELEROMETER_UNCALIBRATED in IMUSensor uses
a hardcoded docstring while other enum values use the DOC() macro; replace the
literal string with the DOC(dai, IMUSensor, ACCELEROMETER_UNCALIBRATED) macro so
documentation stays consistent and in sync with the C++ header—update the .value
call that references IMUSensor::ACCELEROMETER_UNCALIBRATED to use DOC(dai,
IMUSensor, ACCELEROMETER_UNCALIBRATED) instead of the inline string.

In `@examples/python/IMU/imu_gyroscope_accelerometer.py`:
- Around line 37-42: The code uses a non-existent type
dai.ImuAffineCalibrationParams; update the x_axis_rotation_90deg function and
its return type to use dai.ImuCalibrationParams instead, construct an instance
(calib) and set calib.accelerometer and calib.gyroscope to the 3x4 rotation
matrices, then return calib so that the existing calls
calibration.setAccelerometerCalibration(...) and
calibration.setGyroscopeCalibration(...) (and
device.setCalibration(calibration)) receive the correct type; ensure the
function signature and any type hints reference dai.ImuCalibrationParams and
that the calibration variable passed to device.setCalibration is of that type.

In `@include/depthai/common/EepromData.hpp`:
- Around line 34-35: Update the misleading comment above the
ImuCalibrationParams field to state that this calibration struct is serialized
to EEPROM via DEPTHAI_SERIALIZE_OPTIONAL_EXT and describe its actual contents
(e.g., biases, scale factors, noise parameters, and other IMU calibration data)
rather than calling it "not really stored" or only "noise parameters"; locate
the comment adjacent to the ImuCalibrationParams declaration and replace it with
a concise accurate description noting serialization and the types of calibration
values contained.

In `@include/depthai/device/CalibrationHandler.hpp`:
- Around line 787-789: The two mutable caches accelerometerDecompositionCache
and gyroscopeDecompositionCache in CalibrationHandler are lazily initialized
from the const getters getAccelerometerDecompositionCache() and
getGyroscopeDecompositionCache(), which creates a TOCTOU race when accessed
concurrently; protect these caches by adding synchronization (e.g., a mutable
std::mutex per-cache or a single mutable std::mutex for both, or use a mutable
std::once_flag and std::call_once for each cache) and acquire the lock (or
call_once) around the has_value check, computation and assignment so only one
thread computes/sets the cache and readers see a fully initialized value.

In `@src/device/CalibrationHandler.cpp`:
- Around line 1296-1299: The public method
invalidateImuCalibrationDecomposition() is unused and redundant because
accelerometer/gyroscope caches are set directly by setAccelerometerCalibration
and setGyroscopeCalibration and caches are lazily recomputed on access; either
remove invalidateImuCalibrationDecomposition() or document it as an intentional
public API for external callers. To fix: either delete the
invalidateImuCalibrationDecomposition() definition and any declaration, or add a
clear doc comment above invalidateImuCalibrationDecomposition() stating it is a
public API meant for external invalidation of accelerometerDecompositionCache
and gyroscopeDecompositionCache (and update related header), and ensure
fromJson() and the cache setters behavior remains unchanged.

In `@tests/src/ondevice_tests/pipeline/node/imu_test.cpp`:
- Around line 97-196: Both captureAverageAccelerometer and
captureAverageGyroscope duplicate pipeline setup, calibration and sampling
logic; extract the common behavior into a single templated helper (e.g.,
captureAverageImu) that takes an extractor callback and the primary sensor type,
then replace captureAverageAccelerometer/captureAverageGyroscope with thin
wrappers that call captureAverageImu passing the appropriate extractor (lambda
to return imuPacket.acceleroMeter or imuPacket.gyroscope) and samplePacketCount;
keep existing calls to imu->enableIMUSensor,
device->readCalibration()/setCalibration, p.start()/p.stop(), and imuQueue usage
inside the helper so warmupPacketCount, samplePacketCount, and calibration
remain parameters.

In `@tests/src/onhost_tests/calibration_handler_test.cpp`:
- Line 11: The helper function names are inconsistent: change
makeimuNoiseParams, makeimuNoiseParamsJson, and requireimuNoiseParamsEqual to
use the same casing style as makeImuCalibration (e.g., makeImuNoiseParams,
makeImuNoiseParamsJson, requireImuNoiseParamsEqual) so naming is consistent;
update all declarations and call sites to the new identifiers to ensure
compilation and coherent naming across Imu-related helpers.
- Around line 1074-1075: Two identical assertions are called back-to-back:
requireimuNoiseParamsEqual(handler.getImuNoiseParameters(), expectedNoise)
appears twice; remove the duplicate call so only a single
requireimuNoiseParamsEqual(handler.getImuNoiseParameters(), expectedNoise)
remains (or replace the second with a different, intended assertion if another
check was meant).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cc289b5d-1365-4f8c-9ee8-afd8d1fddeee

📥 Commits

Reviewing files that changed from the base of the PR and between 75ad981 and cfe5f11.

📒 Files selected for processing (13)
  • bindings/python/src/CalibrationHandlerBindings.cpp
  • bindings/python/src/pipeline/CommonBindings.cpp
  • bindings/python/src/pipeline/node/IMUBindings.cpp
  • cmake/Depthai/DepthaiDeviceRVC4Config.cmake
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
  • examples/python/IMU/imu_gyroscope_accelerometer.py
  • include/depthai/common/EepromData.hpp
  • include/depthai/common/ImuParameters.hpp
  • include/depthai/device/CalibrationHandler.hpp
  • include/depthai/properties/IMUProperties.hpp
  • src/device/CalibrationHandler.cpp
  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
  • tests/src/onhost_tests/calibration_handler_test.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • bindings/python/src/pipeline/node/IMUBindings.cpp
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
  • include/depthai/common/EepromData.hpp
  • cmake/Depthai/DepthaiDeviceRVC4Config.cmake
  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
  • bindings/python/src/pipeline/CommonBindings.cpp
  • include/depthai/common/ImuParameters.hpp
  • tests/src/onhost_tests/calibration_handler_test.cpp
  • include/depthai/device/CalibrationHandler.hpp
  • src/device/CalibrationHandler.cpp
📚 Learning: 2026-03-23T09:35:34.824Z
Learnt from: aljazkonec1
Repo: luxonis/depthai-core PR: 1728
File: protos/common.proto:20-25
Timestamp: 2026-03-23T09:35:34.824Z
Learning: In the depthai-core repository (luxonis/depthai-core), the `LengthUnit` and `CameraBoardSocket` enums (defined in both C++ headers and `protos/common.proto`) are already released as public API and must not have their existing enumerator values changed or have new zero-value "UNSPECIFIED" entries prepended, as that would break existing user code and serialized data.

Applied to files:

  • bindings/python/src/pipeline/node/IMUBindings.cpp
  • include/depthai/common/EepromData.hpp
  • cmake/Depthai/DepthaiDeviceRVC4Config.cmake
  • include/depthai/properties/IMUProperties.hpp
  • src/device/CalibrationHandler.cpp
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • include/depthai/common/EepromData.hpp
🪛 Cppcheck (2.20.0)
bindings/python/src/pipeline/node/IMUBindings.cpp

[information] 32-32: Include file

(missingIncludeSystem)

tests/src/ondevice_tests/pipeline/node/imu_test.cpp

[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingInclude)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingInclude)


[information] 18-18: Include file

(missingInclude)


[information] 19-19: Include file

(missingInclude)


[information] 20-20: Include file

(missingInclude)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[error] 23-23: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 25-25: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)

tests/src/onhost_tests/calibration_handler_test.cpp

[information] 2-2: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)

src/device/CalibrationHandler.cpp

[information] 13-13: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)

🔇 Additional comments (16)
cmake/Depthai/DepthaiDeviceSideConfig.cmake (1)

5-5: LGTM - Firmware commit hash update.

The device-side commit hash is updated to align with the IMU API changes introduced in this PR. The hash format is valid (40 hex characters) and maturity is correctly set to "snapshot".

cmake/Depthai/DepthaiDeviceRVC4Config.cmake (1)

6-6: LGTM - RVC4 firmware version update.

The RVC4 device version is updated to align with the IMU API changes. The version format (semver + commit hash) is consistent.

examples/python/IMU/imu_gyroscope_accelerometer.py (1)

9-16: Good example of the new calibration API.

The function correctly constructs a 90° rotation matrix around the x-axis. The matrix representation as a flat 12-element list for a 3×4 affine transform is clear.

include/depthai/properties/IMUProperties.hpp (2)

23-30: Good addition of ACCELEROMETER_UNCALIBRATED with clear documentation.

The new synthetic sensor type at value 0x100 is appropriately placed outside the BNO080 sensor ID range (0x01-0x29), clearly indicating it's a DepthAI-processed stream. The documentation accurately describes the behavior (DepthAI IMU frame alignment without stored affine calibration).


18-22: Documentation improvements are accurate and helpful.

The clarified documentation for ACCELEROMETER_RAW and other sensor types now clearly distinguishes between sensor-native frame measurements (no DepthAI processing) and DepthAI-aligned outputs with or without affine calibration. This will help users choose the appropriate stream for their use case.

tests/src/ondevice_tests/pipeline/node/imu_test.cpp (2)

14-32: Good handling of IMU model-specific sensor support.

The sensor filtering for BMI270 (which lacks magnetometer and rotation vector support) with early SKIP on empty sensor list is well implemented. This prevents test failures on devices with different IMU capabilities.


206-252: Comprehensive calibration test coverage.

The tests effectively validate:

  1. Axis rotations are correctly applied to calibrated accelerometer output
  2. ACCELEROMETER_UNCALIBRATED ignores runtime calibration (verified with tighter 1e-2 margin)
  3. Bias offsets affect both accelerometer and gyroscope outputs

This provides good confidence in the runtime calibration pipeline.

bindings/python/src/pipeline/CommonBindings.cpp (2)

601-602: Good backward compatibility aliases.

The module-level aliases ImuParametersImuCalibrationParams and ImuModelParamsImuNoiseParameters provide a migration path for existing code using the old type names. Consider adding deprecation warnings to these aliases in a future release.


559-576: LGTM - New IMU parameter type bindings.

The bindings for ImuCalibrationDecomposition, ImuNoiseParameters, and ImuCalibrationParams correctly expose all relevant fields and follow the established binding patterns in this file.

include/depthai/common/ImuParameters.hpp (2)

42-50: LGTM!

The ImuCalibrationDecomposition structure properly models the optional affine decomposition components with empty default vectors, and includes appropriate serialization.


66-73: LGTM!

The ImuCalibrationParams structure correctly defaults to identity calibration matrices (3x4 [I|0] form) and properly combines noise parameters with per-sensor calibration data.

tests/src/onhost_tests/calibration_handler_test.cpp (1)

1041-1103: LGTM!

The new IMU API test comprehensively validates canonical calibration preservation and decomposition. The test synthesizes realistic calibration matrices, verifies round-trip storage, and checks that decomposed components (bias, scale, shear, rotation) match expected values within appropriate tolerances.

include/depthai/device/CalibrationHandler.hpp (1)

411-477: LGTM!

The new IMU calibration API is well-documented with clear descriptions for each getter. The decomposition API follows the mathematical model Q = S * H * R consistently across accelerometer and gyroscope methods.

src/device/CalibrationHandler.cpp (3)

60-113: LGTM!

The Eigen-based QR decomposition correctly extracts the affine calibration components. The approach using the permutation matrix J to reverse row/column order for upper-triangular extraction, followed by sign correction to ensure positive scales, is mathematically sound. The singularity check with epsilon 1e-7f is appropriate for float precision.


1262-1284: LGTM!

The calibration setters properly validate input dimensions, store the calibration matrix, immediately compute the decomposition, and populate the cache. This eager caching approach ensures consistency and avoids redundant computation on subsequent reads.


358-363: The stale cache concern is architecturally unfounded: the API prevents external modification of eepromData.

The getEepromData() method returns a const value (not a mutable reference), and the constructor accepts the parameter by value. Users cannot obtain a mutable reference to modify eepromData after construction. Additionally, no setter methods exist that would modify calibration data or require cache invalidation. The lazy initialization pattern is sound—the optional caches start empty and are computed on first access, which is safe because eepromData cannot be mutated externally.

Comment thread bindings/python/src/CalibrationHandlerBindings.cpp Outdated
Comment thread bindings/python/src/pipeline/CommonBindings.cpp Outdated
Comment thread bindings/python/src/pipeline/node/IMUBindings.cpp Outdated
Comment thread examples/python/IMU/imu_gyroscope_accelerometer.py Outdated
Comment thread include/depthai/common/EepromData.hpp Outdated
Comment thread include/depthai/device/CalibrationHandler.hpp Outdated
Comment thread src/device/CalibrationHandler.cpp Outdated
Comment thread tests/src/ondevice_tests/pipeline/node/imu_test.cpp
Comment thread tests/src/onhost_tests/calibration_handler_test.cpp Outdated
Comment thread tests/src/onhost_tests/calibration_handler_test.cpp Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/src/ondevice_tests/pipeline/node/imu_test.cpp`:
- Around line 419-440: Save the device's current runtime calibration before
calling device->setCalibration(readBack) and restore it at the end of the
TEST_CASE to ensure test isolation: capture the original calibration via
device->getCalibration() (or readCalibration() if appropriate) before modifying
runtime with device->setCalibration(readBack), then call
device->setCalibration(originalCalibration) as cleanup after the assertions (or
in a RAII/finally-style block) so other tests run with the original runtime
calibration unchanged; reference the existing symbols device->getCalibration(),
device->setCalibration(), and readBack in your changes.
- Around line 96-100: Rename the test constant kRandomRotation to a clearer name
such as kArbitraryNonIdentityMatrix (or kTestNonIdentityMatrix) to indicate it
is not a valid rotation matrix; update the declaration and all references to
this identifier (including uses in the IMU tests that assert "preserves
non-identity IMU extrinsics") so the symbol name is consistent across the file
(change the const std::vector<std::vector<float>> kRandomRotation declaration
and replace every occurrence of kRandomRotation with the new name).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0fbbac6f-c54b-451b-b997-88f430073c09

📥 Commits

Reviewing files that changed from the base of the PR and between 94f85f3 and af70673.

📒 Files selected for processing (1)
  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
📚 Learning: 2026-03-24T22:39:05.647Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:05.647Z
Learning: In `src/pipeline/Pipeline.cpp`, within `PipelineImpl::build()`, the condition `autoCalibrationString != "OFF" && autoCalibrationString != ""` intentionally retains the empty-string check. Even though `utility::getEnvAs<std::string>("DEPTHAI_AUTOCALIBRATION", "ON_START")` provides a default of `"ON_START"`, the explicit `!= ""` guard is kept on purpose and should not be flagged as redundant in future reviews.

Applied to files:

  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • tests/src/ondevice_tests/pipeline/node/imu_test.cpp
🪛 Cppcheck (2.20.0)
tests/src/ondevice_tests/pipeline/node/imu_test.cpp

[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingInclude)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingInclude)


[information] 18-18: Include file

(missingInclude)


[information] 19-19: Include file

(missingInclude)


[information] 20-20: Include file

(missingInclude)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[error] 23-23: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 25-25: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)

🔇 Additional comments (13)
tests/src/ondevice_tests/pipeline/node/imu_test.cpp (13)

110-209: Code duplication already flagged.

The duplication between captureAverageAccelerometer and captureAverageGyroscope was noted in a previous review. Consider extracting common logic into a templated/callback-based helper as suggested.


1-11: LGTM!

Standard includes added appropriately for the new test infrastructure (<array> for Vec3, <cmath> for std::abs, <optional> for calibration parameters, <vector> for matrix types).


15-37: LGTM!

The BMI270-specific sensor filtering is well-implemented. The approach correctly skips unsupported sensor types (magnetometer and rotation vector variants) and gracefully handles the edge case where no sensors remain with a SKIP directive.


60-62: LGTM!

Good addition to test the new ACCELEROMETER_UNCALIBRATED sensor type alongside GYROSCOPE_UNCALIBRATED at 100Hz.


102-108: LGTM!

Correctly implements a 3×4 affine transformation (linear transform + translation bias).


211-244: LGTM!

Helper functions are well-implemented with appropriate tolerance handling and size validation.


246-268: LGTM!

Good encapsulation of IMU extrinsics manipulation and comparison logic.


271-306: LGTM!

Well-structured test with correct 90° rotation matrices for each axis. Good coverage of calibration rotation effects.


308-317: LGTM!

Important test verifying that ACCELEROMETER_UNCALIBRATED correctly bypasses runtime affine calibration.


319-361: LGTM!

Comprehensive test of bias offset application with good coverage of all three axes for both accelerometer and gyroscope.


363-377: LGTM!

Good test structure with proper save/restore of original calibration.


379-398: LGTM!

Properly handles BNO086-specific behavior testing with appropriate skip logic and cleanup.


400-417: LGTM!

Good test verifying separation between runtime calibration (getCalibration) and persisted calibration (readCalibration).

Comment thread tests/src/ondevice_tests/pipeline/node/imu_test.cpp Outdated
Comment thread tests/src/ondevice_tests/pipeline/node/imu_test.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmake/Depthai/DepthaiDeviceSideConfig.cmake`:
- Around line 7-8: Set DEPTHAI_DEVICE_SIDE_VERSION to the new firmware tag or
semantic version and add a brief inline comment on the same line explaining the
IMU API change; specifically update the DEPTHAI_DEVICE_SIDE_VERSION variable
(DEPTHAI_DEVICE_SIDE_VERSION) to the correct version string and append a comment
like "IMU calibration API unified to 3×4 matrix format" so future readers can
trace the firmware bump and the key change.
- Line 5: The DEPTHAI_DEVICE_SIDE_COMMIT update may be incomplete: confirm
whether DEPTHAI_DEVICE_RVC4_COMMIT must be bumped alongside
DEPTHAI_DEVICE_SIDE_COMMIT to keep IMU API compatibility, populate
DEPTHAI_DEVICE_SIDE_VERSION to mirror the RVC4 version format if appropriate,
and add a human-readable version or changelog reference for commit
2a359e5e677db0d91118849c9f80d656b6c112e4; to fix, inspect the firmware repo for
that commit to list included changes, update DepthaiDeviceRVC4Config.cmake
(DEPTHAI_DEVICE_RVC4_COMMIT) if the RVC4 firmware also needs bumping, set
DEPTHAI_DEVICE_SIDE_VERSION to the corresponding semantic/version string (or
document why it should remain empty), and add a comment or variable pointing to
the changelog/PR hash for clarity (refer to symbols DEPTHAI_DEVICE_SIDE_COMMIT,
DEPTHAI_DEVICE_RVC4_COMMIT, DEPTHAI_DEVICE_SIDE_VERSION, and
DEPTHAI_DEVICE_RVC4_VERSION).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 08d8350b-5e16-41c3-a31c-79ac094aa558

📥 Commits

Reviewing files that changed from the base of the PR and between ef4f054 and bac7ddc.

📒 Files selected for processing (1)
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
📜 Review details
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • cmake/Depthai/DepthaiDeviceSideConfig.cmake

Comment thread cmake/Depthai/DepthaiDeviceSideConfig.cmake Outdated
Comment thread cmake/Depthai/DepthaiDeviceSideConfig.cmake
Copy link
Copy Markdown
Collaborator

@moratom moratom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe makes sense to deprecate ACCELEROMETER, GRAVITY and LINEAR_ACCELERATION if we don't handle them properly, otherwise LGTM.

Comment thread include/depthai/common/DepthUnit.hpp Outdated
Comment thread bindings/python/src/CalibrationHandlerBindings.cpp Outdated
Comment thread include/depthai/properties/IMUProperties.hpp Outdated
@MaticTonin MaticTonin force-pushed the dev_mt_IMU_API branch 6 times, most recently from 71cde18 to bed3bfb Compare April 10, 2026 15:40
@MaticTonin MaticTonin added the testable PR is ready to be tested label Apr 14, 2026
- Rename IMU API with updated bindings and tests
- Add uncalibrated IMU bindings support
- Refactor calibration handler with enhanced decomposition
- Change ACCELEROMETER to ACCELEROMETER_CALIBRATED, deprecate GRAVITY and LINEAR_ACCELEROMETER
- Add depth unit support to calibration
- Expand IMU test coverage for on-device and on-host scenarios
- Update firmware versions (FW and RVC2/RVC4)
- Remove legacy noise parameters setter

Update test

Bump FW

Update tests

Bump Core

Add rotation vector example
Copy link
Copy Markdown
Collaborator

@JakubFara JakubFara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaticTonin MaticTonin removed the testable PR is ready to be tested label Apr 16, 2026
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase

@MaticTonin MaticTonin added the testable PR is ready to be tested label Apr 17, 2026
@MaticTonin MaticTonin merged commit 7fac7e6 into develop Apr 17, 2026
1 check passed
@MaticTonin MaticTonin deleted the dev_mt_IMU_API branch April 17, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testable PR is ready to be tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants