<?xml version="1.0"?>
<robot name="turtlebot_hardware" xmlns:xacro="http://ros.org/wiki/xacro">
  <property name="M_PI" value="3.14159"/>
  <property name="M_SCALE" value="0.001"/>

  <xacro:macro name="turtlebot_spacer" params="parent number x_loc y_loc z_loc">
    <joint name="spacer_${number}_joint" type="fixed">
      <origin xyz="${x_loc} ${y_loc} ${z_loc}" rpy="0 0 0" />
      <parent link="${parent}"/>
      <child link="spacer_${number}_link" />
    </joint>

    <link name="spacer_${number}_link">
      <inertial>
        <mass value="0.001" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0"
          izz="0.0001" />
      </inertial>

      <visual>
        <origin xyz=" 0 0 0 " rpy="0 0 0" />
        <geometry>
          <mesh filename="package://turtlebot_description/meshes/68-02403-125_Spacer.dae" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
        </geometry>
      </visual>

      <collision>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
        <geometry>
          <cylinder length="0.003175" radius=".0127"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>

  <xacro:macro name="turtlebot_standoff_1in" params="parent number x_loc y_loc z_loc">
    <joint name="standoff_1in_${number}_joint" type="fixed">
      <origin xyz="${x_loc} ${y_loc} ${z_loc}" rpy="0 0 0" />
      <parent link="${parent}"/>
      <child link="standoff_1in_${number}_link" />
    </joint>

    <link name="standoff_1in_${number}_link">
      <inertial>
        <mass value="0.001" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0"
          izz="0.0001" />
      </inertial>

      <visual>
        <origin xyz=" 0 0 0 " rpy="0 0 0" />
        <geometry>
          <mesh filename="package://turtlebot_description/meshes/68-04552-1000-RA_Turtlebot_M-F_Standoff.dae" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
        </geometry>
      </visual>

      <collision>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
        <geometry>
          <cylinder length="0.0381" radius="0.011113"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>

  <xacro:macro name="turtlebot_standoff_2in" params="parent number x_loc y_loc z_loc">
    <joint name="standoff_2in_${number}_joint" type="fixed">
      <origin xyz="${x_loc} ${y_loc} ${z_loc}" rpy="0 0 0" />
      <parent link="${parent}"/>
      <child link="standoff_2in_${number}_link" />
    </joint>

    <link name="standoff_2in_${number}_link">
      <inertial>
        <mass value="0.001" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0"
          izz="0.0001" />
      </inertial>

      <visual>
        <origin xyz=" 0 0 0 " rpy="0 0 0" />
        <geometry>
          <mesh filename="package://turtlebot_description/meshes/68-04552-2000-RA_Turtlebot_M-F_Standoff.dae" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
        </geometry>
      </visual>

      <collision>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
        <geometry>
          <cylinder length="0.0635" radius="0.0381"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>


  <xacro:macro name="turtlebot_standoff_8in" params="parent number x_loc y_loc z_loc">
    <joint name="standoff_8in_${number}_joint" type="fixed">
      <origin xyz="${x_loc} ${y_loc} ${z_loc}" rpy="0 0 0" />
      <parent link="${parent}"/>
      <child link="standoff_8in_${number}_link" />
    </joint>

    <link name="standoff_8in_${number}_link">
      <inertial>
        <mass value="0.001" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0"
          izz="0.0001" />
      </inertial>

      <visual>
        <origin xyz=" 0 0 0 " rpy="0 0 0" />
        <geometry>
          <mesh filename="package://turtlebot_description/meshes/68-02421-8000-RA_Turtlebot_F-F_Standoff.dae" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
        </geometry>
      </visual>

      <collision>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
        <geometry>
          <cylinder length="0.2032" radius="0.011113"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>

  <xacro:macro name="turtlebot_standoff_kinect" params="parent number x_loc y_loc z_loc">
    <joint name="standoff_kinect_${number}_joint" type="fixed">
      <origin xyz="${x_loc} ${y_loc} ${z_loc}" rpy="0 0 0" />
      <parent link="${parent}"/>
      <child link="standoff_kinect_${number}_link" />
    </joint>

    <link name="standoff_kinect_${number}_link">
      <inertial>
        <mass value="0.001" />
        <origin xyz="0 0 0" />
        <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
          iyy="0.0001" iyz="0.0"
          izz="0.0001" />
      </inertial>

      <visual>
        <origin xyz=" 0 0 0 " rpy="0 0 0" />
        <geometry>
          <mesh filename="package://turtlebot_description/meshes/68-04556-RA_Kinect_Standoff_Assy.dae" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
        </geometry>
      </visual>

      <collision>
        <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
        <geometry>
          <cylinder length="0.008585" radius="0.001111"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>

</robot>
