Skip to content

Cherry-pick: Record the viewport video from a visualizer with Isaac Lab's VideoRecorder (#1808) - #1812

Merged
xyao-nv merged 9 commits into
release/0.4.0from
xyao/cp/1808/release/0.4.0
Dec 2, 2026
Merged

xyao-nv merged 9 commits into
release/0.4.0from
xyao/cp/1808/release/0.4.0

Conversation

@xyao-nv

@xyao-nv xyao-nv commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Cherry-pick #1808 into release/0.4.0, so --record_viewport_video writes a viewport video on the release branch.

…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)
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)
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable defect was established.

Summary

Replaces Gymnasium viewport recording with Isaac Lab’s VideoRecorder.

  • Policy and experiment runs save viewport clips from visualizers.

xyao-nv explicitly deferred the missing-MP4 check to #1811; it is not reported here.

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

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR cherry-picks #1808 into release/0.4.0. With it, --record_viewport_video records the viewport from a visualizer with Isaac Lab's VideoRecorder. The old path used Gymnasium's RecordVideo, which wrote nothing under Isaac Lab 3.0. I compared each file's patch with #1808. They match except for the dropped inspect-sim-visually skill files and the two conflict resolutions listed in the description. The release branch also pins the same Isaac Lab commit (e3f7d9f). The changes made in response to the review of #1808 are already part of this pick, so I have no new inline findings.

Findings

🔵 PR description: #1808 was merged at 560b0a9cb2, and that is the commit this PR's last pick comes from. The note saying #1808 "is still open" and that later changes will be picked here can be removed.

🔵 Missing-MP4 check (#1811): The case raised in the review of #1808 still applies on this branch. If render_rgb_array() returns None during the rollout, or the clip fails to write, Isaac Lab's VideoRecorder only logs the error (_get_frame / _close_clip). The run then exits 0 without a viewport MP4. This PR is still a clear improvement over the current release behavior, which never writes a video. Should #1811 also be picked to release/0.4.0 once it merges, so the release doesn't ship with this gap?

🔵 Improvement: isaaclab_arena/video/camera_observation_video_recorder.py:15 (outside the diff): the module docstring still says policy_runner.py wraps the env "alongside RecordVideo". That stopped being true with #1808, and main has the same stale text. Could it be fixed on main and picked with the next batch?

Test Coverage and CI Cost

When 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.

Verdict

Ship it

@xyao-nv
xyao-nv merged commit f566b43 into release/0.4.0 Dec 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants