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

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

ROI gravatar image

updated 2022-01-22 16:10:17 -0500

Evgeny 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 image gvdhoorn  ( 2020-01-27 02:28:27 -0500 )edit

I have the same problem, it seems that it is only possible to reference the whole link and not every mesh of your link in order to have different material types. Is there any work around ?

yunacu gravatar image yunacu  ( 2020-04-11 03:30:39 -0500 )edit