Question about texture
Recently, I tried to use [ Google Scanned Objects ] (https://app.gazebosim.org/GoogleResearch/fuel/collections/Google%20Scanned%20Objects) in mujoco, but I find the texture of the object like this:
I didn't find a proper way to use the texture like this.
Can you give me some advice?
@Lucky-hqj The mug example in the model directory should be a great reference. I mimicked its contents and got the following:
The documentation is also really helpful in this regard. Check out texture for loading the PNG image and material for referencing the texture. And finally, here's an XML file to help you get started (note that you are better off using simpler approximate collision geoms than the mesh itself).
XML file
<mujoco model="clock">
<compiler meshdir="meshes" texturedir="materials/textures"/>
<visual>
<headlight ambient="0 0 0" diffuse="0 0 0" specular="1 1 1"/>
<quality shadowsize="8192"/>
</visual>
<asset>
<texture name="clock" file="texture.png" type="2d"/>
<material name="clock" texture="clock" specular="1" shininess="1"/>
<mesh name="clock" file="model.obj" scale="1 1 1"/>
<material name="floor" reflectance=".1"/>
</asset>
<worldbody>
<light pos=".4 -.4 .3" dir="-2 2 -1.5" diffuse=".6 .6 .6"/>
<light pos="-.2 -.4 .3" dir="1 2 -1.5" diffuse=".6 .6 .6"/>
<geom type="plane" size="5 5 .01" rgba="1 1 1 1" material="floor"/>
<body name="clock" pos="0 0 0.01">
<freejoint/>
<geom type="mesh" material="clock" mesh="clock" group="2" contype="0" conaffinity="0"/>
<geom type="mesh" mesh="clock" group="3"/>
</body>
</worldbody>
</mujoco>
Thank you very much! This is very inspiring to me. I'm not very familiar with mujoco yet. About "note that you are better off using simpler approximate collision geoms than the mesh itself ", Do you mean like this in the mug example:
<default>
<default class="collision">
<geom type="box" group="3"/>
<default class="cup">
<geom size="0.0026 0.00704 0.033"/>
</default>
<default class="handle">
<geom size="0.0025 0.00328 0.0055"/>
</default>
</default>
</default>
@Lucky-hqj Correct, you may want to do similar approximations for the clock.
@kevinzakka Thank you very much! I hope I can do some interesting thing about robot learning on mujoco!