<?xml version="1.0"?>
<!-- This is a hand-made URDF XACRO file for the adapter from the Boxy torso 
     to the Universal Roboters UR3 -->

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

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

    <!-- Joint connecting the parent to our frame_in -->
    <joint name="${prefix}adapter_ur3_in_joint" type="fixed">
      <xacro:insert_block name="origin"/>
      <parent link="${parent}"/>
      <child link="${prefix}adapter_ur3_frame_in"/>
    </joint>

    <!-- FIXME: replace this with the actual mesh exported by Alexis -->
    <link name="${prefix}adapter_ur3_frame_in">
      <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <geometry>
          <box size="0.1 0.18 0.006"/>
        </geometry>
        <material name="red">
          <color rgba="0.8 0 0 1"/>
        </material>
      </visual>
    </link>

    <!-- joint positioning the frame_out -->
    <joint name="${prefix}adapter_ur3_trans_frame_out" type="fixed">
      <origin xyz="0 0 0.003" rpy="0 0 0" />
      <parent link="${prefix}adapter_ur3_frame_in" /> <child link="${prefix}adapter_ur3_frame_out" />
    </joint>

    <!-- Empty link just to get the frame out -->
    <link name="${prefix}adapter_ur3_frame_out"/>

    <!-- The joint connecting us to the next part of the chain is in the next URDF -->

  </xacro:macro>
</robot>
