ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.24k stars 397 forks source link

why is the world.get_model(mode="mujoco_py") call not working #164

Closed quinnliu closed 3 years ago

quinnliu commented 3 years ago

I looked through the code in robosuite/models/base.py", line 130

I'm confused as to why the sphere example code is stuck here:

My goal is to create 12 bricks for the arm to stack on top of each other into a wall. Any advice would be appreciated.

sphere = BallObject(
    name="sphere",
    size=[0.04],
    rgba=[0, 0.5, 0.5, 1]).get_obj()
sphere.append(new_joint(name='sphere_free_joint', type='free'))
sphere.set('pos', '1.0 0 1.0')
world.worldbody.append(sphere)

model = world.get_model(mode="mujoco_py")

error message:

  File "build_wall.py", line 71, in <module>
    model = world.get_model(mode="mujoco_py")
  File "/Users/qliu/Documents/agihome.com/robosuite_env/lib/python3.7/site-packages/robosuite/models/base.py", line 130, in get_model
    model = load_model_from_xml(string.getvalue())
  File "mujoco_py/cymj.pyx", line 191, in mujoco_py.cymj.load_model_from_xml
Exception: <mujoco model="base">
  <compiler angle="radian" inertiagrouprange="0 0" meshdir="meshes/" />
  <option cone="elliptic" impratio="20" />
  <size nconmax="5000" njmax="5000" />
cremebrule commented 3 years ago

I'm not entirely sure -- that error message is cryptic. One bug I noticed is that you try to attach another free joint to the sphere -- however, there's already a free joint that is enabled by default. Can you remove that line and try running the code again?

quinnliu commented 3 years ago

@cremebrule Thanks your right about the sphere.append()