Colors not shown in Gazebo 5
Hallo Gazebo-Users,
I try to change the color of a Link of a robot. The robot is written in URDF/Xacro. The Link is a Link without a mesh.
In Gazebo 2 it worked using the gazebo-element:
<gazebo reference="link-1">
<material>Gazebo/FlatBlack</material>
</gazebo>
Now I updated to Gazebo5 and the Link is white.
How can I change the color of the link?
Asked by J_Schaefer on 2016-01-22 11:06:30 UTC
Answers
Take a look to these links :
http://answers.gazebosim.org/question/3336/change-color-of-models/
http://sdformat.org/spec?elem=material
You can change the color with the ambient, diffuse, etc ... tag.
<gazebo reference="your_link_name">
<visual name="blabla">
<material>
<ambient>1 0 0 1</ambient>
<diffuse>1 0 0 1</diffuse>
<specular>0.1 0.1 0.1 1</specular>
<emissive>0 0 0 0</emissive>
</material>
</visual>
</gazebo>
Asked by Brosseau.F on 2016-01-25 02:46:40 UTC
Comments
Hello @Brosseau.F, I tried the way you explained but it doesn't work. This works with SDF but the model is in URDF.
Asked by J_Schaefer on 2016-01-25 09:16:20 UTC
Do you have a "/usr/share/gazebo-5/media/materials/scripts/gazebo.material" file? Do you have an error/warning message ?
Asked by Brosseau.F on 2016-01-25 10:07:15 UTC
I think you might be experiencing this issue.
As described in the link above, you need to remove the name
atribute from the visual
tag of your link definition.
Asked by damjan on 2017-04-19 15:17:53 UTC
Comments
Have you managed to solve this problem? I am encountering it as well. Not just with custom URDFs but the standard world files provided with gazebo
Asked by ZhekaS on 2016-05-28 22:40:37 UTC