google-deepmind / google-deepmind/mujoco_mpc

multi_plan.ipynb is not functional

Open
#376 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am using macbook air m2 and I want to test multi_plan.ipynb.
https://github.com/google-deepmind/mujoco_mpc/blob/main/python/mujoco_mpc/mjx/multi_plan.ipynb

I have managed to make it work with following changes:

```python
!pip install cmake numpy matplotlib mediapy wheel jax-metal brax mujoco

# Remove Colab-specific GPU setup
# Configure MuJoCo for macOS rendering (use 'glfw' instead of 'egl')
import os

os.environ['MUJOCO_GL'] = 'glfw'
os.environ['JAX_PLATFORM_NAME'] = 'cpu'

# Check installation
try:
import mujoco

mujoco.MjModel.from_xml_string('')
print("MuJoCo installation verified")
except Exception as e:
raise RuntimeError("MuJoCo installation failed") from e

from IPython.display import clear_output
clear_output()
print("mujoco_mpc.mjx isn't installed yet -- please make sure you install it and fetch the task files from the MuJoCo Menagerie GitHub repository.")

# Required imports
from brax import base as brax_base
from IPython.display import HTML
import jax
import matplotlib.pyplot as plt
from mujoco import mjx
import predictive_sampling
import tasks.insert as insert
import numpy as np

# macOS-specific configuration

print("Using MuJoCo rendering backend: glfw (CPU rendering)")
```

However the code gives error when "insert.get_models_and_cost_fn()" is called because **mjx_insert_cube.xml** isn't exist.
```python
sim_model_cpu, plan_model_cpu, cost_fn, instruction_fn = insert.get_models_and_cost_fn()
```
at line 81 int the https://github.com/google-deepmind/mujoco_mpc/blob/main/python/mujoco_mpc/mjx/tasks/insert.py

The work you have done is extremely valuable and I want to learn and experiment it.

Is it possible for you to provide a working copy?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.