Skip to content

Questions about "The first tutorial focuses on the basic MuJoCo Python bindings" in "Getting Started" #322

@miyukin73

Description

@miyukin73

Hello,

I would like to simulate the attached XML file (mug-xml_obj.zip) in MuJoCo using Python (dm_control).

So I was trying "The first tutorial focuses on the basic MuJoCo Python bindings" in "Getting Started",
which you summarized in an easy to understand way.

However, when I run the following program, MuJoCo does not start up, although there is no error.

static_model = '/home/user/anaconda3/envs/robot/mug.xml'"""
<mujoco>
  <worldbody>
    <light name="top" pos="0 0 1"/>
    <geom name="red_box" type="box" size=".2 .2 .2" rgba="1 0 0 1"/>
    <geom name="green_sphere" pos=".2 .2 .2" size=".1" rgba="0 1 0 1"/>
  </worldbody>
</mujoco>
"""
physics = mujoco.Physics.from_xml_string(static_model)
pixels = physics.render()
PIL.Image.fromarray(pixels)

image

How should I deal with this in order to display the above screen?

I am very sorry for repeatedly asking you related questions, but I would appreciate your cooperation.

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