1
$\begingroup$

It seems that only the first material clause in a link is used for the whole link.

For example for a simple Minion Dave with blue overalls and yellow "body":

 <!-- DAVE -->
  <link name="dave_link">
    <visual name="bottom_half_dave" >
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <cylinder length="0.045" radius="0.0375" />
      </geometry>
      <material name="solid_blue" />
    </visual>

    <visual name="top_half_dave" >
      <origin xyz="0 0 0.045" rpy="0 0 0" />
      <geometry>
        <cylinder length="0.045" radius="0.0375" />
      </geometry>
      <material name="solid_yellow" />
    </visual>

    <visual name="head_dave" >
      <origin xyz="0 0 0.625" rpy="0 0 0" />
      <geometry>
        <sphere radius="0.0375" />
      </geometry>
      <material name="solid_yellow" />
    </visual>

  </link>
  
  <joint name="joint_dave" type="fixed">
    <parent link="base_link"/>
    <child link="dave_link"/>
    <origin xyz="-0.04 0 0.250" rpy="0 0 0" /> 
  </joint>

Will always use the solid_blue of the bottom half for the other two visual objects in the dave_link.

Is there a way (other than making each part a separate link with joints)?

$\endgroup$

1 Answer 1

1
$\begingroup$

Unfortunately, it looks like this is a bug that was reported in 2015 and is still unresolved. The URDF link documentation here says, in part:

Note: multiple instances of tags can exist for the same link. The union of the geometry they define forms the visual representation of the link.

I don't know if the rviz bug is truly a bug or if it's supposed to be treating all visuals within a link as one fused object, but your options seem to be to either split out your colored components into their own links or make your own mesh and apply a texture.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.