Repository navigation
Batch camera rendering and fix moving-camera and cloned-camera updates - #7977
Conversation
|
run-ci |
c7e463d to
ddef5e9
Compare
|
run-ci |
|
| 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/.") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, relaxingCameraRenderSpec.camera_prim_pathsto 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. Whencamera_path_relative_to_env_0is 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) | |||
There was a problem hiding this comment.
🟡 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.
|
run-ci |
4a91dc4 to
9560e46
Compare
|
run-ci |
9560e46 to
e5f1bdb
Compare
|
run-ci |
|
Thanks for putting this together. I have some concerns about the 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 Given that, the queue feels like a lot of machinery: weakrefs, the nestable deferral scope, remove hooks in Could we try something simpler?
Also, could the unrelated changes go in separate PRs? The OVRTX cloned-camera binding fix, the Galbot/Kuka |
e5f1bdb to
6feead3
Compare
|
run-ci |
StafaH
left a comment
There was a problem hiding this comment.
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:
- Make render_into_camera() call render_into_cameras() with a one-item list, so all rendering goes through render_batch().
- Keep the default render_batch() implementation that loops over render(). Renderers that support batching, like OVRTX, can override it.
- Have the profiler wrap only render_batch(), which should let us remove the reentrancy guard.
|
@StafaH speaking of your comments
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:
Is fine in my opinion. My intention was similar approach for as for
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.
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. |
bc157a6 to
e61aeb6
Compare
|
run-ci |
…#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]>
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.
scene.update()and submit them together. Lazy reads also capture pending, due cameras sharing the same renderer.Breaking change and migration
BaseRenderer.render()now accepts a sequence. Direct callers must changerender(data)torender([data]), and custom renderers must handle every entry. Empty sequences perform no work.Camera sensors retain the
camera.datainterface. Lazy reads may refresh due peer cameras; clone output tensors when retaining snapshots across captures.Fixes # (issue)
Type of change
Release backport
developScreenshots
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-cion the pull request.pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there