Robotics StackExchange | Archived questions

Multiple Visuals Per Link with Different Colours

Hi all,

Hopefully there is a simple answer to this. I have created a 'robot' using URDF with 1 link but two visuals using the following code in Gazebo 9 and XML V1.0.

<?xml version="1.0" ?>
<robot name="myrobot">
  <link name="base_link">
    <inertial>
      <mass value="1.5"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx="0.008" ixy="0" ixz="0" iyy="0.015" iyz="0" izz="0.017"/>
    </inertial>
    <collision name="base_link_collision">
      <origin rpy="0 0 0" xyz="0      0      0.11492"/>
      <geometry>
        <box size="0.47 0.47 0.23"/>
      </geometry>
    </collision>
    <visual name="base_link_visual">
      <origin rpy="0 0 0" xyz="0      0      0.19492"/>
      <geometry>
        <box size="0.27 0.27 0.23"/>
      </geometry>
    </visual>
    <visual name="front_left_leg_visual">
      <origin rpy="0 0 0" xyz="0.123   0.22    0.08492"/>
      <geometry>
        <cylinder length="0.17" radius="0.05"/>
      </geometry>
    </visual>
  </link>
  <gazebo reference="base_link">
      <material>Gazebo/FlatBlack</material>
  </gazebo>
</robot>

I was hoping that the gazebo reference captures all visuals inside a link by reference to the link. However, the output in gazebo is below. image description

Why are there two different colors generated?

Asked by adcurry on 2020-06-12 22:30:17 UTC

Comments

You can find the answer here.

Asked by nlamprian on 2020-06-12 23:07:19 UTC

Hey this worked for me! Thanks a lot!! How do I mark your answer as correct?

Asked by adcurry on 2020-06-12 23:29:53 UTC

Answers