Gazebo | Ignition | Community
Ask Your Question
0

Multiple materials per link

asked 2013-01-18 20:18:55 -0600

ThomasK gravatar image

updated 2013-01-19 17:10:38 -0600

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 texcoordset ids but still haven't managed to make it load more than one texture per link.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-19 17:16:08 -0600

nkoenig gravatar image

A material is applied to a visual, not a link. Currently a visual can only have one material assigned to it. The best solution to you problem is to create a mesh using a 3D editor like Blender, and export the mesh as a collada file.

edit flag offensive delete link more

Comments

Yes, I was talking about visual links. I was trying to have the Atlas model load with textures for a presentation, so I guess this is currently not supported as all the Atlas collada files require 2-3 textures per visual link?

ThomasK gravatar imageThomasK ( 2013-01-19 17:24:23 -0600 )edit

The Atlas robot should have the texture images embedded directly in the collada files. Are they not showing up for you?

nkoenig gravatar imagenkoenig ( 2013-01-19 20:22:39 -0600 )edit

Nope, the model the way it is only shows up with textures in rviz but not in Gazebo. I only start seeing textures when I create a material script with the textures and add it to the visual elements like you have it for all the textured models in the gazebo_models database.

ThomasK gravatar imageThomasK ( 2013-01-19 20:30:08 -0600 )edit

Are there any "error" (or "Error") lines in ~/.gazebo/ogre.log?

nkoenig gravatar imagenkoenig ( 2013-01-23 23:16:57 -0600 )edit

Question Tools

Stats

Asked: 2013-01-18 20:18:55 -0600

Seen: 1,494 times

Last updated: Jan 19 '13