URDF: different colors in gazebo for one link with multiple visual meshes

asked 2020-01-26 10:46:41 -0600

ROI gravatar image

updated 2020-01-26 12:02:03 -0600

gvdhoorn gravatar image

Hi, I have a URDF with a few links. One of the links with multiple visual meshes. The meshes dont have the right origin at the moment, but thats not the point.

Is it possible to give each visual mesh a different color in gazebo or is gazebo only possible to reference one color to the link_name and not to a specific visual tag?

Gazebo reference:

  <gazebo reference="assembly_table">
    <material>Gazebo/White</material>
  </gazebo>

Example link:

 <link...>
    <visual>
      <geometry>
        <mesh filename="package://boroscope_support/meshes/visual/assembly_table/table_top.dae"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
    </visual>
    <visual>
      <geometry>
        <mesh filename="package://boroscope_support/meshes/visual/assembly_table/item_table.dae"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
    </visual>
    <visual>
      <geometry>
        <mesh filename="package://boroscope_support/meshes/visual/assembly_table/UTS100cc.dae"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
    </visual>
    <visual>
      <geometry>
        <mesh filename="package://boroscope_support/meshes/visual/assembly_table/ims300pp.dae"/>
      </geometry>
      <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0"/>
    </visual>
 </link>
edit retag flag offensive close merge delete

Comments

A few quick comments:

  • this seems more like a Gazebo question, which would be better asked over at answers.gazebosim.org
  • at least in RViz, mesh material properties will override whatever you configured for material. Don't remember whether Gazebo is the same
  • your visual elements have no identifier, so it would seem impossible to refer to them. They do support it though.
gvdhoorn gravatar imagegvdhoorn ( 2020-01-27 02:28:27 -0600 )edit