Ask Your Question

No color when I open a part exported from SolidWorks in Gazebo?

asked 2013-01-10 13:48:02 -0600

RebeccaK375 gravatar image

updated 2013-01-10 16:30:47 -0600

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)

        xyz="0.127 0.127 0.127"
        rpy="0 0 0" />
        value="16.387" />
        izz="1.07890658921981E-17" />
        xyz="1.5707963267949 0 0"
        rpy="0 0 0" />
          filename="package://PinkCube/meshes/PinkCube.STL" />
          rgba="0.79216 0.81961 0.93333 1" />
        xyz="0 0 0"
        rpy="1.5707963267949 0 0" />
          filename="package://PinkCube/meshes/PinkCube.STL" />
edit retag flag offensive close merge delete


Thanks for your response, Benjamin Blumer! I do not spot <gazebo reference = 'x'> in the URDF... Is this something I should add manually?

RebeccaK375 gravatar image RebeccaK375  ( 2013-01-10 16:33:09 -0600 )edit

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.

brawner gravatar image brawner  ( 2013-02-13 13:20:42 -0600 )edit

Thank you! For now, the fix suggested by Benjamin does the trick.

RebeccaK375 gravatar image RebeccaK375  ( 2013-02-14 03:24:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-10 14:52:06 -0600

Benjamin Blumer gravatar image

updated 2014-02-24 11:40:07 -0600

What does the generated URDF look like?

Does the <gazebo reference="x"> match the <link name="y"> ?

Try adding:

<gazebo reference="PinkCube">

between the </link> and </robot> tags. That should make it blue. If so, we're on the right track. From there you can play around with the different materials available. In Fuerte, they're listed in here: /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/gazebo/share/gazebo-1.0.2/Media/materials/scripts/Gazebo.material for Groovy, I think the G in "Gazebo.material" is lower case.

edit flag offensive delete link more


Thank you so so much! There was no need for a disclaimer - this worked!

RebeccaK375 gravatar image RebeccaK375  ( 2013-01-13 06:04:52 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-01-10 13:48:02 -0600

Seen: 994 times

Last updated: Feb 24 '14