Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multiple materials per link

How can you use multiple textures per link in SDF? I tried assigning names to the material and script tag(s) and different combinations of using separate or combined material tags but gazebo always only uses the first material. One example is the Atlas robot that uses multiple textures for some links (e.g. legs).

For example for atlas I created an atlas.material script with Atlas/Carbon and Atlas/Dark materials for two different textures which I then try to make available to Gazebo via

    <material name="mat_carbon">
      <script>
        <uri>model://atlas/materials/scripts</uri>
        <uri>model://atlas/materials/textures</uri>
        <name>Atlas/Carbon</name>
      </script>
    </material>
    <material name="mat_dark">
      <script>
        <uri>model://atlas/materials/scripts</uri>
        <uri>model://atlas/materials/textures</uri>
        <name>Atlas/Dark</name>
      </script>
    </material>

But it only takes the first material (i also tried fusing both material tags and naming the script tags). What's the correct way of doing this?

Multiple materials per link

How can you use multiple textures per link in SDF? I tried assigning names to the material and script tag(s) and different combinations of using separate or combined material tags but gazebo always only uses the first material. One example is the Atlas robot that uses multiple textures for some links (e.g. legs).

For example for atlas I created an atlas.material script with Atlas/Carbon and Atlas/Dark materials for two different textures which I then try to make available to Gazebo via

    <material name="mat_carbon">
      <script>
        <uri>model://atlas/materials/scripts</uri>
        <uri>model://atlas/materials/textures</uri>
        <name>Atlas/Carbon</name>
      </script>
    </material>
    <material name="mat_dark">
      <script>
        <uri>model://atlas/materials/scripts</uri>
        <uri>model://atlas/materials/textures</uri>
        <name>Atlas/Dark</name>
      </script>
    </material>

But it only takes the first material (i also tried fusing both material tags and naming the script tags). What's the correct way of doing this?

Edit:
After reading the OGRE documentation on materials I'm guessing that only one <material> tag in the sdf is required and the material needs to load the multiple textures. I've tried using multiple texture_unit blocks with names according to the ones in the collada file and different tex_coord_set ids but still haven't managed to make it load more than one texture per link.