<mujoco model="7dof reacher">
   <compiler inertiafromgeom="true" angle="radian" coordinate="local" />
   <option timestep="0.01" gravity="0 0 0" iterations="100" integrator="Euler" />
   <default>
      <joint armature="0.004" damping="0.8" limited="true" />
      <geom friction=".5 .1 .1" margin="0.002" condim="1" contype="0" conaffinity="0" rgba="1.0 0.25 0.22 1" />
   </default>

   <worldbody>
      <light diffuse=".5 .5 .5" pos="0 0 3" dir="0 0 -1"/>
      <geom name="table" type="plane" pos="0 0.5 -0.425" size="1 1 0.1" rgba="0.8 0.8 0.8 1.0" contype="1" conaffinity="1"/>

      <body name="r_shoulder_pan_link" pos="0 -0.6 0">
         <geom name="e1"  type="sphere" rgba="0.6 0.6 0.6 1" pos="-0.06 0.05 0.2" size="0.05" />
         <geom name="e2"  type="sphere" rgba="0.6 0.6 0.6 1" pos=" 0.06 0.05 0.2" size="0.05" />
         <geom name="e1p" type="sphere" rgba="0.1 0.1 0.1 1" pos="-0.06 0.09 0.2" size="0.03" />
         <geom name="e2p" type="sphere" rgba="0.1 0.1 0.1 1" pos=" 0.06 0.09 0.2" size="0.03" />
         <geom name="sp"  type="capsule" fromto="0 0 -0.4 0 0 0.2" size="0.1" />
         <joint name="r_shoulder_pan_joint" type="hinge" pos="0 0 0" axis="0 0 1" range="-2.2854 1.714602" damping="2.0" />

         <body name="r_shoulder_lift_link" pos="0.1 0 0">
            <geom name="sl" type="capsule" fromto="0 -0.1 0 0 0.1 0" size="0.1" />
            <joint name="r_shoulder_lift_joint" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.5236 1.3963" damping="2.0" />

            <body name="r_upper_arm_roll_link" pos="0 0 0">
               <geom name="uar" type="capsule" fromto="-0.1 0 0 0.1 0 0" size="0.02" />
               <joint name="r_upper_arm_roll_joint" type="hinge" pos="0 0 0" axis="1 0 0" range="-1.5 1.7" />

               <body name="r_upper_arm_link" pos="0 0 0">
                  <geom name="ua" type="capsule" fromto="0 0 0 0.4 0 0" size="0.06" />

                  <body name="r_elbow_flex_link" pos="0.4 0 0">
                     <geom name="ef" type="capsule" fromto="0 -0.02 0 0.0 0.02 0" size="0.06" />
                     <joint name="r_elbow_flex_joint" type="hinge" pos="0 0 0" axis="0 1 0" range="-2.3213 0" />

                     <body name="r_forearm_roll_link" pos="0 0 0">
                        <geom name="fr" type="capsule" fromto="-0.1 0 0 0.1 0 0" size="0.02" />
                        <joint name="r_forearm_roll_joint" type="hinge" limited="true" pos="0 0 0" axis="1 0 0" range="-1.5 1.5"/>

                        <body name="r_forearm_link" pos="0 0 0">
                           <geom name="fa" type="capsule" fromto="0 0 0 0.291 0 0" size="0.05" />

                           <body name="r_wrist_flex_link" pos="0.321 0 0">
                              <geom name="wf" type="capsule" fromto="0 -0.02 0 0 0.02 0" size="0.01" />
                              <joint name="r_wrist_flex_joint" type="hinge" pos="0 0 0" axis="0 1 0" range="-1.094 0" />

                              <body name="r_wrist_roll_link" pos="0 0 0">
                                 <joint name="r_wrist_roll_joint" type="hinge" pos="0 0 0" limited="true" axis="1 0 0" range="-1.5 1.5"/>
                                    <!--
                                 <body name="tips_arm" pos="0 0 0">
                                    <geom name="tip_arml" type="sphere" pos="0.1 -0.1 0." size="0.01" />
                                    <geom name="tip_armr" type="sphere" pos="0.1 0.1 0." size="0.01" />
                                    <site name="finger" type="sphere" size="0.05" rgba="0.4 0.4 0.5 1" pos="0 0 0"/>
                                 </body>
                                    -->
                                 <geom type="sphere" pos="0.03 0 0" size="0.08" rgba="0 0 1 0.2" contype="1" conaffinity="1" />
                                 <site name="finger" type="sphere" size="0.05" rgba="0.4 0.4 0.5 1" pos="0 0 0"/>
                                    <!--
                                 <geom type="capsule" fromto="0 -0.1 0. 0.1 -0.1 0" size="0.02" contype="1" conaffinity="1" />
                                 <geom type="capsule" fromto="0 +0.1 0. 0.1 +0.1 0" size="0.02" contype="1" conaffinity="1" />
                                    -->
                              </body>
                           </body>
                        </body>
                     </body>
                  </body>
               </body>
            </body>
         </body>
      </body>

      <site name="target" pos="0 0 0" rgba="0.2 0.6 0.2 0.25" size=".05" type="sphere" />

      <!--<body name="goal" pos="0 0 0" >-->
         <!--<geom name="goal" rgba="1 0.86 0.5 1" type="sphere" size="0.05" conaffinity="0" contype="0"/>-->
         <!--<site name="goal" type="sphere" size="0.02" rgba="0.4 0.4 0.5 0.2" pos="0 0 0"/>-->

         <!--<joint axis="1 0 0" limited="false" name="goalx" pos="0 0 0" type="slide"/>-->
         <!--<joint axis="0 1 0" limited="false" name="goaly" pos="0 0 0" type="slide"/>-->
         <!--<joint axis="0 0 1" limited="false" name="goalz" pos="0 0 0" type="slide"/>-->
      <!--</body>-->

      <!--<body name="ball" pos="0 0 0" >-->
         <!--<geom name="ball" rgba="0.5 0.86 1 1" type="sphere" size="0.05" conaffinity="0" contype="0"/>-->
         <!--<site name="ball" type="sphere" size="0.02" rgba="0.4 0.4 0.5 0.2" pos="0 0 0"/>-->

         <!--<joint axis="1 0 0" limited="false" name="ballx" pos="0 0 0" type="slide"/>-->
         <!--<joint axis="0 1 0" limited="false" name="bally" pos="0 0 0" type="slide"/>-->
         <!--<joint axis="0 0 1" limited="false" name="ballz" pos="0 0 0" type="slide"/>-->
      <!--</body>-->

   </worldbody>

   <contact>
      <!--
      <pair geom1="tip_armr" geom2="ball" condim="1" solref="0.02 4" solimp="-0.1 0.95 0.1" margin="0.0" />
      <pair geom1="table" geom2="ball" condim="1" solref="0.02 1" solimp="0.9 0.95 0.1" margin="0.02" />
      -->
   </contact>

   <actuator>
      <motor joint="r_shoulder_pan_joint"   ctrlrange="-1.0 1.0" ctrllimited="true" gear="20" />
      <motor joint="r_shoulder_lift_joint"  ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
      <motor joint="r_upper_arm_roll_joint" ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
      <motor joint="r_elbow_flex_joint"     ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
      <motor joint="r_forearm_roll_joint"   ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
      <motor joint="r_wrist_flex_joint"     ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
      <motor joint="r_wrist_roll_joint"     ctrlrange="-1.0 1.0" ctrllimited="true" gear="10" />
   </actuator>
</mujoco>