Add show collision and inertia visualization toggles to Newton viewer#5161
Add show collision and inertia visualization toggles to Newton viewer#5161vidurv-nvidia wants to merge 6 commits intoisaac-sim:developfrom
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.
source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
Outdated
Show resolved
Hide resolved
…_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.
| """Show collision visualization.""" | ||
|
|
||
| show_springs: bool = False | ||
| """Show spring visualization.""" |
There was a problem hiding this comment.
🔴 Duplicates multiplied instead of being fixed. The new commit added a block with the correct ordering but kept all the original lines too. The file now has massive duplication:
show_joints— 2 declarationsshow_contacts— 3 declarationsshow_collision— 2 declarationsshow_springs— 2 declarations + orphaned docstring
The entire field section (lines 38–63) should be replaced with exactly:
| """Show spring visualization.""" | |
| 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.""" |
That is: each field declared exactly once, in the order matching the UI and initializer.
Add show_inertia_boxes option to NewtonVisualizerCfg and corresponding checkbox in the Newton viewer UI, allowing users to visualize body inertia boxes at runtime.
Description
Add visualization toggles for collision meshes and inertia boxes 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 runtimeBoth 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