Skip to content

Batch camera rendering and fix moving-camera and cloned-camera updates - #7977

Merged
pbarejko merged 4 commits into
isaac-sim:developfrom
pbarejko:pbarejko/batch-rendering-only
Sep 24, 2026
Merged

pbarejko merged 4 commits into
isaac-sim:developfrom
pbarejko:pbarejko/batch-rendering-only

Conversation

@pbarejko

@pbarejko pbarejko commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Camera sensors previously submitted captures individually, even when sharing a renderer. This PR batches due cameras by renderer, prepares their poses before submission, and reads each camera’s outputs afterward.

  • Collect eager captures during scene.update() and submit them together. Lazy reads also capture pending, due cameras sharing the same renderer.
  • Update OVRTX, Newton Warp, and Isaac RTX to accept camera batches. OVRTX submits all requested render products in one native step.
  • Preserve individual update periods and reset behavior. Commit frame counters and timestamps only after the group’s rendering and output reads succeed, allowing failed captures to retry.
  • Fix OVRTX pose and intrinsic bindings for cloned environments when USD contains only the source camera, using a shared camera-path helper.
  • Enable pose refresh for Galbot wrist/head cameras and the Kuka Allegro wrist camera so rendered views follow robot motion.

Breaking change and migration

BaseRenderer.render() now accepts a sequence. Direct callers must change render(data) to render([data]), and custom renderers must handle every entry. Empty sequences perform no work.

Camera sensors retain the camera.data interface. Lazy reads may refresh due peer cameras; clone output tensors when retaining snapshots across captures.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 23, 2026
@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@pbarejko
pbarejko force-pushed the pbarejko/batch-rendering-only branch from c7e463d to ddef5e9 Compare September 23, 2026 18:34
@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until OVRTX validates additional camera paths before expanding them into cloned environment paths.

Findings

  1. P1 Invalid paths pass validation ▶

Summary

This PR introduces renderer-level camera batching and deferred camera capture orchestration while preserving individual camera timing and retry behavior. It also updates OVRTX cloned-camera bindings and enables pose refresh for selected moving cameras.

  • Changes BaseRenderer.render() and all built-in implementations to accept camera sequences.
  • Groups pending cameras by renderer and performs pose preparation, rendering, readback, and capture-state commits in phases.
  • Adds multi-product OVRTX submission and source-only cloned-camera support.
  • Updates documentation, changelogs, task camera configurations, and renderer contract tests.
  • One OVRTX validation regression remains for additional cameras outside the required env_0 namespace.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[InteractiveScene.update or lazy Camera.data] --> B[Queue due cameras]
    B --> C[Group cameras by renderer]
    C --> D[Prepare each camera pose]
    D --> E[Update shared scene state once]
    E --> F[Renderer.render camera sequence]
    F --> G[Read each camera output]
    G --> H[Commit frames and timestamps]
    F -->|failure| I[Keep group queued for retry]
    G -->|failure| I
Loading

Reviews (1) · Last reviewed commit: c7e463d

Comment on lines 988 to 990
camera_paths = _get_cloned_camera_paths(spec.camera_path_relative_to_env_0, spec.num_instances)
if not camera_paths or not camera_paths[0].startswith("/World/envs/env_0/"):
raise ValueError("OVRTX cameras must be under /World/envs/env_0/.")

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.

P1 Invalid paths pass validation

When a subsequently registered camera's first authored path is outside /World/envs/env_0/, Camera supplies an empty relative path. This expands to /World/envs/env_0/, /World/envs/env_1/, and so on, so the prefix check passes and OVRTX binds the render product, transforms, and intrinsics to environment roots instead of rejecting the unsupported camera path.

@pbarejko pbarejko changed the title Pbarejko/batch rendering only Batch camera rendering and fix moving-camera and cloned-camera updates Sep 23, 2026

@isaaclab-review-bot isaaclab-review-bot 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.

Isaac Lab Review Bot

The camera batching and sequence-based renderer API are consistently implemented and documented across the three backends. One OVRTX validation regression remains: additional cameras outside /World/envs/env_0/ are no longer rejected before clone paths are synthesized.

  • Design and architecture: The prepare → submit → read → commit lifecycle coherently supports eager and lazy capture batching, retains failed groups for retry, and commits camera state only after successful rendering and readback. The remaining issue is confined to OVRTX additional-camera registration rather than the batching architecture.
  • API: The breaking BaseRenderer.render(Sequence[...]) contract and migration are documented in the API docs and package changelogs, and the included callers are migrated. However, relaxing CameraRenderSpec.camera_prim_paths to permit source-only paths requires OVRTX to preserve validation of the source camera location before deriving logical clone paths.
  • Implementation: In _register_camera, _get_cloned_camera_paths() always produces a first path beginning with /World/envs/env_0/, making the subsequent prefix guard ineffective. When camera_path_relative_to_env_0 is empty, OVRTX can consequently bind camera transforms and intrinsics to /World/envs/env_0/ instead of rejecting the invalid camera specification. Validate the authored first path or reject an empty relative path before synthesizing clone paths.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

@@ -976,7 +985,7 @@ def create_render_data(self, spec: CameraRenderSpec) -> OVRTXCameraRenderData:

def _register_camera(self, spec: CameraRenderSpec, render_data: OVRTXCameraRenderData) -> None:
"""Add another tiled product and camera binding without reloading the shared scene."""
camera_paths = list(spec.camera_prim_paths)
camera_paths = _get_cloned_camera_paths(spec.camera_path_relative_to_env_0, spec.num_instances)

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.

🟡 Warning · Implementation — env_0 guard in _register_camera is now unreachable

camera_paths is synthesized as /World/envs/env_{i}/{rel}, so the following camera_paths[0].startswith("/World/envs/env_0/") check can never fail; it previously validated spec.camera_prim_paths. Camera._initialize_impl sets camera_path_relative_to_env_0 to "" for cameras outside env_0, yielding "/World/envs/env_0/" and binding poses and intrinsics to the environment root instead of raising. Validate spec.camera_prim_paths[0] or reject an empty relative path before deriving clone paths.

@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@pbarejko
pbarejko force-pushed the pbarejko/batch-rendering-only branch from 4a91dc4 to 9560e46 Compare September 23, 2026 20:55
@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@pbarejko
pbarejko force-pushed the pbarejko/batch-rendering-only branch from 9560e46 to e5f1bdb Compare September 23, 2026 21:00
@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@StafaH

StafaH commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for putting this together. I have some concerns about the render(data) → render([data]) change and the pending-camera queue.

As far as I can tell, only OVRTX gets a real win here. Newton already renders all envs of a camera in one call, scene state and the BVH refit already run at most once per step, and ensure_isaac_rtx_render_update() already dedupes per step on RTX. So for Newton, batching saves about one graph launch per extra camera. OVRTX is the one where a single step() over all render products actually matters.

Given that, the queue feels like a lot of machinery: weakrefs, the nestable deferral scope, remove hooks in __del__ and invalidate, retry-on-failure commit logic, and RenderContext reaching into camera privates. The lazy path also means reading one camera can overwrite another camera's buffers, which is why the docs now need the "clone your tensors" note. I'd rather not introduce that.

Could we try something simpler?

  • Keep render(render_data) as is, and add a non-abstract render_batch(render_data) on BaseRenderer that loops by default. Only OVRTX (and Newton if we want) overrides it. Then it isn't a breaking change.
  • Drop the queue. In the eager branch of InteractiveScene.update, collect the cameras that are due and hand them to a single RenderContext call that groups them by renderer.
  • Leave lazy reads per-camera, so camera.data only ever renders that camera.

Also, could the unrelated changes go in separate PRs? The OVRTX cloned-camera binding fix, the Galbot/Kuka update_latest_camera_pose changes, the camera_path_relative_to_env_0 removal, and the frame_op change in _prepare_camera all look independent of batching and would be easier to review on their own.

@pbarejko
pbarejko force-pushed the pbarejko/batch-rendering-only branch from e5f1bdb to 6feead3 Compare September 24, 2026 02:12
@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 24, 2026

@StafaH StafaH left a comment

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.

Could we make the framework call only render_batch() and never render()?

Currently, lazy reads through render_into_camera() call render(), while eager updates through render_into_cameras() call render_batch(). The methods also delegate to each other in opposite directions:

  • BaseRenderer.render_batch() loops over render().
  • OVRTXRenderer.render() wraps render_batch().

This is why profile_renderers needs a reentrancy guard. It also means a new renderer that copies OVRTX’s render() implementation but doesn’t override render_batch() will recurse forever.

I suggest:

  1. Make render_into_camera() call render_into_cameras() with a one-item list, so all rendering goes through render_batch().
  2. Keep the default render_batch() implementation that loops over render(). Renderers that support batching, like OVRTX, can override it.
  3. Have the profiler wrap only render_batch(), which should let us remove the reentrancy guard.

@pbarejko

pbarejko commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

@StafaH speaking of your comments

  1. Make render_into_camera() call render_into_cameras() with a one-item list, so all rendering goes through render_batch().

Good spot ,I forgot to update that one. That was my intention the batch version is the default implementation and singular version just invokes the plural with one argument. On the BaseRender side there is no other way to implement this, but by looping.

However this one:

The methods also delegate to each other in opposite directions:

  • BaseRenderer.render_batch() loops over render().
  • OVRTXRenderer.render() wraps render_batch().

Is fine in my opinion. My intention was similar approach for as for render_into_camera invoking render_into_cameras. This is backend implementation and it can stay like that - implementation specific.

Keep the default render_batch() implementation that loops over render(). Renderers that support batching, like OVRTX, can override it.

This is exactly why I override it. The OVRTX is a backend implementation that doesn't need to be in alignment with BaseRenderer, it overrides it.

It also means a new renderer that copies OVRTX’s render() implementation but doesn’t override render_batch() will recurse forever.

If a new renderer reuses OVRTX’s render() implementation, it must also override render_batch(). Keeping those methods consistent is the renderer author’s responsibility.

@pbarejko
pbarejko force-pushed the pbarejko/batch-rendering-only branch from bc157a6 to e61aeb6 Compare September 24, 2026 07:08
@pbarejko

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 24, 2026
@pbarejko
pbarejko merged commit 1e520e9 into isaac-sim:develop Sep 24, 2026
53 checks passed
StafaH added a commit that referenced this pull request Sep 24, 2026
…#7941, #7977, #7983, #7991, #8003) (#8002)

## Description

Backports the rendering changes and related release fixes:

- #7941 — routes rigid rendering transforms through `SceneDataProvider`
and preserves shared Fabric bindings.
- #7977 — batches due camera captures by renderer and fixes moving and
cloned camera updates. This supersedes #8001.
- #7983 — removes `CameraRenderSpec.camera_path_relative_to_env_0` and
derives and validates the OVRTX source camera path from
`camera_prim_paths`. The rendering changes were developed with this
interface, so it is required by their OVRTX tests.
- #7991 — fixes Newton's deprecated joint friction writers and the PhysX
rigid object collection `body_mask` writer signatures.
- #8003 — consolidates redundant Newton tests to shorten the Newton CI
job without changing runtime code.

#7941 required conflict resolution in the OVRTX legacy and OvStage
transform binding functions: the release branch's Newton model path
collection was replaced by SDP-published paths. #7983 was then
integrated with those SDP paths. Each added commit records its source
commit.

Custom scene-data backends must follow the `transforms_version`
publication contract described in the included migration documentation.
Direct callers of `BaseRenderer.render()` must pass a sequence, for
example `render([data])`. Callers constructing `CameraRenderSpec` must
remove the `camera_path_relative_to_env_0` argument; OVRTX now derives
it from `camera_prim_paths`.

## Validation

- Rendering and scene-data focused tests from the original backport
passed locally: 27 renderer tests and 50 scene-data / PhysX renderer
tests. OVRTX runtime cases were skipped locally because the optional
`ovrtx` module is unavailable.
- #7991: the Newton deprecated friction writer test passed, and 72 rigid
object collection mask writer cases passed. The new friction test fails
without the fix and passes with it.
- #8003: all 8 revised contact lifecycle cases passed. Kit-based Newton
asset tests remain for CI.
- `uv run isaaclab -f` passed after all additions with the changelog
base set to `release/3.0.0`, as did `git diff --check`.
- The original backport's documentation build passed with warnings
treated as errors. Full GPU and Kit CI is running on the updated PR.

## Type of change

- Rendering bug fixes and performance improvement
- Backend API bug fixes and breaking renderer / scene-data interface
changes with migration guidance
- Newton test consolidation
- Documentation and changelog fragments for affected source packages

## Release backport

This PR targets `release/3.0.0`; no further backport is needed.

## Checklist

- [x] Contribution guidance reviewed
- [x] Focused local tests and formatting checks passed
- [x] Public documentation and package changelog fragments included
- [ ] Full GPU and Kit CI passed

---------

Co-authored-by: ooctipus <[email protected]>
Co-authored-by: Piotr Barejko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants