Skip to content

Conversation

@ttktjmt
Copy link
Owner

@ttktjmt ttktjmt commented Dec 8, 2025

No description provided.

claude and others added 7 commits December 7, 2025 17:49
- Created src/mjlab/scripts/record.py as a unified recording script
- Supports both local checkpoint files and WandB checkpoints
- Auto-detects appropriate runner class based on task
- Handles motion files for tracking tasks automatically
- Added script entry point to pyproject.toml
- Auto-generates output names from task IDs when not specified

Usage examples:
  uv run record Mjlab-Velocity-Flat-Unitree-G1 --wandb-run-path org/project/run-id --name rec1
  uv run record Mjlab-Cartpole --checkpoint-file logs/model.pt --num-envs 4 --name rec2

The new script consolidates the patterns from record_demo.py and
record_velocity.py into a single, task-agnostic recording tool.
Changes:
- Use same dataclass(frozen=True) pattern as play.py
- Split into run_record() and main() functions for consistency
- Identical checkpoint loading logic (checkpoint_file + wandb_run_path)
- Same motion file handling for tracking tasks
- Same two-stage CLI parsing (task selection then config)
- Use [INFO] logging format like play.py
- Add share URL support from viser best practices
- Set initial camera pose for better default view
- Use clip_actions from agent_cfg like play.py
- Proper env.close() cleanup

Recording-specific features:
- output_dir, output_name for file generation
- num_steps, frame_skip, sleep_duration for recording control
- Auto-generate output names from task IDs

This provides the same familiar interface as play.py while adding
recording capabilities for static webpage embedding.
@ttktjmt ttktjmt self-assigned this Dec 8, 2025
@ttktjmt ttktjmt merged commit 82959e0 into main Dec 8, 2025
5 of 9 checks passed
@ttktjmt ttktjmt deleted the claude/generalize-record-scripts-01Le9JR9nU7MagpzHNWuSu6o branch December 10, 2025 01:06
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.

4 participants