<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="autonomy_box_on_table">

  <xacro:include filename="$(find hector_components_description)/urdf/autonomy_box.urdf.xacro"/>
  <xacro:include filename="$(find hector_tracked_vehicles_description)/calibrations/spin_lidar_calibration.urdf.xacro"/>

  <link name="base_link" />

  <joint name="base_joint" type="fixed">
    <parent link="base_link"/>
    <child link="table_link"/>
    <origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
  </joint>

  <link name="table_link">

    <visual>
      <origin xyz="0.0 0.4 0.0" rpy="${0.5*pi} 0 0"/>
      <geometry>
        <mesh filename="package://hector_components_description/meshes/table/table.dae"/>
      </geometry>
    </visual>

    <collision>
      <origin xyz="0.0 0.0 -0.0125" rpy="0 0 0"/>
      <geometry>
        <box size="0.8 0.8 0.025"/>
      </geometry>
    </collision>

    <collision>
      <origin xyz="0.0 0.0 -0.3325" rpy="0 0 0"/>
      <geometry>
        <cylinder length="0.64" radius="0.07"/>
      </geometry>
    </collision>

    <collision>
      <origin xyz="0.0 0.0 -0.62" rpy="0 0 0"/>
      <geometry>
        <box size="0.8 0.8 0.2"/>
      </geometry>
    </collision>

    <collision>
      <origin xyz="-0.9 0.0 0.2" rpy="0 0 0"/>
      <geometry>
        <box size="1.0 1.0 2.0"/>
      </geometry>
    </collision>

  </link>

  <xacro:autonomy_box_macro parent="table_link" alu_profile_collision_size_factor="1.05" name="autonomy_box" add_chilitags="false">
    <origin xyz="0.255 0.0 0.005" rpy="0 0 0"/>
  </xacro:autonomy_box_macro>

</robot>

