Skip to content

Fix replay flasing of calibration#1739

Merged
moratom merged 2 commits intodevelopfrom
dev_mt_fixReplayFlashing
Apr 2, 2026
Merged

Fix replay flasing of calibration#1739
moratom merged 2 commits intodevelopfrom
dev_mt_fixReplayFlashing

Conversation

@MaticTonin
Copy link
Copy Markdown
Collaborator

@MaticTonin MaticTonin commented Apr 1, 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

  • Bug Fixes

    • Auto-calibration now validates distortion model compatibility across camera pairs and disables flash calibration if incompatibilities are detected.
  • Chores

    • Adjusted calibration logging message severity levels.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 80ad5175-1743-4e18-9b4f-a18a0b825c08

📥 Commits

Reviewing files that changed from the base of the PR and between d377da7 and 216cad6.

📒 Files selected for processing (1)
  • src/pipeline/Pipeline.cpp

📝 Walkthrough

Walkthrough

Modified auto-calibration initialization in Pipeline.cpp by adding a distortion comparison helper function, reordering the control flow to move record/replay setup earlier, and extending calibration logic to read EEPROM, compare distortion coefficients, and conditionally disable flash calibration based on detected differences or read failures.

Changes

Cohort / File(s) Summary
Auto-calibration Initialization & Distortion Comparison
src/pipeline/Pipeline.cpp
Added hasDifferentDistortion() helper to compare CalibrationHandler instances per socket; reordered build() to move setupHolisticRecordAndReplay() earlier; extended AutoCalibration initialization to read EEPROM calibration, compare distortion on stereo sockets, and conditionally set flashCalibration to false if differences detected or read fails; changed logging severity from warn to info for missing/invalid calibration cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #1732: Modifies auto-calibration initialization and logging behavior in Pipeline.cpp with overlapping control flow changes.

Suggested reviewers

  • JakubFara

Poem

🐰 Ah, the calibration dance so fine,
Distortion coefficients all align,
With EEPROM whispers, compare with care,
Flash off if differences dare appear!
Control flow reordered, a hop and a bound.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 PR title 'Fix replay flasing of calibration' is related to the changeset. The changes in AutoCalibration.cpp and Pipeline.cpp directly address calibration handling and flashCalibration logic, which aligns with fixing replay flashing of calibration.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_mt_fixReplayFlashing

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.

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: 1

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

Inline comments:
In `@src/pipeline/node/AutoCalibration.cpp`:
- Around line 344-355: The loop over leftBoardSocket/rightBoardSocket currently
skips sockets equal to CameraBoardSocket::AUTO and can return true when no
comparisons run; modify the AutoCalibration logic (in AutoCalibration.cpp) to
track whether any hasDifferentDistortion(runtimeCalibration, eepromCalibration,
socket) comparisons were actually performed (e.g., a bool compared flag toggled
when socket != CameraBoardSocket::AUTO) and, after the loop, return false if no
comparisons occurred (safer default) instead of returning true; keep the
existing logger->warn usage for per-socket mismatches and only allow returning
true when at least one valid comparison succeeded.
🪄 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: b6eb14d4-c17d-415b-bfa6-1aea2a8e7714

📥 Commits

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

📒 Files selected for processing (2)
  • include/depthai/pipeline/node/AutoCalibration.hpp
  • src/pipeline/node/AutoCalibration.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
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.
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:327-330
Timestamp: 2026-03-13T19:40:56.303Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the hard-coded 1280x800 resolution check in `AutoCalibration::validateIncomingData()` is intentional. The AutoCalibration node in the depthai-core (C++) project is designed to support only 1280x800 sensor resolution and this constraint should not be flagged as a usability issue in future reviews.
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.
📚 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:

  • include/depthai/pipeline/node/AutoCalibration.hpp
  • src/pipeline/node/AutoCalibration.cpp
📚 Learning: 2026-03-13T19:40:56.303Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:327-330
Timestamp: 2026-03-13T19:40:56.303Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the hard-coded 1280x800 resolution check in `AutoCalibration::validateIncomingData()` is intentional. The AutoCalibration node in the depthai-core (C++) project is designed to support only 1280x800 sensor resolution and this constraint should not be flagged as a usability issue in future reviews.

Applied to files:

  • include/depthai/pipeline/node/AutoCalibration.hpp
  • src/pipeline/node/AutoCalibration.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:

  • include/depthai/pipeline/node/AutoCalibration.hpp
  • src/pipeline/node/AutoCalibration.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:

  • include/depthai/pipeline/node/AutoCalibration.hpp
📚 Learning: 2026-03-24T22:39:04.364Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:04.364Z
Learning: Do not flag the `!= ""` part of the auto-calibration condition as redundant when it appears in `PipelineImpl::build()` (or closely related pipeline build logic). If the code uses `utility::getEnvAs<std::string>(..., default)` with a default such as `"ON_START"`, the explicit empty-string guard may still be intentional to treat an explicitly empty env var as “OFF/disabled” (or to avoid special-casing elsewhere). Only consider removing `!= ""` if the codebase has an explicit, enforceable guarantee that `DEPTHAI_AUTOCALIBRATION` can never be set to an empty string (e.g., via validated parsing/CI checks); otherwise, keep the guard.

Applied to files:

  • src/pipeline/node/AutoCalibration.cpp
🪛 Cppcheck (2.20.0)
src/pipeline/node/AutoCalibration.cpp

[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 14-14: 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] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)

🔇 Additional comments (7)
include/depthai/pipeline/node/AutoCalibration.hpp (2)

98-99: LGTM: New method declaration for flash decision logic.

The method signature correctly takes a const reference to avoid unnecessary copying of the calibration handler.


127-129: LGTM: Socket members to support per-camera distortion comparison.

Defaulting to CameraBoardSocket::AUTO is appropriate as a safe default before build() captures the actual socket values from the cameras.

src/pipeline/node/AutoCalibration.cpp (5)

5-5: LGTM: Required include for std::fabs.


14-42: LGTM: Well-structured helper for distortion comparison.

The guard at line 17 correctly prevents exceptions from getDistortionModel() and getDistortionCoefficients() (which throw std::runtime_error when the socket is absent). Returning false when either calibration lacks data for the socket is a safe conservative choice that defaults to allowing the flash.


131-132: LGTM: Socket capture for distortion comparison.

The captured sockets will be used in shouldFlashCalibration() to compare against EEPROM calibration for the specific camera pair.


336-342: LGTM: Robust exception handling for EEPROM read.

Catching the exception and disabling flash is the safe choice when factory calibration cannot be read. The warning message with e.what() provides useful debugging context.


268-282: This pattern is correct by design and requires no changes.

The flashCalibration flag is computed once at line 268 to determine whether the initial calibration represents a "replay" scenario (calibration differs from EEPROM) or normal operation (calibration matches EEPROM). This scenario determination is safety-critical and applies consistently to all subsequently generated calibrations within that invocation.

In a replay scenario, flashCalibration is false and remains false for all generated calibrations—preventing unsafe writes to EEPROM. In normal operation, generated calibrations inherit the enabled flash flag because they are being produced for the same hardware whose initial state was verified.

@moratom moratom requested a review from JakubFara April 1, 2026 10:28
Copy link
Copy Markdown
Contributor

@asahtik asahtik left a comment

Choose a reason for hiding this comment

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

Thanks, this fixes the issue. LGTM.

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: 1

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

Inline comments:
In `@src/pipeline/node/AutoCalibration.cpp`:
- Around line 16-19: The current hasDifferentDistortion returns false when
either lhs or rhs lacks calibration, which allows shouldFlashCalibration to
proceed; change the logic so that if either hasCameraCalibration(socket) is
false and socket != CameraBoardSocket::AUTO the function treats that as a
difference (return true) to fail-closed and prevent EEPROM flashing; update all
analogous checks (the other calibration-comparison blocks referenced around
shouldFlashCalibration) to apply the same rule, referencing
hasDifferentDistortion, shouldFlashCalibration, and CameraBoardSocket::AUTO to
locate and fix the checks.
🪄 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: 6a4d8b90-6088-46a2-8a7e-4a4ed451e192

📥 Commits

Reviewing files that changed from the base of the PR and between 815e30f and 9e558e9.

📒 Files selected for processing (1)
  • src/pipeline/node/AutoCalibration.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
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.
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.
📚 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:

  • src/pipeline/node/AutoCalibration.cpp
📚 Learning: 2026-03-13T19:40:56.303Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:327-330
Timestamp: 2026-03-13T19:40:56.303Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the hard-coded 1280x800 resolution check in `AutoCalibration::validateIncomingData()` is intentional. The AutoCalibration node in the depthai-core (C++) project is designed to support only 1280x800 sensor resolution and this constraint should not be flagged as a usability issue in future reviews.

Applied to files:

  • src/pipeline/node/AutoCalibration.cpp
📚 Learning: 2026-03-24T22:39:04.364Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:04.364Z
Learning: Do not flag the `!= ""` part of the auto-calibration condition as redundant when it appears in `PipelineImpl::build()` (or closely related pipeline build logic). If the code uses `utility::getEnvAs<std::string>(..., default)` with a default such as `"ON_START"`, the explicit empty-string guard may still be intentional to treat an explicitly empty env var as “OFF/disabled” (or to avoid special-casing elsewhere). Only consider removing `!= ""` if the codebase has an explicit, enforceable guarantee that `DEPTHAI_AUTOCALIBRATION` can never be set to an empty string (e.g., via validated parsing/CI checks); otherwise, keep the guard.

Applied to files:

  • src/pipeline/node/AutoCalibration.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:

  • src/pipeline/node/AutoCalibration.cpp
📚 Learning: 2026-04-01T11:06:40.618Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1737
File: include/depthai/device/CalibrationHandler.hpp:806-808
Timestamp: 2026-04-01T11:06:40.618Z
Learning: In `include/depthai/device/CalibrationHandler.hpp`, the `mutable std::optional<ImuCalibrationDecomposition>` fields `accelerometerDecompositionCache` and `gyroscopeDecompositionCache` intentionally have no synchronization. `CalibrationHandler` is not designed for concurrent access and the lazy-initialization TOCTOU pattern in its const cache getters should not be flagged as a thread-safety issue in future reviews.

Applied to files:

  • src/pipeline/node/AutoCalibration.cpp
📚 Learning: 2026-03-16T23:22:52.039Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: examples/python/AutoCalibration/auto_calibration_example.py:99-106
Timestamp: 2026-03-16T23:22:52.039Z
Learning: In `examples/python/AutoCalibration/auto_calibration_example.py`, no shape validation guard is needed before slicing the result of `calibrationHandler.getCameraExtrinsics()`, as the API is guaranteed to return a valid matrix. Do not flag this as an issue in future reviews.

Applied to files:

  • src/pipeline/node/AutoCalibration.cpp
🪛 Cppcheck (2.20.0)
src/pipeline/node/AutoCalibration.cpp

[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 14-14: 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] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)

🔇 Additional comments (2)
src/pipeline/node/AutoCalibration.cpp (2)

131-132: Socket capture in build() is correct and improves determinism.

Persisting leftBoardSocket/rightBoardSocket at build time is a good foundation for socket-scoped safety checks later in the calibration flow.


268-300: Consistent flash decision propagation across both apply paths.

Using one flashCalibration decision and passing it into both DCC::applyCalibration(...) call sites avoids branch drift and keeps behavior consistent.

@MaticTonin MaticTonin force-pushed the dev_mt_fixReplayFlashing branch from ebb4b43 to 1bce7df Compare April 1, 2026 11:14
bool hasDifferentDistortion(const CalibrationHandler& lhs, const CalibrationHandler& rhs, CameraBoardSocket socket) {
if(!lhs.hasCameraCalibration(socket) || !rhs.hasCameraCalibration(socket)) {
return false;
}
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.

should not this be

Suggested change
}
if(!lhs.hasCameraCalibration(socket) || !rhs.hasCameraCalibration(socket)) {
if(!lhs.hasCameraCalibration(socket) && !rhs.hasCameraCalibration(socket)) {
return false;
}
return true;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed yes.

}

const bool flashCalibration = shouldFlashCalibration(*calibration);

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.

So the initialConfig->flashCalibration calibration is not considered at all?

Can we do this on the Pipeline::build level?

autoCalibration->initialConfig = shouldFlashCalibration(hadler1, handler2) ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Now it is

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Now all is done in Pipeline.cpp so the user can still configure autocalibration node as he likes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed completely

@MaticTonin MaticTonin force-pushed the dev_mt_fixReplayFlashing branch 2 times, most recently from 01807f2 to 15c7b50 Compare April 2, 2026 07:18
@MaticTonin MaticTonin force-pushed the dev_mt_fixReplayFlashing branch from c6b5715 to 87e1e10 Compare April 2, 2026 07:19
@MaticTonin
Copy link
Copy Markdown
Collaborator Author

Tested on

DEPTHAI_REPLAY=build/tests/_private_data/holistic_recording.tar build/examples/cpp/StereoDept
h/depth_preview

[2026-04-02 12:37:28.493] [depthai] [warning] AutoCalibration build-time flash safety: runtime calibration differs from EEPROM on socket 1. Disabling flashCalibration.

@MaticTonin MaticTonin added the testable PR is ready to be tested label Apr 2, 2026
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.

@MaticTonin let's just switch to info & merge IMO, thanks!

@moratom moratom merged commit 1f645a2 into develop Apr 2, 2026
1 check was pending
@moratom moratom deleted the dev_mt_fixReplayFlashing branch April 2, 2026 11:37
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.

4 participants