Skip to content

multi_plan.ipynb is not functional #376

@ayskzldmr

Description

@ayskzldmr

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:

!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('<mujoco/>')
    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.

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?

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