Skip to content

Add headless support to SimulationManager recording#320

Open
yuecideng wants to merge 3 commits into
mainfrom
enhance/headless-window-recording
Open

Add headless support to SimulationManager recording#320
yuecideng wants to merge 3 commits into
mainfrom
enhance/headless-window-recording

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR adds headless support to SimulationManager.start_window_record() and updates the create_scene.py tutorial to use the shared recording path when running without a window.

It also updates the create_scene documentation to describe the new recording flow and CLI options.

Dependencies: None

Fixes N/A

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

  • Headless tutorial run verified with python scripts/tutorials/sim/create_scene.py --headless
  • Output video verified at outputs/videos/create_scene_headless_2026-06-22-16-58-36.mp4

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.

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.
Copilot AI review requested due to automatic review settings June 22, 2026 09:20
@yuecideng yuecideng added enhancement New feature or request visualization Features or functions for visualization with the simulation docs Improvements or additions to documentation labels Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 from SimulationManager.update().
  • Update scripts/tutorials/sim/create_scene.py to enable recording in headless mode and to stop/wait for video export before cleanup.
  • Update docs/source/tutorial/create_scene.rst to 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.

Comment thread embodichain/lab/sim/sim_manager.py Outdated
Comment thread embodichain/lab/sim/sim_manager.py
Comment thread embodichain/lab/sim/sim_manager.py Outdated
Comment thread embodichain/lab/sim/sim_manager.py
Comment thread embodichain/lab/sim/sim_manager.py
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.
Copilot AI review requested due to automatic review settings June 22, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation enhancement New feature or request visualization Features or functions for visualization with the simulation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants