<?xml version="1.0" ?>


<robot name="cyton_gamma_1500" xmlns:xacro="http://www.ros.org/wiki/xacro">

  <!--  base  -->

  <link name="base_footprint">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <sphere radius="0.001"/>
      </geometry>
      <material name="white">
        <color rgba="1 1 1 1"/>
      </material>
    </visual>
  </link>

  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
  </joint>

  <link name="base_link">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/base.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0.0115 0.047"/>
      <geometry>
        <box size="0.154 0.177 0.094"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="100.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx="1.1027" iyy="1.1027" izz="1.1027"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

<!-- shoulder roll -->

  <joint name="shoulder_roll_joint" type="revolute">
    <parent link="base_link"/>
    <child link="shoulder_roll"/>
    <origin rpy="0 0 0" xyz="0 0 0.05315"/>
    <limit effort="100.0" lower="-2.618" upper="2.618" velocity="1.0"/>
    <axis xyz="0 0 1"/>
  </joint>

  <link name="shoulder_roll">
    <visual>
      <origin rpy="1.5708 0 0.384" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/shoulder_roll.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.0 0.069 0.0587"/>
      <geometry>
        <box size="0.09829 0.18143 0.08392"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="50.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".1027" iyy=".1027" izz=".1027"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="shoulder_roll_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor1">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!-- shoulder pitch  -->

  <joint name="shoulder_pitch_joint" type="revolute">
    <parent link="shoulder_roll"/>
    <child link="shoulder_pitch"/>
    <origin rpy="0 0 0" xyz="0.0205 0 0.12435"/>
    <limit effort="100.0" lower="-1.8326" upper="1.8326" velocity="1.0"/>
    <axis xyz="1 0 0"/>
  </joint>

  <link name="shoulder_pitch">
    <visual>
      <origin rpy="1.5708 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/shoulder_pitch.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="-0.001 0.064 0.1745"/>
      <geometry>
        <box size="0.0709 0.19363 0.083"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="20.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0827" iyy=".0827" izz=".0827"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="shoulder_pitch_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor2">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  shoulder yaw  -->

  <joint name="shoulder_yaw_joint" type="revolute">
    <parent link="shoulder_pitch"/>
    <child link="shoulder_yaw"/>
    <origin rpy="0 0 0" xyz="-0.0215 -0.0205 0.1255"/>
    <limit effort="100.0" lower="-1.8326" upper="1.8326" velocity="1.0"/>
    <axis xyz="0 -1 0"/>
  </joint>

  <link name="shoulder_yaw">
    <visual>
      <origin rpy="1.5708 0 -1.5708" xyz="0 0 0.0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/shoulder_yaw.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="-0.0225 0.039 0.3068"/>
      <geometry>
        <box size="0.0717 0.1846 0.0756"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="10.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0627" iyy=".0627" izz=".0627"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran3">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="shoulder_yaw_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor3">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  elbow pitch  -->

  <joint name="elbow_pitch_joint" type="revolute">
    <parent link="shoulder_yaw"/>
    <child link="elbow_pitch"/>
    <origin rpy="0 0 0" xyz="0.018 0.0206 0.1158"/>
    <limit effort="100.0" lower="-1.8326" upper="1.8326" velocity="1.0"/>
    <axis xyz="1 0 0"/>
  </joint>

  <link name="elbow_pitch">
    <visual>
      <origin rpy="1.5708 0 3.1416" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/elbow_pitch.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.0346 0.0461 0.4228"/>
      <geometry>
        <box size="0.0549 0.1557 0.076"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="10.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0327" iyy=".0327" izz=".0327"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran4">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="elbow_pitch_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor4">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  elbow yaw  -->

  <joint name="elbow_yaw_joint" type="revolute">
    <parent link="elbow_pitch"/>
    <child link="elbow_yaw"/>
    <origin rpy="0 0 0" xyz="-0.0171 -0.018 0.09746"/>
    <limit effort="100.0" lower="-1.8326" upper="1.8326" velocity="1.0"/>
    <axis xyz="0 -1 0"/>
  </joint>

  <link name="elbow_yaw">
    <visual>
      <origin rpy="1.5708 0 1.5708" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/elbow_yaw.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.0172 0.0209 0.516"/>
      <geometry>
        <box size="0.0535 0.1160 0.0402"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="10.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0227" iyy=".0227" izz=".0227"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran5">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="elbow_yaw_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor5">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  wrist pitch  -->

  <joint name="wrist_pitch_joint" type="revolute">
    <parent link="elbow_yaw"/>
    <child link="wrist_pitch"/>
    <origin rpy="0 0 0" xyz="0.02626 0.018 0.0718"/>
    <limit effort="100.0" lower="-1.8326" upper="1.8326" velocity="1.0"/>
    <axis xyz="-1 0 0"/>
  </joint>

  <link name="wrist_pitch">
    <visual>
      <origin rpy="1.5708 0 1.5708" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/wrist_pitch.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.0257 0.0118 0.5617"/>
      <geometry>
        <box size="0.026 0.0435 0.05185"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="10.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0127" iyy=".0127" izz=".0127"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran6">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="wrist_pitch_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor6">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  wrist roll  -->

  <joint name="wrist_roll_joint" type="revolute">
    <parent link="wrist_pitch"/>
    <child link="wrist_roll"/>
    <origin rpy="0 0 0" xyz="-0.026255 0 0.051425"/>
    <limit effort="100.0" lower="-2.61799" upper="2.61799" velocity="1.0"/>
    <axis xyz="0 0 1"/>
  </joint>

  <link name="wrist_roll">
    <visual>
      <origin rpy="3.1416 0 -1.5708" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/wrist_roll.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="-0.0063 -0.0014 0.6102"/>
      <geometry>
        <box size="0.0518 0.0723 0.1004"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="10.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0027" iyy=".0027" izz=".0027"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran7">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="wrist_roll_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor7">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <!--  gripper  stuff  -->

  <joint name="gripper_joint" type="prismatic">
    <parent link="wrist_roll"/>
    <child link="gripper_finger1"/>
    <origin rpy="0 0 0" xyz="-0.01331 0.00485 0.077225"/>
    <limit effort="100.0" lower="-0.008" upper="0.008" velocity="1.0"/>
    <axis xyz="1 0 0"/>
  </joint>

  <link name="gripper_finger1">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/gripper_finger1.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="-0.0167 0.0172 0.7254"/>
      <geometry>
        <box size="0.015 0.0229 0.0475"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="1.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0027" iyy=".0027" izz=".0027"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran8">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="gripper_joint">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor8">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <joint name="gripper_joint2" type="prismatic">
    <parent link="wrist_roll"/>
    <child link="gripper_finger2"/>
    <origin rpy="0 0 0" xyz="0.0098 0.00485 0.077225"/>
    <limit effort="100.0" lower="-0.008" upper="0.008" velocity="1.0"/>
    <mimic joint="gripper_joint" multiplier="-1"/>
    <axis xyz="1 0 0"/>
  </joint>

  <link name="gripper_finger2">
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://cyton_gamma_1500_description/meshes/gripper_finger2.dae"/>
      </geometry>
    </visual>
    <collision>
      <origin xyz="0.0132 0.0172 0.7254"/>
      <geometry>
        <box size="0.015 0.0229 0.0475"/>
      </geometry>
    </collision>
    <inertial>
      <mass value="1.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx=".0027" iyy=".0027" izz=".0027"
                ixy="0" ixz="0" iyz="0"/>
    </inertial>
  </link>

  <transmission name="tran9">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="gripper_joint2">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor9">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </actuator>
  </transmission>

  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"/>
  </gazebo>
  <gazebo>
    <plugin name="joint_state_publisher"
            filename="libgazebo_ros_joint_state_publisher.so">
      <jointName>shoulder_roll_joint, shoulder_pitch_joint, shoulder_yaw_joint, elbow_pitch_joint, elbow_yaw_joint, wrist_pitch_joint, wrist_roll_joint, gripper_joint, gripper_joint2</jointName>
    </plugin>
  </gazebo>

  <!--  virtual gripper  stuff  --> 

  <joint name="virtual_endeffector_joint" type="fixed">
      <parent link="wrist_roll"/>
      <child link="virtual_endeffector"/>
      <origin rpy="0 0 0" xyz="-0.002316 0.0079 0.079425"/>
    </joint>

    <link name="virtual_endeffector">
      <visual>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <geometry>
          <sphere radius="0.002"/>
        </geometry>
        <material name="grey">
          <color rgba="0.7 0.7 0.7 0.8"/>
        </material>
      </visual>
    </link>

</robot>


