Skip to content

Support for setting external strobe exposure master camera - #1859

Open
sb-lxn wants to merge 6 commits into
developfrom
feat/externalStrobeMasterControl
Open

Support for setting external strobe exposure master camera#1859
sb-lxn wants to merge 6 commits into
developfrom
feat/externalStrobeMasterControl

Conversation

@sb-lxn

@sb-lxn sb-lxn commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR enables users to explicitly set which cameras exposure will be signaled on FSYNC/STROBE pin on M8 connector.
On normal devices, if exposure master is not set explicitly, the exposure master is determined automatically (keeping the same previous behavior)
On Devkit and FFC the user must explicitly set an exposure master, if he wants strobe to be outputed to M8. This is because the camera setup on those boards can be arbitrary.

Summary by CodeRabbit

  • New Features
    • Extended external strobe control with an API that lets you select the camera socket responsible for exposure timing.
    • Selecting a camera socket automatically enables external strobe operation for that exposure source.
    • The capability is available in Python through an additional overload, while the existing enable/disable behavior remains unchanged.

@sb-lxn
sb-lxn requested review from jakgra and moratom June 23, 2026 10:27
@sb-lxn sb-lxn self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0c272238-8ae1-4db2-9a20-587773ba5561

📥 Commits

Reviewing files that changed from the base of the PR and between 38a775a and 71b332e.

📒 Files selected for processing (1)
  • cmake/Depthai/DepthaiDeviceRVC4Config.cmake
📜 Recent review details
🔇 Additional comments (1)
cmake/Depthai/DepthaiDeviceRVC4Config.cmake (1)

6-6: 🗄️ Data Integrity & Integration

Verify the snapshot artifact before merging.

DEPTHAI_DEVICE_RVC4_VERSION controls the firmware package selected by DepthaiDeviceDownloader and is also embedded in DEVICE_RVC4_VERSION. Confirm that package 0.0.1+d86afc8b66571dd5f7a0ff8daa3c5fb4bfc7502f exists in the snapshot repository and matches the intended RVC4 build. Otherwise, firmware download or version reporting can fail or become inconsistent.


📝 Walkthrough

Walkthrough

Adds a DeviceBase::setExternalStrobeEnable(CameraBoardSocket exposureMasterSocket) overload. The implementation forwards the socket through RPC. The Python binding exposes the overload and releases the GIL. The RVC4 package version identifier is updated.

Changes

setExternalStrobeEnable CameraBoardSocket Overload

Layer / File(s) Summary
Declaration, RPC implementation, and Python binding
include/depthai/device/DeviceBase.hpp, src/device/DeviceBase.cpp, bindings/python/src/DeviceBindings.cpp
The header declares the overload and documents its strobe signal behavior. The C++ implementation forwards the selected socket through setExternalStrobeEnableExposureMaster. The Python binding exposes the overload and releases the GIL.

RVC4 Package Version Update

Layer / File(s) Summary
RVC4 package version
cmake/Depthai/DepthaiDeviceRVC4Config.cmake
The configuration uses the updated RVC4 snapshot package version identifier.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 71b33

The PR changes the RVC4 firmware package selected by the build configuration. It is mergeable with owner awareness that package 0.0.1+d86afc8b66571dd5f7a0ff8daa3c5fb4bfc7502f must exist and match the intended build to avoid firmware download or version-reporting issues.

Suggested reviewers: moratom, jakgra

Sequence Diagram(s)

sequenceDiagram
  participant PythonBinding
  participant DeviceBase
  participant DeviceRPC
  PythonBinding->>DeviceBase: setExternalStrobeEnable(exposureMasterSocket)
  DeviceBase->>DeviceRPC: setExternalStrobeEnableExposureMaster(socket)
Loading

Poem

🐇 A socket selects the exposure light,
RPC sends the setting right.
Python frees the GIL,
The strobe follows still.
The package version hops tonight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: support for selecting the camera that controls external strobe exposure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/externalStrobeMasterControl

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bindings/python/src/DeviceBindings.cpp`:
- Around line 1003-1010: The setExternalStrobeEnable method binding with the
dai::CameraBoardSocket parameter is using a shared DOC macro that does not
distinguish it from the bool overload, causing Python help text to display
incorrect parameter documentation. Replace the DOC(dai, DeviceBase,
setExternalStrobeEnable) macro with an overload-specific documentation key that
accurately describes the exposureMasterSocket parameter for this particular
variant, ensuring each overload has distinct documentation that matches its
actual parameters and semantics.

In `@include/depthai/device/DeviceBase.hpp`:
- Around line 1162-1166: The documentation comment for this external strobe
overload is misleading because it uses generic language about "whether the
external strobe should be enabled" which sounds like a boolean toggle, when this
particular overload actually accepts a CameraBoardSocket parameter to select
which camera board socket will control the external strobe exposure. Update the
documentation comment to clearly state that this overload specifically selects
or sets the exposure-master camera socket that will control the external strobe
output, distinguishing it from a boolean enable/disable operation and making the
purpose of the CameraBoardSocket parameter explicit.
🪄 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: fed29904-44fc-48c5-8fdf-e29c538bb52c

📥 Commits

Reviewing files that changed from the base of the PR and between 0924450 and cc88202.

📒 Files selected for processing (3)
  • bindings/python/src/DeviceBindings.cpp
  • include/depthai/device/DeviceBase.hpp
  • src/device/DeviceBase.cpp
📜 Review details
🔇 Additional comments (1)
src/device/DeviceBase.cpp (1)

1684-1686: LGTM!

Comment thread bindings/python/src/DeviceBindings.cpp Outdated
Comment thread include/depthai/device/DeviceBase.hpp

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@include/depthai/device/DeviceBase.hpp`:
- Line 1163: In the documentation comment for the external strobe exposure
control method around line 1163 in DeviceBase.hpp, fix the spelling error where
"Automaticaly" is misspelled. Change it to "Automatically" in the comment that
reads "Set which camera will control the external strobe exposure. Automaticaly
enables external strobe."
🪄 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: 2cf6ca50-d098-4595-9cb4-03eb5d7b1756

📥 Commits

Reviewing files that changed from the base of the PR and between cc88202 and b56ce3d.

📒 Files selected for processing (1)
  • include/depthai/device/DeviceBase.hpp

void setExternalStrobeEnable(bool enable);

/**
* Set which camera will control the external strobe exposure. Automaticaly enables external strobe.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix typo in documentation.

Line 1163 contains a typo: "Automaticaly" should be "Automatically".

📝 Proposed fix
-     * Set which camera will control the external strobe exposure. Automaticaly enables external strobe.
+     * Set which camera will control the external strobe exposure. Automatically enables external strobe.

Note: The previous review comment regarding clarifying the documentation has been addressed—the wording now clearly states this overload selects which camera controls the strobe and automatically enables it.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Set which camera will control the external strobe exposure. Automaticaly enables external strobe.
* Set which camera will control the external strobe exposure. Automatically enables external strobe.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@include/depthai/device/DeviceBase.hpp` at line 1163, In the documentation
comment for the external strobe exposure control method around line 1163 in
DeviceBase.hpp, fix the spelling error where "Automaticaly" is misspelled.
Change it to "Automatically" in the comment that reads "Set which camera will
control the external strobe exposure. Automaticaly enables external strobe."

sb-lxn added 2 commits August 4, 2026 09:05
Signed-off-by: stas.bucik <stas.bucik@luxonis.com>
Signed-off-by: stas.bucik <stas.bucik@luxonis.com>
@sb-lxn
sb-lxn force-pushed the feat/externalStrobeMasterControl branch from b56ce3d to 65329d7 Compare August 4, 2026 07:05
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@sb-lxn
sb-lxn force-pushed the feat/externalStrobeMasterControl branch from 71b332e to 78b455a Compare August 14, 2026 07:22
Signed-off-by: stas.bucik <stas.bucik@luxonis.com>
@sb-lxn
sb-lxn force-pushed the feat/externalStrobeMasterControl branch from 78b455a to 947885a Compare August 14, 2026 07:26
Signed-off-by: stas.bucik <stas.bucik@luxonis.com>
@sb-lxn sb-lxn added the testable PR is ready to be tested - run vanilla tests label Aug 14, 2026
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 - run vanilla tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant