<mujoco model="swimmer">
  <include file="./common/visual.xml"/>
  <include file="./common/skybox.xml"/>
  <include file="./common/materials.xml"/>

  <option timestep="0.01" density="3000">
    <flag contact="disable"/>
  </option>

  <default>
    <default class="swimmer">
      <joint type="hinge" pos="0 -.05 0" axis="0 0 1" limited="true" solreflimit=".05 1" solimplimit="0 .8 .1" armature="1e-6"/>
      <default class="inertial">
        <geom type="box" size=".001 .05 .01" rgba="0 0 0 0" mass=".01"/>
      </default>
      <default class="visual">
        <geom type="capsule" size=".01" fromto="0 -.05 0 0 .05 0" material="self" mass="0"/>
      </default>
      <site size=".01" rgba="0 0 0 0"/>
    </default>
    <default class="free">
      <joint limited="false" stiffness="0" armature="0"/>
    </default>
    <motor gear="5e-4" ctrllimited="false" ctrlrange="-100 100"/>
  </default>

  <worldbody>
    <geom name="ground" type="plane" size="2 2 0.1" material="grid"/>
    <body name="head" pos="0 0 .05" childclass="swimmer">
      <light name="light_1" diffuse=".8 .8 .8" pos="0 0 1.5"/>
      <geom name="head" type="ellipsoid" size=".02 .04 .017" pos="0 -.022 0"  material="self" mass="0"/>
      <geom name="nose" type="sphere" pos="0 -.06 0" size=".004" material="effector" mass="0"/>
      <geom name="eyes" type="capsule" fromto="-.006 -.054 .005 .006 -.054 .005" size=".004" material="eye" mass="0"/>
      <camera name="tracking1" pos="0 -.2 .5" xyaxes="1 0 0 0 1 1" mode="trackcom" fovy="60"/>
      <camera name="tracking2" pos="-.9 .5 .15" xyaxes="0 -1 0 .3 0 1" mode="trackcom" fovy="60"/>
      <camera name="eyes" pos="0 -.058 .005" xyaxes="-1 0 0 0 0 1"/>
      <joint name="rootx" class="free" type="slide" axis="1 0 0" pos="0 -.05 0"/>
      <joint name="rooty" class="free" type="slide" axis="0 1 0" pos="0 -.05 0"/>
      <joint name="rootz" class="free" type="hinge" axis="0 0 1" pos="0 -.05 0"/>
      <geom name="inertial" class="inertial"/>
      <geom name="visual" class="visual"/>
      <site name="head"/>
      <body name="segment_1" pos="0 .1 0">
          <geom name="inertial_1" class="inertial"/>
          <geom name="visual_1" class="visual"/>
          <site name="site_1"/>
          <joint name="joint_1" range="-60 60"/>
          <body name="segment_2" pos="0 .1 0">
              <geom name="inertial_2" class="inertial"/>
              <geom name="visual_2" class="visual"/>
              <site name="site_2"/>
              <joint name="joint_2" range="-60 60"/>
              <body name="segment_3" pos="0 .1 0">
                  <geom name="inertial_3" class="inertial"/>
                  <geom name="visual_3" class="visual"/>
                  <site name="site_3"/>
                  <joint name="joint_3" range="-60 60"/>
                  <body name="segment_4" pos="0 .1 0">
                      <geom name="inertial_4" class="inertial"/>
                      <geom name="visual_4" class="visual"/>
                      <site name="site_4"/>
                      <joint name="joint_4" range="-60 60"/>
                      <body name="segment_5" pos="0 .1 0">
                          <geom name="inertial_5" class="inertial"/>
                          <geom name="visual_5" class="visual"/>
                          <site name="site_5"/>
                          <joint name="joint_5" range="-60 60"/>
                      </body>
                  </body>
              </body>
          </body>
      </body>
    </body>
    <geom name="target" type="sphere" pos="0.5 -0.6 .05" size=".06" material="target"/>
    <light name="target_light" diffuse="1 1 1" pos="1 1 1.5"/>
  </worldbody>

  <!--sensor>
    <framepos name="nose_pos" objtype="geom" objname="nose"/>
    <framepos name="target_pos" objtype="geom" objname="target"/>
    <framexaxis name="head_xaxis" objtype="xbody" objname="head"/>
    <frameyaxis name="head_yaxis" objtype="xbody" objname="head"/>
    <velocimeter name="head_vel" site="head"/>
    <gyro name="head_gyro" site="head"/>
    <velocimeter name="velocimeter_1" site="site_1"/>
    <gyro name="gyro_1" site="site_1"/>
    <velocimeter name="velocimeter_2" site="site_2"/>
    <gyro name="gyro_2" site="site_2"/>
    <velocimeter name="velocimeter_3" site="site_3"/>
    <gyro name="gyro_3" site="site_3"/>
    <velocimeter name="velocimeter_4" site="site_4"/>
    <gyro name="gyro_4" site="site_4"/>
    <velocimeter name="velocimeter_5" site="site_5"/>
    <gyro name="gyro_5" site="site_5"/>
  </sensor-->

  <actuator>
    <motor name="moter_1" joint="joint_1"/>
    <motor name="moter_2" joint="joint_2"/>
    <motor name="moter_3" joint="joint_3"/>
    <motor name="moter_4" joint="joint_4"/>
    <motor name="moter_5" joint="joint_5"/>
  </actuator>
  
</mujoco>
