Repository navigation
Cherry-pick: Record the viewport video from a visualizer with Isaac Lab's VideoRecorder (#1808) - #1812
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]> (cherry picked from commit 1695beb)
Signed-off-by: Xinjie Yao <[email protected]> (cherry picked from commit a2376ec)
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]> (cherry picked from commit 25c9d5e)
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]> (cherry picked from commit d6738c1)
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]> (cherry picked from commit 96b1725)
- 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]> (cherry picked from commit b19827c)
…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]> (cherry picked from commit 727d34b)
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]> (cherry picked from commit c22904b)
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]> (cherry picked from commit 560b0a9)
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable defect was established. SummaryReplaces Gymnasium viewport recording with Isaac Lab’s
Review was source-only. The pinned Isaac Lab checkout was unavailable, so recorder defaults and runtime behavior were not independently verified. Reviews (1) · Last reviewed commit: "Share the visualizer hint between the vi..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR cherry-picks #1808 into Findings🔵 PR description: #1808 was merged at 🔵 Missing-MP4 check (#1811): The case raised in the review of #1808 still applies on this branch. If 🔵 Improvement: Test Coverage and CI CostWhen I reviewed, only pre-commit had finished. "Build and push Arena image" was still queued, so I couldn't confirm that the three test phases pass on the release branch. VerdictShip it |
Cherry-pick #1808 into
release/0.4.0, so--record_viewport_videowrites a viewport video on the release branch.