Skip to content

Fix camera-extrinsics variation under Newton - #1196

Merged
alexmillane merged 7 commits into
mainfrom
alex/fix/camera_extrinsics_variation_under_newton
Sep 10, 2026
Merged

alexmillane merged 7 commits into
mainfrom
alex/fix/camera_extrinsics_variation_under_newton

Conversation

@alexmillane

Copy link
Copy Markdown
Collaborator

Summary

Fix camera-extrinsics variation under Newton

Detailed description

  • why
    • camera extrinsics variations are broken in Newton.
    • writes to the camera pose do not take effect when that backend is selected.
    • The source of the issue is that camera.set_world_poses() does not take effect with newton on.
      • only the physics representation of the pose is writen, not the representation used for rendering.
  • What
    • Adds CameraLocalOffsetWriter that correctly updates the pose while we wait for a fix in Lab.
    • Adds tests that capture the effect (they fail without this MR and pass with it).

- Add isaaclab_arena/patches/CameraLocalOffsetWriter: mirror a camera's local-pose
  offset onto both the physics FrameView (camera.data.pos_w) and the USD camera prim
  via UsdFrameView (the RTX render), then camera.reset. Under Newton the FrameView is
  Warp-only and the render reads the USD/Fabric prim, so both writes are needed;
  tagged [isaac-lab-camera-pose-write-bug] for removal once fixed upstream.
- Use the writer in the camera-extrinsics variation (drops the direct camera._view write).
- Add render- and pose-level tests across PhysX and Newton; they use the Franka camera
  (builds under Newton) and pass with the fix, fail without it.

Signed-off-by: Alex Millane <[email protected]>

@alexmillane alexmillane left a comment

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.

Self review 1.

Comment thread isaaclab_arena/patches/__init__.py Resolved
- Rename CameraLocalOffsetWriter to CameraPoseWriter and move the decalibration
  offset calculation back into camera_extrinsics_variation.py; the class now only
  writes a given local pose (physics FrameView + USD prim + camera.reset).
- Inline the frame-agreement tolerances; trim the patches package docstring.

Signed-off-by: Alex Millane <[email protected]>

@alexmillane alexmillane left a comment

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.

Self review 2

- Split the patches module docstring into problem/solution paragraphs and move the
  "remove this class" note to a bug-tagged TODO above CameraPoseWriter; document why
  the writer initializes lazily rather than in the constructor.
- Tag the writer's construction and call sites in the variation with
  [isaac-lab-camera-pose-write-bug]; drop their prose comments.
- Trim the render-test docstrings, inline single-use constants, and rename
  VARIANT_OFFSETS to COMPARED_OFFSETS.

Signed-off-by: Alex Millane <[email protected]>

@alexmillane alexmillane left a comment

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.

Self review 4

@alexmillane
alexmillane marked this pull request as ready for review September 8, 2026 12:39
- Drop the class-docstring detail and generalize the lazy-init comment (the writer can
  be constructed before the simulation starts).
- Reword set_local_poses' docstring and note that local poses are relative to the
  camera prim's parent.

Signed-off-by: Alex Millane <[email protected]>
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a temporary camera-pose writer that synchronizes camera extrinsics across the physics FrameView and the USD view consumed by RTX, then updates the camera sensor state. The camera-extrinsics variation now uses this writer, with PhysX and Newton integration tests covering rendered output and reported world pose.

  • Adds CameraPoseWriter as an isolated upstream-workaround abstraction.
  • Routes sampled camera-extrinsics updates through both physics and rendering representations.
  • Adds render and pose regression coverage for PhysX and Newton.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete correctness, security, or repository-rule violations identified.

The new writer updates both camera-pose representations required by the supported backends, preserves subset-environment indexing, refreshes camera state, and is covered by complementary production-path and backend-specific regression tests.

Important Files Changed

Filename Overview
isaaclab_arena/patches/camera_render_pose.py Adds a deferred camera-pose writer that synchronizes physics and USD views and refreshes camera state.
isaaclab_arena/variations/camera_extrinsics_variation.py Routes sampled local camera translations through the new backend-compatible pose writer.
isaaclab_arena/tests/test_camera_extrinsics_variation_render.py Adds PhysX and Newton regression tests for rendered-image movement and reported camera-pose movement.
isaaclab_arena/patches/init.py Exposes the new camera-pose writer through the patches package.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Camera extrinsics sampler] --> B[Compose local camera translation]
    B --> C[CameraPoseWriter]
    C --> D[Physics FrameView]
    C --> E[USD camera prim]
    C --> F[camera.reset for selected environments]
    D --> G[camera.data world pose]
    E --> H[RTX rendered image]
    F --> G
Loading

Reviews (1): Last reviewed commit: "Address review 2: trim comments, tag wor..." | Re-trigger Greptile

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

Adds CameraPoseWriter, a tagged workaround that mirrors a camera's local pose onto the USD camera prim in addition to the physics FrameView, so camera-extrinsics variations move the render under Newton. The diagnosis holds up: NewtonSiteFrameView.set_local_poses only writes Warp _site_local, and IsaacRtxRenderer.update_camera is a no-op that reads the USD camera prim directly — so the extra write is genuinely needed there. The workaround is well quarantined and bug-tagged for removal, and the variation is the only camera-pose write site in Arena, so the fix lands in the right place.

Findings

🟡 Warning: tests/test_camera_extrinsics_variation_render.py:169 — all four tests build with force_disable_fabric=True (the helper default), but ArenaEnvBuilderCfg.disable_fabric defaults to False. The default path — Fabric on — is the one where "does a plain-USD write reach the renderer?" is actually in question, and it is untested.

🔵 Improvement: patches/camera_render_pose.py:80 — on PhysX FabricFrameView.set_local_poses already forwards to an internal UsdFrameView on the same prim path, so the second write is a duplicate there and _assert_views_share_local_frame compares the view with itself.

🔵 Improvement: patches/camera_render_pose.py:67 — orientations is never passed by any caller, and the physics and USD views document different quaternion orders.

🔵 Improvement: tests/…:36, :204, :30 — a getattr guard that can never fire, four tests that are two bodies × two backends (parametrize?), and an always-False SAVE_IMAGES path that drags along _save_offset_images, IMAGE_OUTPUT_DIR, output_subdir, and a request fixture.

Test Coverage

Good coverage of the actual regression: render-level and pose-level checks on both backends, correctly marked with_cameras for phase 2, using the persistent-SimApp helper. Two gaps: Fabric is forced off (above), and every test runs --num_envs 1, so the writer's index alignment between the physics view and its independently-resolved UsdFrameView is never exercised across envs.

Verdict

Minor fixes needed

@qianl-nv qianl-nv 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.

Thanks for providing a clean WAR for this bug in Lab 😂
Approved with a few nits.

Comment thread isaaclab_arena/patches/__init__.py Resolved
@alexmillane
alexmillane enabled auto-merge (squash) September 9, 2026 09:28
@alexmillane
alexmillane merged commit 9f3ecb1 into main Sep 10, 2026
10 checks passed
qianl-nv added a commit that referenced this pull request Oct 23, 2026
Update Arena to the Isaac Lab 3.0.0 GA pin and Isaac Sim 6.2. Keep the
Isaac Sim base image while installing the pinned Lab and Arena source
trees from their frozen uv locks.

## Why this change?

Arena was on Lab 3.0 EA and Isaac Sim 6.1. Update to the [Isaac Lab
v3.0.0
release](https://github.com/isaac-sim/IsaacLab/releases/tag/v3.0.0),
pinned at
[`e3f7d9ff1f5d7f8280de3ece9000b7117f66bcf4`](isaac-sim/IsaacLab@e3f7d9f),
and adapt Arena to its released APIs and dependencies.

## What changes?

### Docker and uv workflow

- Follow the uv-based Docker installation introduced by Isaac Lab [PR
#7405](isaac-sim/IsaacLab#7405) and [commit
`eed50f77c53`](isaac-sim/IsaacLab@eed50f77c53),
while retaining Arena's Isaac Sim base-image stages and editable Lab
source.
- Interactive container shells alias `python` and `python3` to
`isaaclab.sh -p`, and `pytest` to `isaaclab.sh -p -m pytest`, so
commands initialize Isaac Sim and execute from `/opt/isaaclab-venv`.
- Non-interactive runtime and CI commands invoke `isaaclab.sh -p`
explicitly; build-time package operations use `uv pip` or
`/opt/isaaclab-venv/bin/python`. `/isaac-sim/python.sh` is no longer a
supported Arena entry point because it bypasses the Lab launcher and the
locked Lab virtual environment.
- Continue building from the Isaac Sim 6.2 image. Copy in uv 0.12.9 and
create `/opt/isaaclab-venv` with Isaac Sim's Kit Python.
- Sync third-party dependencies from the pinned Isaac Lab submodule's
frozen `uv.lock`. The metadata-only stage skips all local path packages;
after the complete submodule is copied, a second sync installs its
editable packages.
- Overlay Arena's non-Lab dependencies from Arena's frozen lock with `uv
sync --inexact`, then install Arena editable into the same environment.
- Pin uv 0.12.9 in Docker and native CI. Regenerating the lockfile with
the newer serializer puts Arena's Linux x86_64 constraint in top-level
`resolution-markers` and `supported-markers` and remove it from uv lock
edges.

### Torch 2.11 and CUDA 13 handling

- Isaac Lab [PR #8372](isaac-sim/IsaacLab#8372)
deliberately selects Torch 2.11.0 on CUDA 13.0. Torch 2.12's CUDA 13
NCCL 2.29 can fail beside Kit RTX or OVRTX on Blackwell because of a
driver shared-memory accounting issue. Torch 2.11 uses NCCL 2.28.9 and
avoids that failure while retaining Isaac Lab's
deferred-CUDA-initialization workaround.
- Native uv routes `torch==2.11.0` and `torchvision==0.26.0` to the
`cu130` PyTorch index. Docker takes those versions from Lab's frozen
lock instead of duplicating them in a hand-written constraint list.
Arena drops its direct `torchaudio` dependency, matching Lab.
- Build cuRobo with the CUDA 13.0 toolkit and
`CUDA_HOME=/usr/local/cuda-13.0`, matching PyTorch's CUDA major version.

### Other API and released-stack changes

- **Environment reset selectors — Lab [PR
#8030](isaac-sim/IsaacLab#8030) and [PR
#8015](isaac-sim/IsaacLab#8015 accept Lab's
tensor, slice, and `None` environment selections in Arena's environment
and recorder reset paths. This is API compatibility, no behavior change.
- **Camera observations — Lab [PR
#8051](isaac-sim/IsaacLab#8051 replace the
removed generic `mdp.image` term with the RGB, depth, normals, or
segmentation observation function selected for each modality.
Unsupported data types now fail explicitly.
- **Newton camera pose propagation — Lab [issue
#7676](isaac-sim/IsaacLab#7676), [PR
#7691](isaac-sim/IsaacLab#7691), and release
backport [PR #7935](isaac-sim/IsaacLab#7935
Lab 3.0 now mirrors Newton `FrameView` pose writes into Fabric so RTX
sees camera movement. Remove Arena [PR
#1196](#1196) and its
`CameraPoseWriter` USD workaround. Camera-extrinsics variations now use
Lab `set_local_poses()` directly; retained tests cover rendered images
and reported poses under PhysX and Newton with Fabric enabled and
disabled.
- **Runtime camera intrinsics — Lab [PR
#7916](isaac-sim/IsaacLab#7916 replace
private USD sensor access and `_update_intrinsic_matrices()` with
`Camera.set_intrinsic_matrices()`. Lab's ordinary pinhole runtime API
enforces square pixels, so Arena now samples one focal-length delta and
applies it to both `fx` and `fy`. **Note:** intrinsics variation has an
pre-existing bug before this Lab upgrade which results in env_0 camera
params being used for all parallel envs. Fix will go in a separate PR.
- **Clone-plan topology — Lab [PR
#8045](isaac-sim/IsaacLab#8045), backported in
[PR #8073](isaac-sim/IsaacLab#8073 resolve
representative scene geometry through asset-prototype IDs, prototype
paths, and clone-plan topology instead of the removed
`cloner.query.iter_sources()` helper. arena_world_scene_access.py was
updated to essentially re-implement the removed helper.
- **Franka presets — Lab [PR
#8169](isaac-sim/IsaacLab#8169) and [PR
#8170](isaac-sim/IsaacLab#8170 select
`FRANKA_PANDA_LEGACY_CFG` and `FRANKA_PANDA_LEGACY_HIGH_PD_CFG`
explicitly after Lab made the flat Franka asset the default and
introduced shared minimal presets. This keeps Arena's nested `/panda`
hierarchy, legacy joint names, and existing actuator grouping.
- **Replicator kitchen USD — Isaac Sim 6.2 asset update:** update tests
for `kitchen_peninsula.usda`, which now exposes 50 physics roots instead
of 56. Its `_OnlineVisual` physics roots decrease from 24 to 18, and the
previously discovered `_OnlineVisual` articulation is no longer present.
- Unit test pick and place success speed thresholds were relax due to
large observed residual speed. Root cause unknown yet.

## Validation

Passing local checks:

- `uv lock --check --no-python-downloads` with uv 0.12.9
- Docker build and Isaac Sim startup/import smoke checks with Torch
2.11.0+cu130 and NCCL 2.28.9
- All RL and IL sample workflow replay and inference commands are
validated and producing expected success rate.

---------

Signed-off-by: Qian Lin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants