No color when I open a part exported from SolidWorks in Gazebo?
Hello Everyone!
I am trying to create a conveyor belt simulation in gazebo, using the SolidWorks to URDF exporter. Before importing the conveyor, I decided to test the exporter out on a simple part, and I managed to spawn it in Gazebo just fine, but no matter what I do, I cannot seem to get any color but white/gray.
Tried the following: Changing texture in URDF Exporter, changing the RGB values in URDF file, changing colors and textures in SolidWorks before exporting.
Am I doing something wrong?
Thank you for your time!
Example URDF generated from a extruded pink cube in solidworks. (not edited)
<robot
name="Part1">
<link
name="PinkCube">
<inertial>
<origin
xyz="0.127 0.127 0.127"
rpy="0 0 0" />
<mass
value="16.387" />
<inertia
ixx="0.176204636837333"
ixy="5.11592420833947E-18"
ixz="6.07865277557629E-18"
iyy="1.07890658921981E-17"
iyz="-0.176204636837333"
izz="1.07890658921981E-17" />
</inertial>
<visual>
<origin
xyz="1.5707963267949 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://PinkCube/meshes/PinkCube.STL" />
</geometry>
<material
name="">
<color
rgba="0.79216 0.81961 0.93333 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="1.5707963267949 0 0" />
<geometry>
<mesh
filename="package://PinkCube/meshes/PinkCube.STL" />
</geometry>
</collision>
</link>
</robot>
Thanks for your response, Benjamin Blumer! I do not spot <gazebo reference = 'x'> in the URDF... Is this something I should add manually?
If it didn't properly display the color, that may be a bug. Single parts should have the correct colors specified in the URDF. One day, I'll add the gazebo colors to the options.
Thank you! For now, the fix suggested by Benjamin does the trick.