Skip to content

use RendererCfg as default renderer_cfg in CameraCfg#5521

Merged
r-schmitt merged 11 commits into
isaac-sim:developfrom
r-schmitt:dev/rschmitt/remove_physx_dep_from_camera_cfg
May 7, 2026
Merged

use RendererCfg as default renderer_cfg in CameraCfg#5521
r-schmitt merged 11 commits into
isaac-sim:developfrom
r-schmitt:dev/rschmitt/remove_physx_dep_from_camera_cfg

Conversation

@r-schmitt
Copy link
Copy Markdown
Collaborator

@r-schmitt r-schmitt commented May 6, 2026

Description

the camera config was importing isaaclab_physx.renderers because the default render_cfg was set to that config. this PR sets that to RendererConfig to remove the import, but provides a get_default_render_config method to the backend_utils to lazily import the config if needed. this is called post_init on the camera config to replace the generic config as soon as possible to avoid downstream issues referencing the renderer config. this action can be moved to the factory if downstream references are cleaned up.

Type of change

  • Refactor to remove imports in cfg class

Checklist

  • 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 updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@r-schmitt r-schmitt requested review from nvsekkin and removed request for kellyguo11 and pascal-roth May 6, 2026 18:12
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label May 6, 2026
@r-schmitt r-schmitt requested a review from pbarejko May 6, 2026 18:12
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR removes the eager top-level import of isaaclab_physx.renderers.IsaacRtxRendererCfg from camera_cfg.py by defaulting renderer_cfg to None and resolving it lazily in __post_init__ via the new get_default_render_cfg() helper in backend_utils.py.

  • camera_cfg.py: renderer_cfg type widens to RendererCfg | None; __post_init__ calls get_default_render_cfg() to fill it in immediately, preserving existing downstream behaviour.
  • backend_utils.py: Adds get_default_render_cfg(), which uses importlib.import_module with distinct error handling for a missing module vs. a missing class attribute.
  • changelog.d/rschmitt_default_cameracfg_renderer.rst: Both :meth: cross-references spell the function name as get_default_renderer_cfg (with an extra renderer) instead of the actual get_default_render_cfg, producing broken Sphinx links.

Confidence Score: 4/5

Safe to merge; the lazy-import refactor works correctly at runtime and the post_init guard is solid. The only issue is a misspelled function name in the changelog RST that will produce broken Sphinx cross-references.

The core logic change — deferring the isaaclab_physx import to post_init — is well-structured and does not alter runtime behaviour for existing users. The sole finding is a mismatched function name in the changelog's :meth: references (get_default_renderer_cfg vs get_default_render_cfg), which breaks Sphinx link resolution but has no impact on the running code.

source/isaaclab/changelog.d/rschmitt_default_cameracfg_renderer.rst — both :meth: references use the wrong function name.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/sensors/camera/camera_cfg.py Changes renderer_cfg default from IsaacRtxRendererCfg() to None, with post_init lazily resolving it via get_default_render_cfg(); logic is sound and type annotation updated accordingly.
source/isaaclab/isaaclab/utils/backend_utils.py Adds get_default_render_cfg() with proper lazy-import pattern, distinct error handling for missing module vs missing class, and TYPE_CHECKING guard for the return type annotation.
source/isaaclab/changelog.d/rschmitt_default_cameracfg_renderer.rst Both :meth: cross-references use get_default_renderer_cfg (wrong name) instead of the actual get_default_render_cfg; will produce broken Sphinx links.

Sequence Diagram

sequenceDiagram
    participant User
    participant CameraCfg
    participant backend_utils
    participant isaaclab_physx

    User->>CameraCfg: CameraCfg(...) [renderer_cfg defaults to None]
    CameraCfg->>CameraCfg: __post_init__()
    alt renderer_cfg is None
        CameraCfg->>backend_utils: get_default_render_cfg()
        backend_utils->>isaaclab_physx: importlib.import_module("isaaclab_physx.renderers")
        isaaclab_physx-->>backend_utils: renderers module
        backend_utils->>isaaclab_physx: IsaacRtxRendererCfg()
        isaaclab_physx-->>backend_utils: IsaacRtxRendererCfg instance
        backend_utils-->>CameraCfg: RendererCfg instance
        CameraCfg->>CameraCfg: self.renderer_cfg = result
    else renderer_cfg already set
        CameraCfg->>CameraCfg: skip lazy import
    end
    CameraCfg-->>User: fully initialized CameraCfg
Loading

Reviews (1): Last reviewed commit: "use None as default renderer_cfg in Came..." | Re-trigger Greptile

Comment thread source/isaaclab/changelog.d/rschmitt_default_cameracfg_renderer.rst Outdated
@r-schmitt r-schmitt requested a review from kellyguo11 May 6, 2026 18:20
Comment thread source/isaaclab/isaaclab/sensors/camera/camera_cfg.py Outdated
Comment thread source/isaaclab/isaaclab/sensors/camera/camera_cfg.py Outdated
@r-schmitt r-schmitt changed the title use None as default renderer_cfg in CameraCfg use RendererCfg as default renderer_cfg in CameraCfg May 7, 2026
@r-schmitt r-schmitt merged commit 7b44452 into isaac-sim:develop May 7, 2026
53 of 56 checks passed
AntoineRichard pushed a commit that referenced this pull request May 8, 2026
#5538)

## Summary

Two unrelated CI breakages on develop, bundled here so develop turns
green in one PR.

### 1. Skip the failing viewergl test

`test_cartpole_newton_visualizer_viewergl_rgb_motion[physx,newton]`
started returning all-black frames on develop after
`nvcr.io/nvidian/isaac-sim:latest-develop` flipped to a Kit 110.1.1 +
USD 25.11 base. The failure has been deterministic across multiple PRs
(#5523, #5495, #5408, …).

Investigation so far has ruled out:
- PR #5521 (revert in
#5539 still failed)
- Newton 1.0 → 1.2.0rc2 viewer code regression (only 7-line addition;
ViewerGL alone yields 1.08M nonzero pixels)
- warp 1.12 → 1.13 RegisteredGLBuffer ABI (byte-identical)
- Module-load side effects of `isaaclab_physx.renderers`
- CUDA-GL interop (PR #5540 diagnostic confirms direct CPU FBO readback
also returns zeros, with `GL_NO_ERROR`)
- GL context-currency (PR #5541 H6 attempt: still fails)
- GL/CUDA sync (PR #5542 H4 attempt: still fails)

Diagnostic output (PR #5540 v2):
```
[VIZDIAG] fbo=c_uint(8)  pbo=None  size=600x600
[VIZDIAG] glGetError before: GL_NO_ERROR
[VIZDIAG] CPU-readback: nonzero=0/1080000  max=0  err=GL_NO_ERROR
[VIZDIAG] PBO-result: nonzero=0/1080000  max=0
```

The FBO itself is empty — Newton's pyglet/EGL renderer is not depositing
pixels under Kit 110.1.1, even though `tiled_camera_rgb_non_black` (Kit
RTX path) on the same env passes. Underlying root cause still being
chased; this PR ships the skip to unblock develop.

### 2. Fix warp intersphinx 404 in docs build

`https://nvidia.github.io/warp/objects.inv` started returning 404 —
Warp's `objects.inv` only lives at `/stable/` and `/latest/` now. With
Sphinx's `warnings_treated_as_errors`, the broken intersphinx fetch
fails the docs build on every PR. Pinning to `/stable/` (matches the
existing PyTorch `/docs/2.11/` workaround pattern in the same file).

Verified `https://nvidia.github.io/warp/stable/objects.inv` returns 200.

## Test plan

- [x] CI `isaaclab_visualizers` on this branch — was passing earlier
with the skip; will re-verify with the bundled docs fix
- [ ] CI `Build Latest Docs` on this branch — must turn green (was
failing on every recent PR before this fix)

## Re-enable plan

Once the underlying viewergl bug is identified and fixed, drop the
`@pytest.mark.skip` decorator and remove the
`jichuanh-disable-viewergl-flaky.skip` fragment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants