<?xml version="1.0"?>
<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
       xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
       xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
       xmlns:xacro="http://ros.org/wiki/xacro">

  <xacro:macro name="pr2_upper_arm_gazebo_v0" params="side">
    <gazebo reference="${side}_upper_arm_link">
      <turnGravityOff>true</turnGravityOff>
    </gazebo>
  </xacro:macro>

  <!-- Elbow flex -->
  <xacro:macro name="pr2_elbow_flex_gazebo_v0" params="side">
    <!-- testing initial joint position, to be parsed at urdf2gazebo parse time -->
    <gazebo reference="${side}_elbow_flex_joint">
      <initial_joint_position>-1.0</initial_joint_position>
    </gazebo>

    <gazebo reference="${side}_elbow_flex_link">
      <turnGravityOff>true</turnGravityOff>
    </gazebo>
    <gazebo reference="${side}_elbow_flex_joint">
      <stopKd value="1.0" />
      <stopKp value="1000000.0" />
    </gazebo>
  </xacro:macro>

  <!-- Forearm roll -->
  <xacro:macro name="pr2_forearm_roll_gazebo_v0" params="side" >
    <gazebo reference="${side}_forearm_roll_link">
      <material value="PR2/RollLinks" />
      <turnGravityOff>true</turnGravityOff>
    </gazebo>
    <gazebo reference="${side}_forearm_roll_joint">
      <fudgeFactor value="0.5" />
    </gazebo>
  </xacro:macro>
</robot>
