<mujoco model="two-link planar reacher">
  <include file="../../common/visual.xml" />
  <include file="../../common/skybox.xml" />
  <include file="../../common/materials.xml" />

  <option timestep="0.02">
    <flag contact="disable" />
  </option>

  <default>
    <joint type="hinge" axis="0 0 1" damping="0.01" />
    <motor gear=".05" ctrlrange="-1 1" ctrllimited="true" />
  </default>
  <asset>
    <texture name="motphys-ground" type="2d" file="../../common/motphys-ground.png" />
    <material name="motphys-ground" texture="motphys-ground" texuniform="true"
      texrepeat="0.4 0.4" />
  </asset>

  <worldbody>
    <light pos="0 0 1.5" dir="0 0 -1" directional="true" />
    <camera name="fixed" pos="0 0 .75" quat="1 0 0 0" />
    <!-- Arena -->
    <geom name="ground" type="plane" pos="0 0 -0.02" size="0 0 0.01" material="motphys-ground"
      contype="0" conaffinity="0" />

    <!-- Arm -->
    <geom name="root" type="cylinder" fromto="0 0 0 0 0 0.02" size=".011" material="decoration" />
    <body name="arm" pos="0 0 .01">
      <geom name="arm" type="capsule" fromto="0 0 0 0.12 0 0" size=".01" material="self" />
      <joint name="shoulder" />
      <body name="hand" pos=".12 0 0">
        <geom name="hand" type="capsule" fromto="0 0 0 0.1 0 0" size=".01" material="self" />
        <joint name="wrist" limited="true" range="-160 160" />
        <body name="finger" pos=".12 0 0">
          <camera name="hand" pos="0 0 .2" mode="track" />
          <geom name="finger" type="sphere" size=".01" material="effector" />
        </body>
      </body>
    </body>
    <!-- Target -->
    <body name="target" pos="0 0 0">
      <joint name="target_x" type="slide" axis="1 0 0" />
      <joint name="target_y" type="slide" axis="0 1 0" />
      <geom name="target" type="sphere" size=".02" material="effector" />
      <site name="target" size=".005" />
    </body>
  </worldbody>

  <actuator>
    <motor name="shoulder" joint="shoulder" />
    <motor name="wrist" joint="wrist" />
  </actuator>
</mujoco>