0
$\begingroup$

Rosanswers logo

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>

Originally posted by RebeccaK375 on ROS Answers with karma: 99 on 2013-01-10

Post score: 2


Original comments

Comment by RebeccaK375 on 2013-01-10:
Thanks for your response, Benjamin Blumer! I do not spot in the URDF... Is this something I should add manually?

Comment by brawner on 2013-02-13:
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.

Comment by RebeccaK375 on 2013-02-14:
Thank you! For now, the fix suggested by Benjamin does the trick.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

What does the generated URDF look like?

Does the match the ?

Try adding:

<gazebo reference="PinkCube">
    <material>Gazebo/Blue</material>
</gazebo>

between the and 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.


Originally posted by Benjamin Blumer with karma: 287 on 2013-01-10

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by RebeccaK375 on 2013-01-13:
Thank you so so much! There was no need for a disclaimer - this worked!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.