Skip to content

Adds collision, inertia, and visual geometry toggles to Newton viewer#5161

Merged
kellyguo11 merged 8 commits intoisaac-sim:developfrom
vidurv-nvidia:vidur/feature/newton-viewer-collision
Apr 9, 2026
Merged

Adds collision, inertia, and visual geometry toggles to Newton viewer#5161
kellyguo11 merged 8 commits intoisaac-sim:developfrom
vidurv-nvidia:vidur/feature/newton-viewer-collision

Conversation

@vidurv-nvidia
Copy link
Copy Markdown

@vidurv-nvidia vidurv-nvidia commented Apr 3, 2026

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

  • 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

Add show_collision option to NewtonVisualizerCfg and corresponding
checkbox in the Newton viewer UI, allowing users to visualize
collision meshes at runtime.
@github-actions github-actions bot added enhancement New feature or request isaac-lab Related to Isaac Lab team labels Apr 3, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 3, 2026

Greptile Summary

This PR adds a show_collision toggle to the Newton viewer — a show_collision: bool = False config field on NewtonVisualizerCfg, a corresponding "Show Collision" imgui checkbox in _render_left_panel, and wiring from the config value to _viewer.show_collision in initialize(). The change is small, follows the same pattern as the existing show_joints, show_contacts, show_springs, and show_com toggles, and is safe to merge.

One minor ordering inconsistency was found:

  • The show_collision field is placed after show_springs in newton_visualizer_cfg.py, but in both the imgui UI and the initialize() assignment block it sits between show_contacts and show_springs. Aligning these orders makes the files easier to audit together.

Additionally, the project guidelines in AGENTS.md require a CHANGELOG.rst update for every change targeting a source/<package>/ directory. The isaaclab_visualizers package does not yet have a source/isaaclab_visualizers/docs/CHANGELOG.rst file, so either that file should be created with an initial entry covering this addition, or the existing changelog infrastructure should be confirmed as intentionally absent for this package.

Confidence Score: 4/5

Safe 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 newton_visualizer_cfg.py is cosmetic.

Important Files Changed

Filename Overview
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py Adds show_collision: bool = False field to NewtonVisualizerCfg; field is inserted between show_springs and show_com, but the corresponding UI and initializer in newton_visualizer.py place it between show_contacts and show_springs, creating an ordering inconsistency.
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py Adds "Show Collision" imgui checkbox in _render_left_panel (placed between "Show Contacts" and "Show Springs") and wires cfg.show_collision to _viewer.show_collision during initialization; consistent with how other show_* flags are handled.

Sequence Diagram

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

Reviews (1): Last reviewed commit: "Add show collision mesh toggle to Newton..." | Re-trigger Greptile

…_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>
Copy link
Copy Markdown

@isaaclab-review-bot isaaclab-review-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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 — duplicate

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

Suggested change
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."""

vidurv-nvidia and others added 3 commits April 2, 2026 23:31
…_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.
Copy link
Copy Markdown

@isaaclab-review-bot isaaclab-review-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Add show_inertia_boxes option to NewtonVisualizerCfg and corresponding
checkbox in the Newton viewer UI, allowing users to visualize body
inertia boxes at runtime.
@vidurv-nvidia vidurv-nvidia changed the title Add show collision mesh toggle to Newton viewer Add show collision and inertia visualization toggles to Newton viewer Apr 3, 2026
@vidurv-nvidia vidurv-nvidia changed the title Add show collision and inertia visualization toggles to Newton viewer Add collision, inertia, and visual geometry toggles to Newton viewer Apr 7, 2026
@kellyguo11
Copy link
Copy Markdown
Contributor

@matthewtrepte for viz

@kellyguo11
Copy link
Copy Markdown
Contributor

/bot can you re-review the latest and clear the request changes

@isaaclab-review-bot
Copy link
Copy Markdown

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!

@vidurv-nvidia
Copy link
Copy Markdown
Author

vidurv-nvidia commented Apr 9, 2026

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

@isaaclab-review-bot isaaclab-review-bot bot dismissed their stale review April 9, 2026 18:46

Dismissing stale review — the duplicate field declarations flagged previously have been resolved in the latest commits. The cfg and visualizer files are now clean.

Copy link
Copy Markdown

@isaaclab-review-bot isaaclab-review-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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 and initialize() 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. 👍

@kellyguo11 kellyguo11 changed the title Add collision, inertia, and visual geometry toggles to Newton viewer Adds collision, inertia, and visual geometry toggles to Newton viewer Apr 9, 2026
@kellyguo11 kellyguo11 merged commit df77fe7 into isaac-sim:develop Apr 9, 2026
29 checks passed
mmichelis pushed a commit to mmichelis/IsaacLab that referenced this pull request Apr 10, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants