ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have never used the variablepackage:, because I don't know where is it pointing. I use file: and model: successfully. You can set the path for the file: variable in GAZEBO_RESOURCE_PATH variable.

export $GAZEBO_RESOURCE_PATH=/path/to/you/resource/folder

Make sure that your "resource folder" is of structure

media
-materials
--textures
--scripts

Then you can use <material> tags to refer to your material name defined in the script files. You only need to add <uri> to define which script to use, if you have multiple scripts that define the same named material.

<material>
          <script>
            <name>Gazebo/Texturename</name>
          </script>
</material>

or

<material>
          <script>
            <uri>materials://scripts/other_script.material</uri>
            <name>Gazebo/Texturename</name>
          </script>
</material>

or

<material>
          <script>
            <uri>media://materials/scripts/other_script.material</uri>
            <name>Gazebo/Texturename</name>
          </script>
</material>

or

<material>
          <script>
            <uri>file://media/materials/scripts/other_script.material</uri>
            <name>Gazebo/Texturename</name>
          </script>
</material>

since the resource folder is searched for folders media -> materials -> scripts or something like that. Try it yourself.