Skip to content

fix mujoco menagerie#968

Merged
spomichter merged 2 commits intodevfrom
fix-mujoco-menagerie
Jan 9, 2026
Merged

fix mujoco menagerie#968
spomichter merged 2 commits intodevfrom
fix-mujoco-menagerie

Conversation

@paul-nechifor
Copy link
Contributor

With the new version of playground you have to trigger downloading of the mujoco_menagerie yourself. It's not done automatically when the playground is imported.

@paul-nechifor paul-nechifor requested a review from a team January 9, 2026 01:31
spomichter
spomichter previously approved these changes Jan 9, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR fixes an issue where the new version of mujoco_playground no longer automatically downloads the mujoco_menagerie package on import. The fix explicitly calls mjx_env.ensure_menagerie_exists() during initialization to pre-download the menagerie before spawning the MuJoCo subprocess, preventing timeout issues.

Issues found:

  • Typo in comment: "mujoco_menajerie" should be "mujoco_menagerie"
  • Missing error handling around the new ensure_menagerie_exists() call (could fail due to network issues, missing package, etc.)
  • Using private API (_src module) which could be fragile if the library changes its internal structure

Confidence Score: 4/5

  • This PR is safe to merge with minor improvements recommended
  • The change correctly addresses the issue with the new mujoco_playground version. The logic is sound - downloading the menagerie before spawning the subprocess prevents timeouts. However, there's a typo in the comment and missing error handling that should be addressed for robustness
  • The single changed file has minor issues (typo and missing error handling) but the core logic is correct

Important Files Changed

File Analysis

Filename Score Overview
dimos/robot/unitree_webrtc/mujoco_connection.py 4/5 Updates menagerie download trigger to use explicit function call. Found typo in comment and missing error handling

Sequence Diagram

sequenceDiagram
    participant User
    participant MujocoConnection
    participant mjx_env
    participant subprocess
    participant mujoco_process
    participant model_py
    
    User->>MujocoConnection: __init__(global_config)
    MujocoConnection->>MujocoConnection: import mujoco (check)
    MujocoConnection->>MujocoConnection: get_data("mujoco_sim")
    Note over MujocoConnection,mjx_env: NEW: Explicit menagerie download
    MujocoConnection->>mjx_env: ensure_menagerie_exists()
    mjx_env-->>MujocoConnection: menagerie downloaded
    
    User->>MujocoConnection: start()
    MujocoConnection->>subprocess: spawn mujoco_process.py
    subprocess->>mujoco_process: __main__
    mujoco_process->>model_py: load_model()
    Note over model_py,mjx_env: Uses MENAGERIE_PATH (already downloaded)
    model_py->>mjx_env: MENAGERIE_PATH / "unitree_go1"
    mjx_env-->>model_py: path returned
    model_py-->>mujoco_process: model loaded
    mujoco_process-->>MujocoConnection: ready signal via shared memory
Loading

@spomichter spomichter merged commit b7a37d0 into dev Jan 9, 2026
@spomichter spomichter deleted the fix-mujoco-menagerie branch January 9, 2026 03:08
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.

2 participants