Skip to content

Commit 82e14f9

Browse files
committed
Add show inertia boxes toggle to Newton viewer
Add show_inertia_boxes option to NewtonVisualizerCfg and corresponding checkbox in the Newton viewer UI, allowing users to visualize body inertia boxes at runtime.
1 parent 2ec08d9 commit 82e14f9

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ def _render_left_panel(self):
196196
show_springs = self.show_springs
197197
changed, self.show_springs = imgui.checkbox("Show Springs", show_springs)
198198

199+
show_inertia_boxes = self.show_inertia_boxes
200+
changed, self.show_inertia_boxes = imgui.checkbox("Show Inertia Boxes", show_inertia_boxes)
201+
199202
show_com = self.show_com
200203
changed, self.show_com = imgui.checkbox("Show Center of Mass", show_com)
201204

@@ -321,6 +324,7 @@ def initialize(self, scene_data_provider: BaseSceneDataProvider) -> None:
321324
self._viewer.show_contacts = self.cfg.show_contacts
322325
self._viewer.show_collision = self.cfg.show_collision
323326
self._viewer.show_springs = self.cfg.show_springs
327+
self._viewer.show_inertia_boxes = self.cfg.show_inertia_boxes
324328
self._viewer.show_com = self.cfg.show_com
325329

326330
self._viewer.renderer.draw_shadows = self.cfg.enable_shadows

source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class NewtonVisualizerCfg(VisualizerCfg):
4646
show_springs: bool = False
4747
"""Show spring visualization."""
4848

49+
show_inertia_boxes: bool = False
50+
"""Show inertia box visualization."""
51+
4952
show_com: bool = False
5053
"""Show center of mass visualization."""
5154

0 commit comments

Comments
 (0)