Skip to content

Conversation

@yuecideng
Copy link
Contributor

@yuecideng yuecideng commented Jan 21, 2026

Description

This PR introduces the window control, including:

  • Add basic event for showing ray cast infomation
  • Add docs for showing how to customize the window control

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

@yuecideng yuecideng requested a review from Copilot January 21, 2026 13:06
@yuecideng yuecideng added the interaction The interaction simulation features label Jan 21, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds basic window control functionality for interactive simulation, enabling users to interact with the simulation environment through keyboard and mouse input. The main addition is a raycast information display feature that prints hit position and distance when pressing the 'C' key.

Changes:

  • Added window control infrastructure to SimulationManager with default event handling for raycast information display
  • Created documentation for window interaction features and customization guide
  • Registered new documentation section in the main documentation index

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
embodichain/lab/sim/sim_manager.py Added window control variables, methods for registering default and custom window controls, and integrated window initialization in both headless-to-window and standard initialization flows
docs/source/index.rst Added reference to new interaction features documentation section
docs/source/features/interaction/window.md Created comprehensive documentation explaining default window events and how to customize window controls with examples
docs/source/features/interaction/index.rst Created index page for interactive simulation module documentation
Comments suppressed due to low confidence (1)

embodichain/lab/sim/sim_manager.py:590

  • When the window is opened in headless mode initially but later opened via open_window(), the _is_registered_window_control flag is not reset in close_window(). This could lead to inconsistent state if a user calls close_window() and then open_window() again - the controls won't be re-registered because the flag remains True. Consider resetting _is_registered_window_control to False in the close_window() method, or handle the case where the window is closed and reopened.
    def close_window(self) -> None:
        """Close the simulation window."""
        self._world.close_window()
        self.is_window_opened = False

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interaction The interaction simulation features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants