Repository navigation
Record the viewport video from a visualizer with Isaac Lab's VideoRecorder - #1808
Conversation
…order --record_viewport_video wrapped the env in Gymnasium's RecordVideo, but Isaac Lab 3.0's env.render() returns None for render_mode="rgb_array". The policy runner and the Experiment Runner printed "Recording ... viewport video", wrote no MP4, and exited 0. Record with Isaac Lab's VideoRecorder instead, as Isaac Lab's own --video does. The recorder captures frames from a visualizer: - Without --viz, add a headless Kit visualizer to the environment config before the environment is made. No window opens. - Under --viz none, which disables every visualizer, fail with a message that says to omit --viz or pass --viz kit. - Check up front that an active visualizer can capture frames. The recorder only logs a capture error and writes no clip. - Load the renderer at app launch for viewport recording, as --record_camera_video does. The environment still gets no cameras unless --enable_cameras is passed. The policy runner writes viewport_0000.mp4. The Experiment Runner writes viewport-rebuild<i>_0000.mp4 for each rebuild. The OSMO Experiment Runner task omits --viz none when it records the viewport. The review GUI's sim preview no longer reads the removed VideoRecordingCfg.render_mode. Add unit tests for the visualizer and recorder setup, and subprocess tests that check the policy runner writes a rendered MP4, rejects --viz none, and that each Experiment Runner rebuild writes its own viewport MP4. Update the inspect-sim-visually and run-experiment skills and the v0.4 migration guide. Signed-off-by: Xinjie Yao <[email protected]>
Confidence Score: 4/5
[Medium impact] The changes affect viewport recording in several bounded rollout workflows. The PR appears safe to merge, with a non-blocking correction needed for simulation timing. Findings
SummaryReplaces Gymnasium viewport recording with Isaac Lab's
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Viewport recording requested] --> B{Visualizer choice}
B -->|none| C[Fail with clear message]
B -->|Not specified| D[Add headless Kit visualizer]
B -->|Explicit choice| E[Keep requested visualizers]
D --> F[Build environment]
E --> F
F --> G[Check frame capture support]
G --> H[Attach VideoRecorder]
H --> I[Record during environment steps]
I --> J[Write clip at length limit or close]
Reviews (1) · Last reviewed commit: "Record the viewport video from a visuali..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR fixes
The comments below are small improvements. Design, Boundaries & ScopeIsaac Lab's own Findings🔵 Improvement: 🔵 Improvement: 🔵 Improvement: 🔵 Improvement: 🔵 Improvement: Possible follow-up outside this diff: after this change, no production code passes Test Coverage and CI Cost
VerdictShip it |
Signed-off-by: Xinjie Yao <[email protected]>
Number the steps in add_viewport_visualizer and _add_viewport_video_recorder, and note where they follow Isaac Lab's --video setup and where they differ. Signed-off-by: Xinjie Yao <[email protected]>
The policy runner, the Experiment Runner and the review GUI's sim preview each added the viewport visualizer to the environment config and then made the environment. make_registered_env_for_video does both, so the visualizer is always added before the simulation creates its visualizers. add_viewport_visualizer is now private. Signed-off-by: Xinjie Yao <[email protected]>
Check for viewport recording in the helper itself, so without it the helper is plain make_registered: camera recording needs no visualizer. _add_viewport_visualizer now only chooses whether to add the headless Kit visualizer. Add a test that the helper adds no visualizer when only cameras, or nothing, is recorded. Signed-off-by: Xinjie Yao <[email protected]>
- Reject --record_viewport_video with --viz none in both runners before Isaac Sim starts. The policy runner test now runs in-process, and the Experiment Runner has a matching test. - Validate the recorder config with VideoRecorderCfg.validate_config(), as the environment does for recorders declared on its config. - Note that sim_step includes viewport frame capture, because Isaac Lab's recorder runs inside env.step(). - Check that each Experiment Runner rebuild's video has rendered frames. - Import imageio and numpy at the top of the test files. Signed-off-by: Xinjie Yao <[email protected]>
…ions The bullet above it already covers capturing the default view, and the skill's pitfall table covers env.render() returning no image. Signed-off-by: Xinjie Yao <[email protected]>
…e viewport Replace make_registered_env_with_viewport_visualizer with separate steps, so making the environment stays the builder's generic make_registered. The policy runner and the Experiment Runner call add_viewport_visualizer only when they record the viewport; camera recording needs none. The review GUI's sim preview always records the viewport, so it always adds one. The call-site test now also covers camera-only recording. Signed-off-by: Xinjie Yao <[email protected]>
Both runners reject --viz none before Isaac Sim starts, and the recorder setup fails when no visualizer can capture frames, so drop the second --viz none check. SimulationCfg.visualizer_cfgs defaults to an empty list, so skip when --viz picks the visualizers or the config declares any, and otherwise set a headless Kit visualizer. Leave the reason the old recorder captured nothing to the pull request description. Signed-off-by: Xinjie Yao <[email protected]>
…kill The skill now names only what records the viewport: --record_viewport_video and how to run it with a visualizer. Remove the env.render() trigger from its description and the env.render() row from its pitfall table. Signed-off-by: Xinjie Yao <[email protected]>
The --viz none check before launch and the frame-capture check after the environment is made catch different cases, so both stay. They now share the advice to omit --viz or pass --viz kit, and the capture check is a single any() assert. Signed-off-by: Xinjie Yao <[email protected]>
peterd-NV
left a comment
There was a problem hiding this comment.
One non blocking comment
…ab's VideoRecorder (#1808) (#1812) Cherry-pick #1808 into `release/0.4.0`, so `--record_viewport_video` writes a viewport video on the release branch. --------- Signed-off-by: Xinjie Yao <[email protected]>
Fix
--record_viewport_video, which wrote no video, by recording with Isaac Lab'sVideoRecorder.Why this change?
--record_viewport_videoused Gymnasium'sRecordVideo, which captures frames fromenv.render(). Isaac Lab 3.0 no longer rendersrender_mode="rgb_array"frames, andenv.render()returnsNone. So both runners printed "Recording ... viewport video", wrote nothing, and exited 0.What changes?
VideoRecorder, and add a headless Kit visualizer when--vizis omitted.--viz none, which disables all visualizers. The OSMO task no longer passes--viz nonewhen it records the viewport.Validation
policy_runner.py --policy_type zero_action --num_steps 30 cube_goal_pose:--record_viewport_videowrote no MP4, with or without--viz kit, and exited 0.--viz, it writesviewport_0000.mp4: 30 frames at 1280x720, showing the Franka, the table, and the cube.--viz none, it exits 1 within 2 s, before Isaac Sim starts, with the new message and no MP4.--viz noneerror.