Repository navigation
Minor Updates & Patches to Visualizers - #5610
matthewtrepte merged 22 commits into
Conversation
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR improves visualizer UX by disabling automatic browser launch and introduces a unified RL training infrastructure.
Commit Range Reviewed
- Previous SHA:
95017233e23a886c6f5ce7ebd2b86a0f5ed9b9c8 - Current SHA:
dc105496cc7574163c3e7df15adf8a811decb66b
Incremental Changes (Latest Review)
The new commits add significant RL training infrastructure:
1. Unified CLI Entrypoints (scripts/reinforcement_learning/train.py, play.py)
- Adds
--rl_librarydispatch to select RL framework (rl_games, rsl_rl, skrl, sb3, rlinf) - Clean separation via
common.pyshared utilities
2. Per-Library Implementations (new train_<lib>.py and play_<lib>.py)
- Consistent argument parsing via
add_common_train_args() - Deprecation warnings added to old standalone scripts
3. URDF/MJCF Converter Updates
- Refactored to delegate to Isaac Sim importer pipeline
- New config options:
robot_type,run_asset_transformer,debug_mode, actuator gain overrides
4. CLI Updates (isaaclab/cli/__init__.py, utils.py)
- Added
trainandplayconsole script entry points - Script alias resolution for
isaaclab -p train.py
5. Newton Cloner Fix (isaaclab_newton/cloner/newton_replicate.py)
- Fixed boundary-safe path prefix matching in
_rename_builder_labels
Previous Review Comments
The three inline comments from the initial review remain actionable (files unchanged in this commit range):
simulation_cfg.py- Docstring/default mismatch foruse_fabrictest_simulation_context_visualizers.py-open_browserKeyError bugbase_visualizer.py- WARNING log level for informational URL
New Changes Assessment
✅ No new critical issues in the incremental changes.
Incremental review update: May 15, 2026
| if app is not None and app.is_running(): | ||
| # Keep app pumping for viewport/UI updates only; physics is owned by SimulationContext. | ||
| # Disable playSimulations around app.update() so Kit does not advance its own physics here. | ||
| # Newton is not driven by Kit's player loop, so avoid toggling the setting; the Kit |
There was a problem hiding this comment.
todo(mtrepte): look into why this is necessary to fix play/pause with newton physics
i don't think we should need to toggle kit physics with using newton physics
Greptile SummaryThis PR makes several focused improvements to the Isaac Lab visualizer stack: browser auto-launch is disabled by default for Rerun and Viser (replaced by a highlighted URL in startup logs), visualization markers are re-enabled when rendering is active but no standalone visualizer is launched, and Kit-visualizer play/pause behaviour is fixed for Newton physics.
Confidence Score: 3/5Two concrete defects should be fixed before merging: a docstring that misreports the The
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Visualizer launch] --> B{open_browser?}
B -- True --> C[Open browser tab]
B -- False --> D[Log URL box at WARNING level]
D --> E[User Ctrl-clicks URL]
C --> F[Viewer ready]
E --> F
G[VisualizationMarkers._ensure_backends_initialized] --> H{sim available?}
H -- No --> I[_ensure_kit_backend]
H -- Yes --> J{sim.is_rendering OR kit visualizer active?}
J -- Yes --> I
J -- No --> K{Newton visualizer active?}
K -- Yes --> L[_ensure_newton_backend]
K -- No --> M[No backend initialized]
|
| use_fabric: bool = True | ||
| """Enable/disable reading of physics buffers directly. Default is True. | ||
| """Enable/disable reading of physics buffers directly. Default is False. |
There was a problem hiding this comment.
The docstring says "Default is False" but
use_fabric is initialised to True. This will mislead users who rely on documentation or IDE tooltips to understand the default behaviour.
| use_fabric: bool = True | |
| """Enable/disable reading of physics buffers directly. Default is True. | |
| """Enable/disable reading of physics buffers directly. Default is False. | |
| use_fabric: bool = True | |
| """Enable/disable reading of physics buffers directly. Default is True. |
| visualizer._create_viewer(record_to_viser="record.viser", metadata={"num_envs": 8}) | ||
|
|
||
| assert captured["set_model"] == "dummy-model" | ||
| assert captured["init"]["open_browser"] is False |
There was a problem hiding this comment.
Test will fail with
KeyError – open_browser is never captured
_FakeNewtonViewerViser.__init__ (lines 491-508) builds captured["init"] from its explicitly declared parameters (port, label, verbose, share, record_to_viser, metadata). It does not accept an open_browser argument, and the real ViserVisualizer._create_viewer does not pass open_browser to NewtonViewerViser at all — the flag is consumed locally to decide whether to call _open_viser_web_viewer. Therefore captured["init"]["open_browser"] will raise KeyError every time this parametrized test runs.
| logger.warning( | ||
| "\n%s\n%s\n%s\n%s\n%s\n%s server running at: %s\n", | ||
| f"╭{'─' * left_rule_width}{title}{'─' * right_rule_width}╮", | ||
| f"│{' ' * (label_width + 4)}╷{' ' * (value_width + 4)}│", | ||
| f"│ {'HTTP':<{label_width}} │ {viewer_url:<{value_width}} │", | ||
| f"│{' ' * (label_width + 4)}╵{' ' * (value_width + 4)}│", | ||
| f"╰{'─' * inner_width}╯", | ||
| visualizer_label.capitalize(), | ||
| viewer_url, | ||
| ) |
There was a problem hiding this comment.
Informational URL banner logged at WARNING level
_log_viewer_url emits the startup URL box via logger.warning(...). In production log aggregators (e.g. Grafana, CloudWatch, ELK) WARNING-level entries are surfaced as alerts or counted toward error budgets. The intent is clearly informational; logger.info would achieve the same goal for operators who have their log level at INFO, and the print() call placed just before the invocation already guarantees terminal visibility.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR makes sensible UX improvements to visualizers: disabling auto-browser launch by default (preferring URL logging), adding Viser remote access configuration, fixing marker initialization when rendering without standalone visualizers, and adding play/pause controls.
✅ Latest Commit Review: cdf8f246 ("prep for review")
This commit improves the scene data provider integration across visualizers:
1. LGTM: Scene Data Provider Passthrough ✅
NewtonManager.get_state() now accepts an optional scene_data_provider parameter:
def get_state(cls, scene_data_provider=None) -> State:
cls.update_visualization_state(scene_data_provider)
return cls.get_state_0()This enables proper backend detection without relying solely on global PhysicsManager._sim state.
2. LGTM: Backend Detection Improvement ✅
_backend_is_newton() now checks the provider's backend type directly when available:
def _backend_is_newton(cls, scene_data_provider=None) -> bool:
if scene_data_provider is not None:
return isinstance(scene_data_provider.backend, NewtonSceneDataBackend)
# fallback to global sim check3. LGTM: Internal Attribute Renaming ✅
PhysX-specific naming generalized for clarity:
_physx_visualization_scene_data→_visualization_scene_data_physx_visualization_mapping→_visualization_mapping
4. LGTM: Visualizer Updates ✅
All visualizers (Newton, Rerun, Viser) now pass their scene data provider to get_state():
self._state = NewtonManager.get_state(self._scene_data_provider)5. LGTM: Test Coverage ✅
- Unit tests updated with new method signatures
- Mock lambdas now accept
scene_data_provider=None - Integration tests verify provider passthrough
6. Minor: Code Formatting ✅
- Import ordering (isort-style) in several files
- Line break cleanup in test assertions
Previous Review Summary
- ✅ Merge conflict resolved
- ✅ Focal length configuration
- ✅ KitVisualizer camera ownership
- ✅ Headless test mode
Verdict: ✅ Ready for merge. Clean provider-aware refactor with comprehensive test updates.
Updated: 2026-05-19T00:47:00Z
Head SHA: cdf8f24
Previous SHA: 1e13eac
Rebase the PR onto current develop and keep only the branch-specific visualizer changes.
852a9c7 to
9afef86
Compare
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot — Update
✅ New Commits Review (since cbff0e8)
Five new commits pushed (plus develop merges):
1. Develop Merge ✅ (3793f82)
Standard merge commit pulling latest develop changes. No concerns.
2. CI Image Unpin + Error Message Tweak ✅ (3eb9f1c)
- Unpins the Isaac Sim image version for CI
- Tweaks error message in visualizer test
Good CI hygiene — tracking latest develop image and improving diagnostics.
3. Test Reorganization ✅ (23adaf9)
Moves updated visualizer integration tests into a separate new PR to merge back after Isaac Sim CI is moved to latest develop.
Rationale: Avoids CI flakiness on the pinned image while allowing core visualizer fixes to merge now. Follow-up PR will restore full coverage.
4. Skip Flaky Test ✅ (0dbbe0e)
@pytest.mark.skip(reason="ViewerGL frame motion is flaky on the current pinned Isaac Sim CI image.")
def test_cartpole_newton_visualizer_viewergl_rgb_motion(...):Temporary skip with clear reason documented. Appropriate given the upstream CI image constraints.
5. Final Develop Merge ✅ (46272e6)
Standard merge commit. No conflicts.
Summary
All new commits are CI/test housekeeping:
- Develop syncs (2 merge commits)
- CI image unpin for stability
- Test deferral to follow-up PR (strategic)
- Flaky test skip (documented reason)
Core visualizer fixes from original review remain intact. The approach of splitting flaky tests into a follow-up PR is pragmatic.
Verdict: ✅ Ready for merge.
Updated: 2026-05-19T23:35:00Z
Head SHA: 46272e6
Previous SHA: cbff0e8
🔄 Update (fd1e6b1a)
New commit adds a performance optimization for apply_external_force_torque:
Zero-Wrench Fast Path ✅
# Skip force application if the wrench ranges are zero
if force_range[0] == 0.0 and force_range[1] == 0.0 and torque_range[0] == 0.0 and torque_range[1] == 0.0:
returnWhat it does:
- Adds early return when
force_rangeandtorque_rangeare both exactly(0.0, 0.0) - Avoids unnecessary sampling +
WrenchComposeroverhead for no-op configurations
Why it matters:
- Many tasks declare the event term but apply no disturbance (common default)
- PR #5265 introduced a per-step regression for these cases
- This restores H1, G1, and Anymal-C
Velocity-Roughthroughput
Assessment:
- ✅ Clean, minimal change
- ✅ Well-documented changelog entry
- ✅ No behavior change for non-zero ranges
- ✅ Addresses real performance regression
Verdict: ✅ Still ready for merge.
Updated: 2026-05-20T00:34:00Z
Head SHA: fd1e6b1
Previous SHA: 46272e6
…r isaac sim CI is moved to latest develop
# Description On GPU PhysX, the first camera observation from `env.reset()` showed rigid bodies at their spawn pose. The state observations were correct. A physics step made the image correct. Fixes #8428. This PR includes the regression test from #8427 (commit by @Jean-Francois-Lafleche). ## Root cause The renderer is correct. Fabric is stale. After the first `env.reset()` on `cuda:0`, the cube has these x positions: | Source | x [m] | | --- | --- | | PhysX tensor view (`root_view.get_transforms()`) | -0.20 (reset pose) | | Fabric `omni:fabric:worldMatrix` | -0.35 (spawn pose) | | Rendered silhouette | spawn pose | The cause is the Fabric re-synchronization in `PhysxManager.play()` (#5178, #5610). The sequence is: 1. `SimulationContext.reset()` calls `PhysxManager.play()` on the initial stop-to-play transition. 2. `play()` calls `_sync_fabric_after_resume()`, which detaches and re-attaches the `omni.physx.fabric` stage. 3. After the re-attach, `force_update()` ignores poses written through the GPU tensor API until the next `simulate()`. 4. `ManagerBasedEnv.reset()` writes the reset pose through the GPU tensor API. `forward()` calls `force_update()`, but Fabric keeps the spawn pose. These checks confirm the sequence: * With `_re_sync_fabric()` disabled, the first reset frame shows the reset pose at step 0. * A raw `simulate()` before `env.reset()` also fixes the frame. The same call at the end of `PhysxManager.reset()`, before `play()`, does not. * `fabric.update()`, `fabricUseGPUInterop=false`, and an extra detach/attach with `force_update()` do not fix the frame. * The CPU pipeline is not affected. * After the first physics step, later resets publish correctly without a step. This is why the test from #7891 passes. ## Change `PhysxManager.play()` now re-syncs Fabric only when the timeline resumes from pause. A fresh stop-to-play transition does not need the #4279 workaround. The #4279 workaround is still necessary on Isaac Sim 6.1. With the re-sync removed completely, the Kit pause/resume test fails: the robot stays frozen after resume (12 changed pixels, at least 100 required). ## Remaining PhysX defect This PR avoids the defect at start-up only. The defect itself is in `omni.physx.fabric` 110.3.2. After `detach_stage()` and `attach_stage()`, `force_update()` does not publish GPU tensor API pose writes until the next `simulate()`. The `force_update()` docstring says that it updates Fabric "even if simulation did not run", so this behavior is a PhysX defect. Thus, this sequence still returns a stale first frame: ```python sim.pause() sim.play() # re-attaches Fabric env.reset() # reset poses do not reach Fabric before a physics step ``` A PhysX ticket for this defect will be filed and linked in #8428. When PhysX fixes it, Isaac Lab can remove the re-sync condition in `play()`. If PhysX also fixes the #4279 resume freeze, Isaac Lab can remove the detach/attach workaround. ## Validation Isaac Sim 6.1.0.0, RTX A6000, driver 595.91.07: | Test | Before | After | | --- | --- | --- | | `test_first_frame_textured_rendering.py` | first-reset test failed (IoU 0.370) | 2 passed | | `test_visualizer_integration_physx.py` (Kit pause/resume, #4279) | — | passed | | `test_simulation_context.py` | — | 26 passed | | `test_simulation_context_kit.py` | — | 4 passed | `test_visualizer_tiled_integration_physx.py` fails in my container with `Canvas must be an instance of HeadlessCanvas` (pyglet). It fails the same way without this change. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist Docker and GPU tests run on demand. Push the commits you want tested, then comment `run-ci` on the pull request. - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: JF Lafleche <[email protected]> Co-authored-by: JF Lafleche <[email protected]> Co-authored-by: pv-nvidia <[email protected]> Co-authored-by: Octi Zhang <[email protected]>
On GPU PhysX, the first camera observation from `env.reset()` showed rigid bodies at their spawn pose. The state observations were correct. A physics step made the image correct. Fixes isaac-sim#8428. This PR includes the regression test from isaac-sim#8427 (commit by @Jean-Francois-Lafleche). The renderer is correct. Fabric is stale. After the first `env.reset()` on `cuda:0`, the cube has these x positions: | Source | x [m] | | --- | --- | | PhysX tensor view (`root_view.get_transforms()`) | -0.20 (reset pose) | | Fabric `omni:fabric:worldMatrix` | -0.35 (spawn pose) | | Rendered silhouette | spawn pose | The cause is the Fabric re-synchronization in `PhysxManager.play()` (isaac-sim#5178, isaac-sim#5610). The sequence is: 1. `SimulationContext.reset()` calls `PhysxManager.play()` on the initial stop-to-play transition. 2. `play()` calls `_sync_fabric_after_resume()`, which detaches and re-attaches the `omni.physx.fabric` stage. 3. After the re-attach, `force_update()` ignores poses written through the GPU tensor API until the next `simulate()`. 4. `ManagerBasedEnv.reset()` writes the reset pose through the GPU tensor API. `forward()` calls `force_update()`, but Fabric keeps the spawn pose. These checks confirm the sequence: * With `_re_sync_fabric()` disabled, the first reset frame shows the reset pose at step 0. * A raw `simulate()` before `env.reset()` also fixes the frame. The same call at the end of `PhysxManager.reset()`, before `play()`, does not. * `fabric.update()`, `fabricUseGPUInterop=false`, and an extra detach/attach with `force_update()` do not fix the frame. * The CPU pipeline is not affected. * After the first physics step, later resets publish correctly without a step. This is why the test from isaac-sim#7891 passes. `PhysxManager.play()` now re-syncs Fabric only when the timeline resumes from pause. A fresh stop-to-play transition does not need the isaac-sim#4279 workaround. The isaac-sim#4279 workaround is still necessary on Isaac Sim 6.1. With the re-sync removed completely, the Kit pause/resume test fails: the robot stays frozen after resume (12 changed pixels, at least 100 required). This PR avoids the defect at start-up only. The defect itself is in `omni.physx.fabric` 110.3.2. After `detach_stage()` and `attach_stage()`, `force_update()` does not publish GPU tensor API pose writes until the next `simulate()`. The `force_update()` docstring says that it updates Fabric "even if simulation did not run", so this behavior is a PhysX defect. Thus, this sequence still returns a stale first frame: ```python sim.pause() sim.play() # re-attaches Fabric env.reset() # reset poses do not reach Fabric before a physics step ``` A PhysX ticket for this defect will be filed and linked in isaac-sim#8428. When PhysX fixes it, Isaac Lab can remove the re-sync condition in `play()`. If PhysX also fixes the isaac-sim#4279 resume freeze, Isaac Lab can remove the detach/attach workaround. Isaac Sim 6.1.0.0, RTX A6000, driver 595.91.07: | Test | Before | After | | --- | --- | --- | | `test_first_frame_textured_rendering.py` | first-reset test failed (IoU 0.370) | 2 passed | | `test_visualizer_integration_physx.py` (Kit pause/resume, isaac-sim#4279) | — | passed | | `test_simulation_context.py` | — | 26 passed | | `test_simulation_context_kit.py` | — | 4 passed | `test_visualizer_tiled_integration_physx.py` fails in my container with `Canvas must be an instance of HeadlessCanvas` (pyglet). It fails the same way without this change. - Bug fix (non-breaking change which fixes an issue) - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` Docker and GPU tests run on demand. Push the commits you want tested, then comment `run-ci` on the pull request. - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there Conflict: source/isaaclab_visualizers/test/golden_images/anymal_d/physx-kit-tiled.png keeps the release version. The release refreshed this golden for the published 6.2 checkerboard (isaac-sim#8685), and the version from PR 8433 predates that refresh. The test test_visualizer_golden[physx-anymal_d-kit-tiled] passes with the kept golden. --------- Signed-off-by: JF Lafleche <[email protected]> Co-authored-by: JF Lafleche <[email protected]> Co-authored-by: pv-nvidia <[email protected]> Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit 4eccae0)
Description
Contains a few minor updates and patches to visualizers.
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there