Skip to content

Commit 32f64ee

Browse files
Tune quickstart capture framing and downsampling for documentation media
The quickstart GIFs rendered the OVRTX path tracer straight to their 320x240 publication size, so robot silhouettes and shadow edges aliased badly, and the per-task focal lengths left the subject occupying a small part of the frame with a large empty floor area around it. Capture at 1280x960 and let the generator downsample with lanczos, which resolves the detail that rendering directly to the final size destroyed. Tighten the focal lengths per task to the largest value that keeps the subject inside the published crop. The safe value is scene-specific rather than a fixed ratio: Cartpole clips its pole above 21, and Kuka Allegro is held at 24 because its lift policy raises the arm above the pose a zero action holds. Ease the denoiser from 2:2:6:6 to 1:1:3:3 now that supersampling rather than blurring removes the path-tracer noise, and widen the GIF palette from 128 to 256 colors with sierra2_4a dithering to avoid banding on the smoother gradients.
1 parent 9adf483 commit 32f64ee

2 files changed

Lines changed: 27 additions & 18 deletions

File tree

tools/docs/media/capture_quickstart.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from isaaclab_tasks.core.velocity.config.g1.flat_env_cfg import G1FlatEnvCfg
3030
from isaaclab_tasks.utils import resolve_task_config, setup_preset_cli
3131

32+
# Focal lengths are tuned per task to the tightest framing that still keeps the subject inside the
33+
# published crop; the safe value differs per scene, so they are not a fixed ratio of one another.
3234
_TASK_CONFIGS = {
3335
"Isaac-Cartpole": "capture_quickstart:CartpoleCaptureCfg",
3436
"Isaac-Lift-KukaAllegro": "capture_quickstart:KukaAllegroCaptureCfg",
@@ -43,7 +45,7 @@ class CartpoleCaptureCfg(CartpoleEnvCfg):
4345

4446
def __post_init__(self):
4547
super().__post_init__()
46-
_configure_capture(self, focal_length=18.0)
48+
_configure_capture(self, focal_length=21.0)
4749

4850

4951
@configclass
@@ -52,7 +54,7 @@ class G1FlatCaptureCfg(G1FlatEnvCfg):
5254

5355
def __post_init__(self):
5456
super().__post_init__()
55-
_configure_capture(self, focal_length=20.0)
57+
_configure_capture(self, focal_length=29.0)
5658

5759

5860
@configclass
@@ -61,7 +63,9 @@ class KukaAllegroCaptureCfg(KukaAllegroLiftEnvCfg):
6163

6264
def __post_init__(self):
6365
super().__post_init__()
64-
_configure_capture(self, focal_length=22.0)
66+
# Held to 24 rather than the tighter framing the other tasks take: the lift policy raises
67+
# the arm well above the pose a zero action holds, and 26 already leaves little headroom.
68+
_configure_capture(self, focal_length=24.0)
6569

6670

6771
@configclass
@@ -70,7 +74,7 @@ class FrankaCabinetCaptureCfg(FrankaCabinetEnvCfg):
7074

7175
def __post_init__(self):
7276
super().__post_init__()
73-
_configure_capture(self, focal_length=22.0)
77+
_configure_capture(self, focal_length=32.0)
7478

7579

7680
def configure_playback() -> list[str]:
@@ -97,7 +101,7 @@ def main():
97101
env_cfg, _ = resolve_task_config(args.task, "", play_mode=True)
98102
env_cfg.scene.num_envs = 1
99103
env_cfg.seed = 42
100-
_configure_resolved_sim(env_cfg.sim, focal_length=22.0)
104+
_configure_resolved_sim(env_cfg.sim, focal_length=32.0)
101105
env_cfg.video_recorders = [
102106
VideoRecorderCfg(
103107
source="visualizer:newton_rtx",
@@ -144,15 +148,20 @@ def _configure_capture(env_cfg: object, focal_length: float):
144148

145149

146150
def _configure_resolved_sim(sim_cfg: SimulationCfg, focal_length: float):
147-
"""Attach a headless 320 by 240 OVRTX visualizer to a simulation config."""
151+
"""Attach a headless 1280 by 960 OVRTX visualizer to a simulation config.
152+
153+
Captures at four times the 320 by 240 publication size so the generator can downsample the
154+
path-traced frames, which resolves robot silhouettes and shadow edges that alias away when
155+
the path tracer renders straight to the final size.
156+
"""
148157
default_camera = sim_cfg.default_visualizer_cfg or VisualizerCfg()
149158
sim_cfg.visualizer_cfgs = [
150159
NewtonRTXVisualizerCfg(
151160
eye=default_camera.eye,
152161
lookat=default_camera.lookat,
153162
focal_length=focal_length,
154-
window_width=320,
155-
window_height=240,
163+
window_width=1280,
164+
window_height=960,
156165
headless=True,
157166
rtx_environment="default",
158167
render_settings={"omni:rtx:quality": ("Int", 100)},

tools/docs/media/generate_quickstart.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,25 @@ ffmpeg -y -v error \
7575
-i "${WORK_DIR}/random/random_0000.mp4" \
7676
-i "${WORK_DIR}/play/play_0000.mp4" \
7777
-filter_complex \
78-
"[0:v]select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=112:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='zero_agent':fontcolor=white:fontsize=16:x=16:y=13[zero];
79-
[1:v]select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=134:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='random_agent':fontcolor=white:fontsize=16:x=16:y=13[random];
80-
[2:v]select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=58:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='play':fontcolor=white:fontsize=16:x=16:y=13[play];
78+
"[0:v]select='not(mod(n,5))',setpts=N/(12*TB),scale=320:240:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=112:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='zero_agent':fontcolor=white:fontsize=16:x=16:y=13[zero];
79+
[1:v]select='not(mod(n,5))',setpts=N/(12*TB),scale=320:240:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=134:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='random_agent':fontcolor=white:fontsize=16:x=16:y=13[random];
80+
[2:v]select='not(mod(n,5))',setpts=N/(12*TB),scale=320:240:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=58:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='play':fontcolor=white:fontsize=16:x=16:y=13[play];
8181
[zero][random][play]hstack=inputs=3,split[frames][palette_frames];
82-
[palette_frames]palettegen=max_colors=128:stats_mode=diff[palette];
83-
[frames][palette]paletteuse=dither=bayer:bayer_scale=4:diff_mode=rectangle" \
82+
[palette_frames]palettegen=max_colors=256:stats_mode=diff[palette];
83+
[frames][palette]paletteuse=dither=sierra2_4a:diff_mode=rectangle" \
8484
-loop 0 "${OUTPUT_DIR}/agent-comparison.gif"
8585

8686
ffmpeg -y -v error \
8787
-i "${WORK_DIR}/cartpole/cartpole_0000.mp4" \
8888
-i "${WORK_DIR}/g1/g1_0000.mp4" \
8989
-i "${WORK_DIR}/kuka_allegro/kuka_allegro_0000.mp4" \
9090
-filter_complex \
91-
"[0:v]crop=320:180:0:30,select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=82:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='Cartpole':fontcolor=white:fontsize=16:x=16:y=13[cartpole];
92-
[1:v]crop=320:180:0:30,select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=128:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='G1 locomotion':fontcolor=white:fontsize=16:x=16:y=13[g1];
93-
[2:v]crop=320:180:0:30,select='not(mod(n,5))',setpts=N/(12*TB),hqdn3d=2:2:6:6,drawbox=x=8:y=8:w=116:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='Kuka Allegro':fontcolor=white:fontsize=16:x=16:y=13[kuka];
91+
"[0:v]crop=1280:720:0:120,select='not(mod(n,5))',setpts=N/(12*TB),scale=320:180:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=82:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='Cartpole':fontcolor=white:fontsize=16:x=16:y=13[cartpole];
92+
[1:v]crop=1280:720:0:120,select='not(mod(n,5))',setpts=N/(12*TB),scale=320:180:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=128:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='G1 locomotion':fontcolor=white:fontsize=16:x=16:y=13[g1];
93+
[2:v]crop=1280:720:0:120,select='not(mod(n,5))',setpts=N/(12*TB),scale=320:180:flags=lanczos,hqdn3d=1:1:3:3,drawbox=x=8:y=8:w=116:h=28:color=black@0.65:t=fill,drawtext=font='DejaVu Sans':text='Kuka Allegro':fontcolor=white:fontsize=16:x=16:y=13[kuka];
9494
[cartpole][g1][kuka]hstack=inputs=3,split[frames][palette_frames];
95-
[palette_frames]palettegen=max_colors=128:stats_mode=diff[palette];
96-
[frames][palette]paletteuse=dither=bayer:bayer_scale=4:diff_mode=rectangle" \
95+
[palette_frames]palettegen=max_colors=256:stats_mode=diff[palette];
96+
[frames][palette]paletteuse=dither=sierra2_4a:diff_mode=rectangle" \
9797
-loop 0 "${OUTPUT_DIR}/task-sampler.gif"
9898

9999
for output in agent-comparison.gif task-sampler.gif; do

0 commit comments

Comments
 (0)