<?xml version="1.0"?>
<!--
Defines a URDF model with various types of joints.
-->
<robot xmlns:drake="http://drake.mit.edu" xmlns:xacro="http://ros.org/wiki/xacro" name="joint_parsing_test">
  <link name="link1">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link2">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link3">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link4">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link5">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link6">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link7">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link8">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link9">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link10">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link11">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <link name="link12">
    <inertial>
      <mass value="1"/>
      <inertia ixx="0.1" ixy="0" ixz="0" iyy="0.1" iyz="0" izz="0.1"/>
    </inertial>
  </link>
  <joint name="fixed_joint" type="fixed">
    <parent link="world"/>
    <child link="link1"/>
  </joint>
  <joint name="revolute_joint" type="revolute">
    <axis xyz="0 0 1"/>
    <parent link="link1"/>
    <child link="link2"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <limit effort="100" lower="-1" upper="2" velocity="100" drake:acceleration="200"/>
    <dynamics damping="0.1"/>
  </joint>
  <joint name="prismatic_joint" type="prismatic">
    <axis xyz="0 0 1"/>
    <parent link="link2"/>
    <child link="link3"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <limit effort="0" lower="-2" upper="1" velocity="5" drake:acceleration="10"/>
    <dynamics damping="0.1"/>
  </joint>
  <drake:joint name="ball_joint" type="ball">
    <parent link="link3"/>
    <child link="link4"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <dynamics damping="0.1"/>
  </drake:joint>
  <joint name="revolute_joint_no_limits" type="revolute">
    <axis xyz="0 0 1"/>
    <parent link="link4"/>
    <child link="link5"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
  </joint>
  <drake:joint name="universal_joint" type="universal">
    <parent link="link5"/>
    <child link="link6"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <dynamics damping="0.1"/>
  </drake:joint>
  <joint name="planar_joint" type="planar">
    <parent link="link6"/>
    <child link="link7"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <dynamics damping="0.1 0.1 0.1"/>
  </joint>
  <joint name="continuous_joint" type="continuous">
    <axis xyz="0 0 1"/>
    <parent link="link7"/>
    <child link="link8"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
  </joint>
  <drake:joint name="screw_joint" type="screw">
    <axis xyz="1 0 0"/>
    <parent link="link8"/>
    <child link="link9"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <drake:screw_thread_pitch value="0.04"/>
    <dynamics damping="0.1"/>
  </drake:joint>
  <!-- Mimic a joint defined *after* this one in the URDF. -->
  <joint name="revolute_joint_with_mimic_forward_reference" type="revolute">
    <axis xyz="0 0 1"/>
    <parent link="link9"/>
    <child link="link10"/>
    <mimic joint="revolute_joint_to_mimic" multiplier="1.23" offset="4.56"/>
  </joint>
  <joint name="revolute_joint_to_mimic" type="revolute">
    <axis xyz="0 0 1"/>
    <parent link="link10"/>
    <child link="link11"/>
  </joint>
  <joint name="revolute_joint_with_mimic_backward_reference" type="revolute">
    <axis xyz="0 0 1"/>
    <parent link="link11"/>
    <child link="link12"/>
    <mimic joint="revolute_joint_to_mimic" multiplier="6.54" offset="3.21"/>
  </joint>
  <!-- Normal transmission/joint, should be created with appropriate
  effort limit. -->
  <transmission>
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="revolute_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="revolute_actuator">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>
  <!-- Joint defined with zero effort, actuator should be skipped. -->
  <transmission>
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="prismatic_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="prismatic_actuator">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>
  <!-- Joint defined with no effort limit, actuator should be created
       with default limit (infinity). -->
  <transmission>
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="revolute_joint_no_limits">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="revolute_actuator_no_limits">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>
</robot>
