-
Notifications
You must be signed in to change notification settings - Fork 5
Add basic window control for interactive simulation #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
SimulationManagerwith 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_controlflag is not reset inclose_window(). This could lead to inconsistent state if a user callsclose_window()and thenopen_window()again - the controls won't be re-registered because the flag remains True. Consider resetting_is_registered_window_controlto False in theclose_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.
Description
This PR introduces the window control, including:
Type of change
Checklist
black .command to format the code base.