Skip to content

[FEATURE] Add ImGui overlay for interactive joint control and visualization#2541

Draft
YilingQiao wants to merge 4 commits intoGenesis-Embodied-AI:mainfrom
YilingQiao:yiling/260313_imgui_only
Draft

[FEATURE] Add ImGui overlay for interactive joint control and visualization#2541
YilingQiao wants to merge 4 commits intoGenesis-Embodied-AI:mainfrom
YilingQiao:yiling/260313_imgui_only

Conversation

@YilingQiao
Copy link
Collaborator

@YilingQiao YilingQiao commented Mar 13, 2026

Description

ImGui Overlay (genesis/ext/pyrender/imgui_overlay.py):

  • ViewerPlugin-based ImGui overlay for the native pyrender viewer
  • Joint control panel with per-DOF sliders, quaternion groups, free joints
  • Entity vis mode switching (visual/collision/wireframe), contact viz toggle
  • Camera control, shadow/frame/frustum toggles, render flag overlays
  • Example: examples/gui/imgui_joint_control.py

Shared module (genesis/vis/scene_ops.py):

  • Extracted shared visualization helpers used by the overlay
  • refresh_visual_transforms, switch_entity_vis_mode, set_entity_wireframe
  • build_entity_joint_data with free/spherical joint handling

Rasterizer (genesis/vis/rasterizer.py):

  • Added hasattr guard for orthographic camera toggle (yfov check)
  • Added extra_render_flags support for normal/wireframe toggles

Tests:

  • tests/test_imgui_overlay.py: 5 tests covering imports, entity data, overlay
gui_test.mp4

Related Issue

Resolves Genesis-Embodied-AI/Genesis#

Motivation and Context

How Has This Been / Can This Be Tested?

Screenshots (if appropriate):

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@YilingQiao YilingQiao changed the title Add ImGui overlay for interactive joint control and visualization [FEATURE] Add ImGui overlay for interactive joint control and visualization Mar 13, 2026
ImGui Overlay (genesis/ext/pyrender/imgui_overlay.py):
- ViewerPlugin-based ImGui overlay for the native pyrender viewer
- Joint control panel with per-DOF sliders, quaternion groups, free joints
- Entity vis mode switching (visual/collision/wireframe), contact viz toggle
- Camera control, shadow/frame/frustum toggles, render flag overlays
- Example: examples/gui/imgui_joint_control.py

Shared module (genesis/vis/scene_ops.py):
- Extracted shared visualization helpers used by the overlay
- refresh_visual_transforms, switch_entity_vis_mode, set_entity_wireframe
- build_entity_joint_data with free/spherical joint handling

Tests:
- tests/test_imgui_overlay.py: 5 tests covering imports, entity data, overlay

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@YilingQiao YilingQiao force-pushed the yiling/260313_imgui_only branch from e202708 to 9f9eff8 Compare March 13, 2026 17:56
Copy link
Collaborator

@duburcqa duburcqa left a comment

Choose a reason for hiding this comment

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

Please add a new entrypoint 'gs play' or similar to expose this nice interactive viewer / playground directly to the user and installing genesis via pip.

…lay entrypoint, CI integration

- Reformat scene_ops.py docstrings to 120-char width and remove section comments
- Delete mock-based imgui overlay tests
- Add PYTEST_VERSION detection to imgui example for CI (5-frame exit)
- Add gui/**/*.py to CI example test discovery
- Add 'gs play' CLI entrypoint for interactive ImGui viewer with optional asset file
@YilingQiao YilingQiao marked this pull request as ready for review March 19, 2026 23:07
Replaces mock-based tests with a single integration test that builds
a real scene with Panda robot and verifies plugin state, should_step
logic, entity cache, and qpos updates.
Not part of the GUI feature scope.
"""Test ImGuiOverlayPlugin core logic: initial state, should_step(), _cache_entity_data()."""
from genesis.ext.pyrender.imgui_overlay import ImGuiOverlayPlugin

plugin = ImGuiOverlayPlugin()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is broken. It is not how pyrender plugins works.



@pytest.mark.required
def test_imgui_overlay_plugin(show_viewer):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test is not checking anything relevant. Remove it.

Comment on lines +66 to +67
plugin = ImGuiOverlayPlugin(rebuild_fn=rebuild_scene)
scene.viewer._pyrender_viewer.register_plugin(plugin)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not how plugins are being registered: scene.viewer.add_plugin

scene.build()

# Re-register plugin on new viewer
scene.viewer._pyrender_viewer.register_plugin(plugin)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not how plugins are being registered

Copy link
Collaborator

@duburcqa duburcqa left a comment

Choose a reason for hiding this comment

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

I cannot be merged without at least one screenshot-based "unit test" (actually integration test) based on playwright.

@duburcqa duburcqa marked this pull request as draft March 23, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants