Skip to content

Render Newton RTX markers in the viewer and headless capture - #7529

Closed
diegoferigo-rai wants to merge 1 commit into
isaac-sim:developfrom
diegoferigo-rai:diegoferigo/newton-rtx-marker-video-capture
Closed

diegoferigo-rai wants to merge 1 commit into
isaac-sim:developfrom
diegoferigo-rai:diegoferigo/newton-rtx-marker-video-capture

Conversation

@diegoferigo-rai

@diegoferigo-rai diegoferigo-rai commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds experimental visualization-marker support to the Newton RTX visualizer. Newton RTX overlays markers on a USD stage that rejects the :: and other characters carried by marker registry group ids (the registry key has the form prim_path::id). Without RTX-specific handling, both the interactive newton_rtx viewer and headless captures omit goal poses, command arrows and the other debug markers drawn by the GL viewer.

The change sanitizes each marker group id into a valid USD prim path before logging it into the RTX viewer, renders markers during the RTX live step, and adds the same marker pass to the RTX render_rgb_array headless capture. The sanitization is scoped to the RTX path through a new sanitize_group_ids argument on render_newton_visualization_markers, restoring the original registry key after each render, so the GL viewer keeps rendering the raw ids and its behavior is unchanged.

Newton RTX remains experimental. This implementation intentionally provides a small compatibility layer for the existing Newton marker backend and can be streamlined together with the broader Newton RTX marker path in a future release.

This is the RTX counterpart of the GL-only fix in #7011, kept as a separate PR so it can be reviewed on its own.

Tested with the unit tests, which need no simulator:

uv run --extra test python -m pytest \
  source/isaaclab_visualizers/test/test_newton_adapter.py

70 passed. The three added tests cover group-id sanitization, the RTX render sanitizing the id and restoring the original registry key, and the GL path still rendering the raw id.

Type of change

  • New feature (non-breaking change which adds functionality)

Release backport

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

Screenshots

Not attached: the markers are the same goal poses and command arrows the GL viewer already draws, now also visible in the RTX viewer and its captures. I can add before/after RTX captures if useful.

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 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

@diegoferigo-rai
diegoferigo-rai requested a review from a team September 3, 2026 09:31
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 3, 2026
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR enables Newton visualization markers in both interactive RTX rendering and headless RGB capture while preserving existing GL behavior.

  • Sanitizes RTX marker registry IDs into USD-compatible paths and restores the original IDs after rendering.
  • Adds marker rendering to the RTX live-step and headless capture paths.
  • Adds focused tests for sanitization, restoration, and unchanged GL rendering.
  • Adds the required changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or non-blocking defects identified.

The RTX paths now render markers with USD-safe temporary IDs, restore registry state even when rendering raises, and retain the prior raw-ID behavior for GL viewers.

Important Files Changed

Filename Overview
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualization_markers.py Adds RTX-scoped marker ID sanitization with exception-safe restoration while leaving the default GL path unchanged.
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py Enables sanitized marker rendering in interactive RTX frames and headless RGB captures.
source/isaaclab_visualizers/test/test_newton_adapter.py Covers path sanitization, restoration of registry IDs, and preservation of raw IDs for GL rendering.
source/isaaclab_visualizers/changelog.d/newton-rtx-video-capture.rst Documents restored marker rendering for interactive and captured RTX output.

Sequence Diagram

sequenceDiagram
    participant V as Newton Visualizer
    participant R as Marker Registry
    participant M as Visualization Marker
    participant RTX as RTX Viewer
    V->>R: Get active marker groups
    R-->>V: Marker groups
    V->>M: Temporarily sanitize group_id
    V->>M: Render marker
    M->>RTX: Log marker using USD-safe path
    V->>M: Restore original group_id
Loading

Reviews (1): Last reviewed commit: "Render Newton RTX markers in the viewer ..." | Re-trigger Greptile

@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 change adds RTX-specific marker ID sanitization and invokes marker rendering in both interactive RTX frames and headless RGB capture while retaining the existing GL behavior.

  • Design and architecture: The RTX/GL distinction remains localized at the visualization boundary. Marker IDs are temporarily replaced only during RTX rendering and restored in a finally block, preserving the registry key used for lifecycle management. The sanitizer’s many-to-one mapping remains a minor collision tradeoff, mitigated by the instance ID suffix in current group IDs.
  • API: The marker-rendering helper gains a documented optional parameter that defaults to false, preserving existing callers and GL semantics. The private sanitization helper requires no exported API integration, and the user-visible change has an appropriate package changelog fragment.
  • Implementation: The interactive and headless paths both render markers inside the existing begin-frame/end-frame lifecycle and honor enable_markers. Tests cover sanitization, restoration of the original registry ID, and unchanged unsanitized behavior. The local NewtonManager import is redundant but not materially problematic.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@matthewtrepte

Copy link
Copy Markdown
Collaborator

thanks for the change. hm currently, visualization markers are not supported in the Newton RTX visualizer, so it this changed needed?

The Newton RTX visualizer overlays visualization markers on a USD stage that
rejects the "::" and other characters the marker registry group id carries,
so both the interactive RTX viewer and a headless capture recorded through it
dropped the goal poses, command arrows, and other debug markers the GL viewer
draws every frame.

Sanitize each marker group id into a valid USD prim path before logging it
into the RTX viewer, render the markers on the RTX live-step path, and add the
same marker pass to the RTX render_rgb_array headless capture. The GL viewer
keeps rendering the raw registry ids, so its behavior is unchanged. This is the
RTX counterpart of the still-open GL-only fix in isaac-sim#7011.

Add unit tests for the group-id sanitization and for the render helper both
restoring the original registry key after a sanitized RTX render and leaving
the raw GL id untouched.
@diegoferigo-rai
diegoferigo-rai force-pushed the diegoferigo/newton-rtx-marker-video-capture branch from 68368a5 to ad50afd Compare September 22, 2026 09:55
@diegoferigo-rai

Copy link
Copy Markdown
Contributor Author

Good question. This PR is effectively adding experimental visualization-marker support to Newton RTX: the existing Newton marker backend already works with ViewerRTX, but the registry IDs contain characters such as :: that OVRTX rejects as USD prim paths.

Would you be open to supporting markers experimentally through this small RTX-specific sanitization for the time being? The implementation can then be streamlined together with the broader Newton RTX marker path in a future release. I can also update the documentation and PR description to make the experimental status explicit.

@kellyguo11

Copy link
Copy Markdown
Contributor

if we can get visualization markers working for the newton RTX viewer, that would be a great change. the support from the newton side may take a bit more time. @matthewtrepte could you review this and see if allows the visualization markers to work correctly?

@matthewtrepte

Copy link
Copy Markdown
Collaborator

thanks Diego! i confirmed this workaround does work for NewtonRTX visualizer. I moved your change into a PR based on top of tree with another fix - #8220. Closing this bug.

ooctipus added a commit that referenced this pull request Oct 5, 2026
…fix (#8220)

Fixes two problems with the Newton RTX visualizer (`--visualizer
newton_rtx`). This includes Diego Ferigo's commit from #7529, merged
with current develop, so it supersedes that PR.

**Markers.** The RTX viewer skipped visualization markers because their
registry ids (`prim_path::id`) aren't valid USD prim paths. On the RTX
path they are now rendered under a sanitized id, both live and in
headless capture. The GL viewer is unchanged.

**Black viewer.** With `ovrtx` 0.5, render outputs are keyed
`/Render/Vars/LdrColor`, but Newton's `ViewerRTX` looks up `LdrColor`.
The lookup failed silently, so the window was never drawn to and
headless capture raised. `NewtonViewerRTX` now aliases the color output
as `LdrColor` when `ovrtx` is 0.5 or newer, the same version split the
OVRTX camera renderer has used since #7954. Both this and the id
sanitizing are workarounds and carry a TODO.

Nothing tested Newton RTX frames before, so I added
`test_visualizer_integration_newton_rtx.py`. On the cartpole it checks
that frames aren't flat, move while playing, freeze while the simulation
is paused, and change when a marker is made visible. It's a separate
kit-less module because OVRTX can't share a process with Kit.

## Testing

- The adapter, viewer-release and new integration tests pass. Without
the `LdrColor` fix the integration test and a unit test fail; without id
sanitizing the marker check fails.
- Ruff and the changelog check are clean.
- On a live `newton_rtx` window with no patches, Kuka Allegro (4 envs,
`newton_mjwarp`) renders the scene and the table markers.

## Notes

- The `LdrColor` fix relies on Newton's private `_render_products` and
on the key Newton authors (`/Render/Vars/LdrColor`), so it should go
once Newton accepts both keys. There's no upstream issue yet.
- `render_rgb_array()` on the async RTX viewer returns the previous
submission, one frame behind. The test flushes once to compensate.
- RTX has no Pause Rendering control, so that phase of the shared motion
test runs for the GL viewer only.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

---------

Co-authored-by: Diego Ferigo <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
isaaclab-bot Bot pushed a commit that referenced this pull request Oct 5, 2026
…fix (#8220)

Fixes two problems with the Newton RTX visualizer (`--visualizer
newton_rtx`). This includes Diego Ferigo's commit from #7529, merged
with current develop, so it supersedes that PR.

**Markers.** The RTX viewer skipped visualization markers because their
registry ids (`prim_path::id`) aren't valid USD prim paths. On the RTX
path they are now rendered under a sanitized id, both live and in
headless capture. The GL viewer is unchanged.

**Black viewer.** With `ovrtx` 0.5, render outputs are keyed
`/Render/Vars/LdrColor`, but Newton's `ViewerRTX` looks up `LdrColor`.
The lookup failed silently, so the window was never drawn to and
headless capture raised. `NewtonViewerRTX` now aliases the color output
as `LdrColor` when `ovrtx` is 0.5 or newer, the same version split the
OVRTX camera renderer has used since #7954. Both this and the id
sanitizing are workarounds and carry a TODO.

Nothing tested Newton RTX frames before, so I added
`test_visualizer_integration_newton_rtx.py`. On the cartpole it checks
that frames aren't flat, move while playing, freeze while the simulation
is paused, and change when a marker is made visible. It's a separate
kit-less module because OVRTX can't share a process with Kit.

## Testing

- The adapter, viewer-release and new integration tests pass. Without
the `LdrColor` fix the integration test and a unit test fail; without id
sanitizing the marker check fails.
- Ruff and the changelog check are clean.
- On a live `newton_rtx` window with no patches, Kuka Allegro (4 envs,
`newton_mjwarp`) renders the scene and the table markers.

## Notes

- The `LdrColor` fix relies on Newton's private `_render_products` and
on the key Newton authors (`/Render/Vars/LdrColor`), so it should go
once Newton accepts both keys. There's no upstream issue yet.
- `render_rgb_array()` on the async RTX viewer returns the previous
submission, one frame behind. The test flushes once to compensate.
- RTX has no Pause Rendering control, so that phase of the shared motion
test runs for the GL viewer only.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

---------

Co-authored-by: Diego Ferigo <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>

(cherry picked from commit 29e500d)
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

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants