Skip to content

Commit

Permalink
Fix default camera. #12
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 716263867
Change-Id: Ie718c0e65f6e9ebef84d84d18004411953e80acd
  • Loading branch information
btaba authored and copybara-github committed Jan 16, 2025
1 parent a0ffd17 commit 522e133
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion learning/train_rsl_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
_MULTI_GPU = flags.DEFINE_boolean(
"multi_gpu", False, "If true, use multi-GPU training (distributed)."
)
_CAMERA = flags.DEFINE_string(
"camera", None, "Camera name to use for rendering."
)


def get_rl_config(env_name: str) -> config_dict.ConfigDict:
Expand Down Expand Up @@ -228,7 +231,8 @@ def render_callback(env, state):
fps = 1.0 / base_env.dt / render_every
traj = rollout[::render_every]
frames = eval_env.render(
traj, camera="track", height=480, width=640, scene_option=scene_option
traj, camera=_CAMERA.value, height=480, width=640,
scene_option=scene_option
)
media.write_video("rollout.mp4", frames, fps=fps)
print("Rollout video saved as 'rollout.mp4'.")
Expand Down

0 comments on commit 522e133

Please sign in to comment.