Questions to SDF, urdf, xacro, material, textures using Gazebo
Hi Guys,
Currently I am a little stuck with my xacro model.
I have a texture file which should be attached to a surface in the xacro. How to add materials to your package, what do I need to export (what could I export) in the package.xml
Where do I really find the stuff documenting this features.
Examples:
<material>
<script>
<name>a/mat</name>
<uri>model://some_model/materials/scripts/mat.material</uri>
</script>
</material>
I have seen that for url there can be file and model. Does package also work here? What are those replaced with in the end and which of these exist?
Next: in the material file:
material a/mat
{
technique
{
pass
{
ambient 0.5 0.5 0.5 1.0
diffuse 1.0 1.0 1.0 1.0
specular 0.0 0.0 0.0 1.0 0.5
texture_unit
{
texture file.png
filtering trilinear
}
}
}
}
From where and how does it know where file.png is?
Does it just go standard for "../textures" ?
Folder structure is mostly like
- package
- models
- myModel
- textures
- scripts
- myModel
- models
It works for me in a sdf file, but it seems to work never in my xacro.
Somehow this is related to the package.xml as well where you export model or media path I found as well:
<export>
<gazebo_ros gazebo_media_path="${prefix}"/>
</export>
or:
<export>
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
Are there any others and what exactly do they do?
Which variable does that set? Can I see them in my environment?
How are they supposed to be set up correctly - any standard way?
What if for example I want to do a package with materials for gazebo, which should can be used for any package, how do I set that up?
So that I can use them, as you normally can do with "Gazebo/Grey ", "Gazebo/White"
Example*1 (xacro):
<gazebo reference="link">
<material>Gazebo/Grey</material>
</gazebo>
Can somebody just enlighten me how to do it or where I find the documentation for all these things to make it "just right"?
UPDATE ---
I have now checked out multiple locations and found different places to get information about this thing, also found how to debug it.
http://gazebosim.org/tutorials?tut=ros_roslaunch
there it says:
rospack plugins --attrib="gazebo_media_path" gazebo_ros
And I saw that I actually had a problem. It only takes these if you have a <run _depend>
on gazebo_ros.
<run_depend>gazebo_ros</run_depend>
<export>
<gazebo_ros gazebo_media_path="${prefix}/media"/>
</export>
But I still do not get my material like that*1.
Update 2:
Just when looking at my own old xacros I found out, you can instead of *1 also do:
<gazebo reference="link">
<material value="Gazebo/Grey" />
</gazebo>
So another Question raised up: Which is now the "prefered" way of doing that?
Which one is deprecated?
Thanks a lot,
Regards,
Christian