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

  <xacro:property name="base_link_height" value="0.129" />
  <xacro:property name="link1_len" value="0.120" />
  <xacro:property name="link2_len" value="0.130" />
  <xacro:property name="link3_storke" value="0.150" />

  <xacro:macro name="inertial_matrix" params="mass">
    <inertial>
      <mass value="${mass}" />
      <inertia ixx="0.5" ixy="0.0" ixz="0.0" iyy="0.5" iyz="0.0" izz="0.5" />
    </inertial>
  </xacro:macro>


  <link name="base_link">
  </link>

  <link name="link_1">
  </link>

  <link name="link_2">
  </link>

  <link name="link_3">
  </link>

  <joint name="link1_to_base" type="revolute">
    <parent link="base_link"/>
    <child link="link_1"/>
    <origin xyz="0 0 ${base_link_height}"/>
    <axis xyz="0 0 1" />
    <limit effort="300" velocity="0.1" lower="-3.14" upper="3.14"/>
  </joint>

  <joint name="link2_to_link1" type="revolute">
    <parent link="link_1"/>
    <child link="link_2"/>
    <origin xyz="${link1_len} 0 0"/>
    <axis xyz="0 0 1" />
    <limit effort="300" velocity="0.1" lower="-3.14" upper="3.14"/>
  </joint>

  <joint name="link3_to_link2" type="prismatic">
    <parent link="link_2"/>
    <child link="link_3"/>
    <origin xyz="${link2_len} 0 0"/>
    <axis xyz="0 0 1" />
    <limit effort="300" velocity="0.1" lower="-${link3_storke}" upper="0"/>
  </joint>


</robot>
