ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

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)

<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>
edit retag flag offensive close merge delete

Comments

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
3

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">
    <material>Gazebo/Blue</material>
</gazebo>

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

Comments

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

Question Tools

1 follower

Stats

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

Seen: 1,710 times

Last updated: Feb 24 '14