<?xml version="1.0"?>

<!-- Many Kuka LWR4s are equipped with a little plate to let the cables go out 
     sideways. This is a description of such an adaptor. -->

<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="lwr4_cabling_adaptor"> 

  <xacro:macro name="lwr4_cabling_adaptor" params="prefix parent *origin">

    <joint name="${prefix}arm_cabling_adaptor_joint" type="fixed">
      <xacro:insert_block name="origin" />
      <!--origin xyz="0 0 0.01" rpy="0 0 0"/-->  <!-- This places the link at the end of the plate (frame_out) -->
      <parent link="${parent}"/>
      <child link="${prefix}cabling_adaptor_link"/>
    </joint>

    <link name="${prefix}cabling_adaptor_link">
      <visual>
        <origin xyz="0 0 -0.005" rpy="0 0 0" />  <!-- The cylinder is placed at the center -->
        <geometry>
          <cylinder length="0.01" radius="0.0315"/>
        </geometry>
        <material name="Black">
          <color rgba="0 0 0 1.0"/>
        </material>
      </visual>
    </link>

  </xacro:macro>
</robot>
