Hi Dear All,
I want to change color of models in gazebo ( standalone version 1.8.6 ), i read some comments here, but those don't work, by the way any one can help me? for example i want to change color of Cube 20k, and i don't know what is tag of color?!! and also i can't fine any property for color in gazebo! because i use standalone version of gazebo, i use SDF, for Example SDF file of Cube20k is:
<?xml version="1.0" ?>
<sdf version="1.4">
<model name="cube_20k">
<link name="link">
<pose>0 0 0.5 0 0 0</pose>
<collision name="collision">
<geometry>
<mesh>
<uri>model://cube_20k/meshes/cube_20k.stl</uri>
<scale>0.5 0.5 0.5</scale>
</mesh>
</geometry>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>model://cube_20k/meshes/cube_20k.stl</uri>
<scale>0.5 0.5 0.5</scale>
</mesh>
</geometry>
</visual>
</link>
</model>
</sdf>
i got this error when i added the material tag to SDF file:
XML Element[material], child of element[mesh] not defined in SDF. Ignoring.[mesh]
Error [parser.cc:710] Error reading element <mesh>
Error [parser.cc:710] Error reading element <geometry>
Error [parser.cc:710] Error reading element <collision>
Error [parser.cc:710] Error reading element <link>
Error [parser.cc:710] Error reading element <model>
Error [parser.cc:369] Unable to read element <sdf>
Error: Could not find the 'robot' element in the xml file
at line 61 in /tmp/buildd/ros-fuerte-urdfdom-0.2.3-3precise-20130312-1505/urdf_parser/src/model.cpp
I've added material tag to SDF file of Cube20K in this way, and now color of my Cube20k is changed
<?xml version="1.0" ?>
<sdf version="1.4">
<model name="cube_20k">
<link name="link">
<pose>0 0 0.5 0 0 0</pose>
<collision name="collision">
<geometry>
<mesh>
<uri>model://cube_20k/meshes/cube_20k.stl</uri>
<scale>0.5 0.5 0.5</scale>
</mesh>
</geometry>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>model://cube_20k/meshes/cube_20k.stl</uri>
<scale>0.5 0.5 0.5</scale>
</mesh>
</geometry>
<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>
</link>
</model>
</sdf>
Originally posted by Vahid on Gazebo Answers with karma: 91 on 2013-06-26
Post score: 1