Adds collision, inertia, and visual geometry toggles to Newton viewer#5161
Conversation
Add show_collision option to NewtonVisualizerCfg and corresponding checkbox in the Newton viewer UI, allowing users to visualize collision meshes at runtime.
Greptile SummaryThis PR adds a One minor ordering inconsistency was found:
Additionally, the project guidelines in Confidence Score: 4/5Safe to merge — small, additive change that mirrors the pattern of existing show_* toggles with no logic risk. The change is a straightforward, additive feature following a well-established pattern (show_joints, show_contacts, show_springs, show_com). There are no logic errors, no security concerns, and no breaking API changes. The only issue is a minor field-ordering inconsistency between the cfg file and the visualizer file, and a missing CHANGELOG entry per project guidelines. No files require special attention; the ordering inconsistency in Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant NewtonVisualizer
participant NewtonViewerGL
participant ViewerGL
User->>NewtonVisualizer: initialize(scene_data_provider)
NewtonVisualizer->>NewtonViewerGL: NewtonViewerGL(width, height, ...)
NewtonVisualizer->>NewtonViewerGL: show_collision = cfg.show_collision
Note over NewtonViewerGL: Attribute set on viewer instance
loop Each rendered frame
NewtonViewerGL->>NewtonViewerGL: _render_left_panel()
NewtonViewerGL->>ViewerGL: imgui.checkbox("Show Collision", show_collision)
User->>NewtonViewerGL: Toggle "Show Collision" checkbox
NewtonViewerGL->>NewtonViewerGL: self.show_collision = new_value
ViewerGL->>ViewerGL: Render collision meshes (if show_collision=True)
end
Reviews (1): Last reviewed commit: "Add show collision mesh toggle to Newton..." | Re-trigger Greptile |
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
Show resolved
Hide resolved
…_visualizer_cfg.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: vidurv-nvidia <vidurv@nvidia.com>
There was a problem hiding this comment.
Code Review — PR #5161: Add show collision mesh toggle to Newton viewer
Overall: The feature itself is clean and follows the existing toggle pattern well. However, there's a blocking bug in the cfg file — duplicate field declarations that need to be cleaned up before merge.
Summary
| Category | Finding |
|---|---|
| 🔴 Bug | Duplicate show_contacts and show_springs field declarations in cfg |
| ✅ Good | newton_visualizer.py changes are correct and consistent with existing patterns |
| ✅ Good | UI ordering matches initializer ordering |
| ℹ️ Note | PR is 1 commit behind develop — rebase recommended before merge |
| ℹ️ Note | Checklist items for docs, tests, and changelog are unchecked — confirm if those are needed |
CI Status
Only the labeler check ran (passed). No lint/test CI triggered — this may be expected for the visualizer extension, but worth confirming.
| @@ -43,6 +43,15 @@ class NewtonVisualizerCfg(VisualizerCfg): | |||
| show_springs: bool = False | |||
There was a problem hiding this comment.
🔴 Bug: Duplicate field declarations — show_contacts and show_springs are defined twice.
This block (lines 40–43) contains the original show_contacts and show_springs declarations from develop. The PR then adds a new block (lines 46–52) that re-declares both fields alongside the new show_collision.
Result at PR HEAD:
show_contacts: bool = False # line 40 — original
show_springs: bool = False # line 43 — original
show_contacts: bool = False # line 46 — duplicate
show_collision: bool = False # line 49 — NEW (correct)
show_springs: bool = False # line 52 — duplicatePython dataclasses/@configclass will silently use the last definition, so this won't crash at runtime, but it's clearly wrong:
- Duplicate field declarations are confusing and violate DRY
- Some serialization/introspection tools may behave unexpectedly with duplicates
- It looks like the greptile suggestion was applied but the original lines weren't removed
Fix: Remove lines 40–43 (the original show_contacts and show_springs) so each field is declared exactly once:
| show_springs: bool = False | |
| show_joints: bool = False | |
| """Show joint visualization.""" | |
| show_contacts: bool = False | |
| """Show contact visualization.""" | |
| show_collision: bool = False | |
| """Show collision visualization.""" | |
| show_springs: bool = False | |
| """Show spring visualization.""" |
…_visualizer_cfg.py Co-authored-by: isaaclab-review-bot[bot] <270793704+isaaclab-review-bot[bot]@users.noreply.github.com> Signed-off-by: vidurv-nvidia <vidurv@nvidia.com>
Signed-off-by: vidurv-nvidia <vidurv@nvidia.com>
show_joints, show_contacts, show_collision, and show_springs were defined multiple times. Keep each once and preserve the new show_collision field.
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot — Follow-up
New commits (d232e02→0d0d99a): attempted to apply the ordering suggestion but duplicates got worse — the file now has show_joints ×2, show_contacts ×3, show_collision ×2, show_springs ×2, plus an orphaned docstring.
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
Outdated
Show resolved
Hide resolved
Add show_inertia_boxes option to NewtonVisualizerCfg and corresponding checkbox in the Newton viewer UI, allowing users to visualize body inertia boxes at runtime.
|
@matthewtrepte for viz |
|
/bot can you re-review the latest and clear the request changes |
|
Hey @vidurv-nvidia — I appreciate the ask, but I'm not able to formally approve PRs. 🙂 My reviews are posted as COMMENT only — I'm here to provide feedback, flag potential issues, and highlight things for maintainers to look at. The final approval needs to come from a human maintainer. Think of me as an extra set of eyes, not a gatekeeper! |
Your requested changes are stale and blocking the PR |
Dismissing stale review — the duplicate field declarations flagged previously have been resolved in the latest commits. The cfg and visualizer files are now clean.
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot — Follow-up (all clear)
Re-reviewed at 0a3d61c. The duplicate field declarations I flagged previously are fully resolved:
newton_visualizer_cfg.py— each field (show_collision,show_inertia_boxes) appears exactly once, with proper docstrings, in logical order (joints → contacts → collision → springs → inertia_boxes → com). ✅newton_visualizer.py— imgui checkboxes andinitialize()wiring are clean, no duplicates. ✅
No new issues found. Previous CHANGES_REQUESTED has been dismissed as stale.
LGTM from the bot side — ready for human maintainer approval. 👍
…isaac-sim#5161) # Description Add visualization toggles for collision meshes, inertia boxes, and visual geometries to the Newton viewer. - Add `show_collision` config option and UI checkbox to visualize collision meshes at runtime - Add `show_inertia_boxes` config option and UI checkbox to visualize body inertia boxes at runtime - Add `show_visual` config option and UI checkbox to toggle visual geometry rendering at runtime All options wire through `NewtonVisualizerCfg` to the underlying Newton `ViewerGL` attributes. ## Type of change - New feature (non-breaking change which adds functionality) ## Screenshots Please attach before and after screenshots of the change if applicable. ## Checklist - [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 `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] 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 --------- Signed-off-by: vidurv-nvidia <vidurv@nvidia.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: isaaclab-review-bot[bot] <270793704+isaaclab-review-bot[bot]@users.noreply.github.com>
Description
Add visualization toggles for collision meshes, inertia boxes, and visual geometries to the Newton viewer.
show_collisionconfig option and UI checkbox to visualize collision meshes at runtimeshow_inertia_boxesconfig option and UI checkbox to visualize body inertia boxes at runtimeshow_visualconfig option and UI checkbox to toggle visual geometry rendering at runtimeAll options wire through
NewtonVisualizerCfgto the underlying NewtonViewerGLattributes.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