<?xml version="1.0"?>
<robot name="kinect" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:macro name="kinect" params="name parent *origin">

    <joint name="${name}_joint" type="fixed">
      <xacro:insert_block name="origin"/>
      <parent link="${parent}"/>
      <child link="${name}_link" />
    </joint>
    
    <link name="${name}_link">
      <visual>
         <!-- NOTE: I (Georg Bartels) put these to be visually pleasing with our calibration
                    on February 11th, 2015. They are not set in stone! If the calibration
                    changes you might have to touch them again. Sorry! -->
        <origin xyz="-0.05 -0.17 -0.02" rpy="${M_PI/2.0} 0 ${M_PI/2.0}"/>
        <geometry>
          <mesh filename="package://iai_kinect_description/meshes/68-04546_Kinect_Sensor--coarse.STL" scale="0.001 0.001 0.001" />
        </geometry>
        <material name="gray">
          <color rgba="0.5 0.5 0.5 1"/>
        </material>
      </visual>
      <collision>
        <origin xyz="-0.05 -0.17 -0.02" rpy="${M_PI/2.0} 0 ${M_PI/2.0}"/>
        <geometry>
          <mesh filename="package://iai_kinect_description/meshes/68-04546_Kinect_Sensor--coarse_simple.STL" scale="0.001 0.001 0.001" />
        </geometry>
      </collision>
    </link>
    
    <!--<joint name="${name}_rgb_joint" type="fixed">
      <origin xyz="0.0 -0.045 0.0" rpy="0.0 0.0 0.0"/>
      <parent link="${name}_link"/>
      <child link="${name}_rgb_frame"/>
    </joint>
    
    <link name="${name}_rgb_frame"/>
    
    <joint name="${name}_rgb_optical_joint" type="fixed">
      <origin xyz="0.0 0.0 0.0" rpy="${-M_PI/2.0} 0.0 ${-M_PI/2.0}"/>
      <parent link="${name}_rgb_frame"/>
      <child link="${name}_rgb_optical_frame"/>
    </joint>
    
    <link name="${name}_rgb_optical_frame"/>
    
    <joint name="${name}_depth_joint" type="fixed">
      <origin xyz="0.0 -0.02 0.0" rpy="0.0 0.0 0.0"/>
      <parent link="${name}_link"/>
      <child link="${name}_depth_frame"/>
    </joint>
    
    <link name="${name}_depth_frame"/>
    
    <joint name="${name}_depth_optical_joint" type="fixed">
      <origin xyz="0.0 0.0 0.0" rpy="${-M_PI/2.0} 0.0 ${-M_PI/2.0}"/>
      <parent link="${name}_depth_frame"/>
      <child link="${name}_depth_optical_frame"/>
    </joint>
    
    <link name="${name}_depth_optical_frame"/>-->

  </xacro:macro>
</robot>
