Skip to content

Add viser recording functionality #404

@ttktjmt

Description

@ttktjmt

Motivation

I'd like to propose adding interactive recording and replay functionality for mjlab. This would enable:

  • Sharing RL experiment results - Researchers can easily share trained policy behaviors with others
  • Debugging without re-running - Replay expensive simulations without recomputing
  • Creating demonstrations - Generate interactive visualizations for papers, presentations, and documentation
  • Collaboration - Share exact simulation runs with team members

Implementation

I've implemented this feature in the record branch on my fork:

Changes

New record module:

  • src/mjlab/scripts/record.py: Initializes the viser recording server and handles the MuJoCo simulation loop
  • pyproject.toml: Registers the new uv run record CLI command entry point

GitHub Actions Workflow:

  • .github/workflows/deploy-recordings.yml: Automatically deploys recorded .viser files from the recordings/ directory to GitHub Pages

Example Recordings:

  • recordings/*.viser: Initial example recordings demonstrating functionality for registered environments

Usage Example

uv run record Mjlab-Velocity-Rough-Unitree-Go1 \
  --wandb-run-path your-entity/mjlab/run-id \
  --num-envs 12 \
  --num-steps 1000

Demo

Live example: https://ttktjmt.github.io/mjlab/rec/

Questions for Maintainers

Before I create a PR, I'd like to check if this feature is valuable for mjlab or not. If you are willing to include this, I'd love to create a PR!
I'm also happy to make any adjustments based on your feedback before submitting a PR.

Thanks for reviewing and considering this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions