Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to add a color/material to a STL mesh in an URDF file?

I use STL meshes and urdf files and I can't seem to set the material colors in the urdf file. I tried adding material like this (similar to what I would do in an SDF file):

 <gazebo reference="link_name">
   <material>Gazebo/Red</material>
 </gazebo>

or

 <gazebo reference="link_name">
   <material>
     <script>
       <uri>
          file://media/materials/scripts/gazebo.material
       </uri>
       <name>
         Gazebo/Red
       </name>
     </script>
   </material>
 </gazebo>

But it wouldn't work.

So: How can I set material/colours for STL files in an urdf file?