Add headless support to SimulationManager recording#320
Open
yuecideng wants to merge 3 commits into
Open
Conversation
Generalize SimulationManager window recording to work without a live viewer, switch the create_scene tutorial to use the shared recorder path in headless mode, and document the new workflow.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends SimulationManager.start_window_record() to support headless execution (recording without an on-screen window) and updates the create_scene tutorial + documentation to use the shared recording path when --headless is enabled.
Changes:
- Add headless-capable recording options to
SimulationManager.start_window_record()(fixed pose / callback / look-at) and support sim-time-based capture fromSimulationManager.update(). - Update
scripts/tutorials/sim/create_scene.pyto enable recording in headless mode and to stop/wait for video export before cleanup. - Update
docs/source/tutorial/create_scene.rstto document the new headless recording flow and CLI flags.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
scripts/tutorials/sim/create_scene.py |
Adds CLI flags for headless recording and ensures recording is stopped/exported before cleanup. |
embodichain/lab/sim/sim_manager.py |
Adds pose resolution + sim-time capture path to window recorder and introduces wait_window_record_saves(). |
docs/source/tutorial/create_scene.rst |
Documents the headless recording behavior and the new CLI options. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback by validating recorder inputs, rejecting overlapping recording sessions, simplifying save-thread joins, and adding focused unit coverage for the headless recording path.
Comment on lines
+1816
to
+1823
| state.accumulated_sim_time += physics_dt | ||
| if state.accumulated_sim_time + 1e-9 < state.time_step: | ||
| return state.task_status | ||
|
|
||
| state.accumulated_sim_time = max( | ||
| 0.0, state.accumulated_sim_time - state.time_step | ||
| ) | ||
| return self._capture_window_record_frame(state) |
| sim.wait_window_record_saves() | ||
|
|
||
| # Clean up resources | ||
| sim.destroy() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds headless support to
SimulationManager.start_window_record()and updates thecreate_scene.pytutorial to use the shared recording path when running without a window.It also updates the
create_scenedocumentation to describe the new recording flow and CLI options.Dependencies: None
Fixes N/A
Type of change
Screenshots
python scripts/tutorials/sim/create_scene.py --headlessoutputs/videos/create_scene_headless_2026-06-22-16-58-36.mp4Checklist
black .command to format the code base.