Skip to content

Support argus camera for camera_viz - #833

Merged
tengw-nv merged 2 commits into
mainfrom
teng/df82f4a
Oct 29, 2026
Merged

tengw-nv merged 2 commits into
mainfrom
teng/df82f4a

Conversation

@tengw-nv

@tengw-nv tengw-nv commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implement argus camera driver support in the camera_viz example

Fixes #(issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

Tested with camera that supports argus driver

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix/feature works (or explained why not)
  • I have signed off all my commits (git commit -s) per the DCO

Summary by CodeRabbit

  • New Features

    • Added Jetson Argus camera support with mono and stereo capture.
    • Added CUDA-accelerated YUV-to-RGBA frame conversion.
    • Added SHW5G stereo camera configuration.
    • Added optional --with-argus setup support and improved setup guidance.
    • Added stereo emission mode that waits for fresh frames from both eyes.
  • Bug Fixes

    • Prevented partial startup when one stereo camera fails to start.
    • Added clearer guidance when the native camera component is unavailable.
  • Tests

    • Added coverage for synchronized stereo frame emission.

@tengw-nv
tengw-nv requested a review from farbod-nv July 28, 2026 21:59
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

Adds an optional Jetson Argus camera backend with C++/CUDA capture, YUV-to-RGBA conversion, pybind11 bindings, and Python FrameSource integration. Argus supports mono and stereo sensors, CUDA-backed frame views, configurable paired emission, and SHW5G configuration. Build and installation scripts now support opt-in Argus provisioning, while documentation and deployment help describe the new options.

Estimated code review effort: 5 (Critical) | ~120 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.51% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Argus camera support to camera_viz.
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 teng/df82f4a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@tengw-nv
tengw-nv requested a review from jiwenc-nv July 28, 2026 21:59

@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: 3

🤖 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 `@examples/camera_viz/argus/argus_camera.cpp`:
- Around line 783-799: Prevent published device buffers from being reused while
the consumer still holds them: update the latest() buffer handoff and
pick_write_index() selection to track the index currently leased by the consumer
and exclude it from writes until release, or implement an equivalent FrameView
lease/refcount lifecycle. Preserve existing publication behavior while ensuring
producer reuse waits for or skips any buffer still in use.
- Around line 731-753: Update the CU_EGL_FRAME_TYPE_PITCH handling around
launch_yuv420_pitch_to_rgba so planar U/V strides are not derived from
frame.pitch / 2. Read each plane’s pitch from the available buffer metadata and
pass those per-plane values, or explicitly reject planar pitch frames when
metadata is unavailable; preserve the existing non-planar path.
- Around line 671-684: Update the acquire call in the frame acquisition flow
around cuEGLStreamConsumerAcquireFrame to pass config_.acquire_timeout_ms
converted from milliseconds to microseconds. Treat both CUDA_ERROR_TIMEOUT and
CUDA_ERROR_LAUNCH_TIMEOUT as retryable timeout results that return false, while
preserving existing handling for other CUDA errors.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8c1004b5-6560-4cd1-a0a7-d91a0c7813c4

📥 Commits

Reviewing files that changed from the base of the PR and between 9f1df1a and e222bb2.

📒 Files selected for processing (16)
  • examples/camera_viz/README.md
  • examples/camera_viz/argus/CMakeLists.txt
  • examples/camera_viz/argus/__init__.py
  • examples/camera_viz/argus/argus_bindings.cpp
  • examples/camera_viz/argus/argus_camera.cpp
  • examples/camera_viz/argus/argus_camera.hpp
  • examples/camera_viz/argus/build.sh
  • examples/camera_viz/argus/yuv_to_rgba.cu
  • examples/camera_viz/argus/yuv_to_rgba.cuh
  • examples/camera_viz/camera_viz.sh
  • examples/camera_viz/configs/argus_shw5g.yaml
  • examples/camera_viz/scripts/_install_deps.sh
  • examples/camera_viz/sources/__init__.py
  • examples/camera_viz/sources/_helpers.py
  • examples/camera_viz/sources/argus.py
  • examples/camera_viz/tests/test_paired_frame_source_race.py

Comment thread examples/camera_viz/argus/argus_camera.cpp Outdated
@farbod-nv

farbod-nv commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor
  1. deploy deletes the Argus module and never rebuilds it — camera_viz.sh:283

  cmd_deploy hardcodes bash scripts/_install_deps.sh --sender-only --jetson with no --with-argus, and there's no flag to
  inject one. Worse, rsync_to_remote (camera_viz.sh:110-113) excludes argus/build/ but the built artifact lands in the source
  dir (argus/CMakeLists.txt:114 LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}), and argus/_camera_viz_argus*.so is not
  excluded. So rsync --delete removes a working .so from the Jetson on every deploy, and the deps step doesn't build it back.
  The Jetson deploy path is exactly the Argus target. Needs --exclude='argus/*.so' plus a way to pass --with-argus through
  deploy.

  2. Missing sync between EGL acquire and the conversion kernel — argus_camera.cpp:672

  AcquiredFrame::stream is default-initialized to nullptr, so cuEGLStreamConsumerAcquireFrame(..., &out.stream, ...) orders
  the frame's availability/migration on the legacy default stream. The kernel then launches on convert_stream_, created with
  CU_STREAM_NON_BLOCKING (:349) — which by definition does not implicitly synchronize with the legacy default stream. Set
  out.stream = convert_stream_ before the acquire (and pass the same stream to release), or drop CU_STREAM_NON_BLOCKING.

^ just an agent review. ignore if already addressed/irrelevent.

Let's also add argus to the public docs too. Otherwise LGTM

Signed-off-by: Teng Wei <tengw@nvidia.com>
Signed-off-by: Teng Wei <tengw@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Preview deployed: https://NVIDIA.github.io/IsaacCapture/preview/pr-833/

Built from commit 023855c. It may take a minute for the updated preview to appear.

@tengw-nv
tengw-nv enabled auto-merge (squash) October 29, 2026 06:27
@tengw-nv
tengw-nv merged commit 3f44cf2 into main Oct 29, 2026
42 checks passed
@tengw-nv
tengw-nv deleted the teng/df82f4a branch October 29, 2026 06:32
github-actions Bot added a commit that referenced this pull request Oct 29, 2026

This branch was successfully deployed

1 active deployment
dev — 023855c0 Deployed Oct 29, 2026 by tengw-nv via publish-wheel #6233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants