MuJoCo Mesh Renders Incorrectly as a Sphere
I’m trying to modify an existing Mujoco environment to contain a model of my own robot for future use with gymnasium.
Right now, I’m only trying to render the model, but I only get a sphere. I have output a .obj model of just my robot’s main outer frame to get started. When I open the model using MuJoCo.viewer, I just see a sphere. My goal is to render the shape of my robot which is not a sphere.
Current Behavior
Following is my bot.xml asset XML file:
<mujoco>
<asset>
<texture name="grid" type="2d" builtin="checker" rgb1=".1 .2 .3"
rgb2=".2 .3 .4" width="300" height="300" mark="none"/>
<material name="grid" texture="grid" texrepeat="1 1"
texuniform="true" reflectance=".2"/>
<mesh file="eggbot1d.obj" name="body"/>
<mesh file="eggbot1dpendulum.obj" name="pendulum"/>
</asset>
<worldbody>
<light name="light" pos="0 0 10"/>
<geom name="floor" type="plane" pos="0 0 -.5" size="1 1 .01" material="grid"/>
<camera name="fixed" pos="0 -100 100" xyaxes="1 0 0 0 1 2"/>
<body name="egg1d" pos="0 0 0">
<geom name="body" pos="0 0 0" mesh="body"/>
</body>
</worldbody>
<actuator>
</actuator>
</mujoco>
This is what gets shown in the viewer:
MuJoCo Viewer showing Sphere
What I’ve tried so far
I have tried a variety of small changes to try to solve the problem. Most of my changes have been to the XML model and the obj file.
- Scaling the mesh. I have verified that the mesh is output from Fusion in meters.
- Output as .stl instead of .obj: same sphere result either way.
- Verifying that the file names are correct and the asset folder path is correct.
- Opened .obj file in Mac Preview to verify that the asset is not a sphere.
- Opened .obj file in text editor to verify it only contains one group.
Please help me troubleshoot getting this to render correctly. Thanks in advance for any advice.
Peter Klemperer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.