Migrate viewport recording to Isaac Lab - #1221
Conversation
Signed-off-by: Qian Lin <qianl@nvidia.com>
| num_episodes: Unused; retained for call-site compatibility. | ||
| """ | ||
| if not video_cfg.enabled: | ||
| if not video_cfg.record_camera_video: |
There was a problem hiding this comment.
🔴 This breaks the sim-preview viewport recording
isaaclab_arena_examples/agentic_environment_generation/review_gui/simapp/sim_preview.py still calls builder.make_registered(..., render_mode=video_cfg.render_mode) (line 143) and then relies on wrap_env_for_video to record the viewport (line 146). With VideoRecordingCfg.render_mode deleted that first call is an AttributeError, and even past it wrap_env_for_video now returns the env untouched, so the expected one viewport video, found 0 check at line 155 would fire. It's a live path (simapp/server.py dispatches run_sim_preview). Could it be switched over to configure_env_for_video(env_cfg, video_cfg, num_steps, None) before make_registered too?
| VideoRecorderCfg( | ||
| source="visualizer:kit", | ||
| output_dir=video_cfg.video_base_dir, | ||
| output_filename_prefix="viewport", |
There was a problem hiding this comment.
🟡 Rebuilds overwrite each other's viewport video
The prefix is fixed, and Isaac Lab's recorder restarts its clip index at 0 for each new env (_clip_path → <prefix>_0000.mp4). In build_and_run every rebuild writes into the same output_dir, so rebuild 1's viewport_0000.mp4 silently replaces rebuild 0's. camera_name_prefix already dodges this with a per-rebuild suffix — could the viewport prefix do the same, e.g. a viewport_name_prefix field on VideoRecordingCfg set alongside camera_name_prefix?
| output_filename_prefix="viewport", | |
| output_filename_prefix=video_cfg.viewport_name_prefix, |
| num_steps: Step budget for the rollout, or ``None`` when episode-driven. | ||
| num_episodes: Episode budget for the rollout, or ``None`` when step-driven. | ||
| num_steps: Unused; retained for call-site compatibility. | ||
| num_episodes: Unused; retained for call-site compatibility. |
There was a problem hiding this comment.
🔵 Leftovers from the old viewport path
Three bits are dead now: these two parameters (all three call sites are in-repo, so they can just be dropped), the VideoRecordingCfg.enabled property (no remaining users), and the inner if video_cfg.record_camera_video: at line 108, which is always true after the guard on line 101. Worth deleting all three so the function reads as what it is — the camera recorder wrapper.
| args_cli.enable_cameras = True | ||
|
|
||
| # Build scene. Use rgb_array render mode when recording so RecordVideo can grab frames. | ||
| # Build the policy before the environment so its intrinsic length can configure native video recording. |
There was a problem hiding this comment.
🔵 Comment doesn't match the line below it
This line builds the arena builder, not the policy — the policy is built at line 220. The ordering the comment describes belongs up by that call.
| # Build the policy before the environment so its intrinsic length can configure native video recording. | |
| # Build the arena builder; the environment itself is created after the rollout length is known. |
🤖 Isaac Lab-Arena Review BotSummarySwaps the gymnasium Design, Boundaries & ScopeViewport recording used to be a single call ( Findings🔴 Critical: 🟡 Warning: 🔵 Improvement: 🔵 Improvement: 🔵 Improvement: Test Coverage
VerdictMinor fixes needed |
Summary
Fix viewport video recording
Detailed description
rgb_array/Gymnasium recording path with Isaac Lab's native Kit visualizer recorder