<mujoco model="ant">
  <compiler angle="degree" coordinate="local" inertiafromgeom="true" settotalmass="50"/>
  <option integrator="Euler" timestep="0.01"/>
  <custom>
    <numeric data="0.0 0.0 0.55 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0 1.0" name="init_qpos"/>
  </custom>
  <default>
    <joint armature="0.1" damping="0.1" limited="true"/>
    <geom conaffinity="0" condim="3" density="5.0" friction="1 0.5 0.5" margin="0.01" rgba="0.8 0.6 0.4 1"/>
    <motor ctrllimited="true" ctrlrange="-1.0 1.0" />
  </default>
  <!--
  <asset>
    <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>
    <texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
    <texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
    <material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
    <material name="geom" texture="texgeom" texuniform="true"/>
  </asset>
  -->
<asset>
  <texture type="skybox" builtin="gradient" width="128" height="128" rgb1=".4 .6 .8" 
    rgb2="0 0 0"/>  
  <texture name="texgeom" type="cube" builtin="flat" mark="cross" width="127" height="1278" 
    rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" markrgb="1 1 1" random="0.01"/>  
  <texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2" 
    width="512" height="512"/>  
  <material name='MatPlane' reflectance='0.5' texture="texplane" texrepeat="1 1" texuniform="true"/>
  <material name='geom' texture="texgeom" texuniform="true"/>
</asset>

  <worldbody>

        <geom conaffinity="1" name='floor' pos='0 0 0' size='50 50 .125' type='plane' material="MatPlane" condim='3'/>
        <light mode='targetbodycom' target='torso' directional='false' diffuse='.8 .8 .8' specular='0.3 0.3 0.3' pos='0 0 4.0' dir='0 0 -1'/>
        <camera name='targeting' pos='1 1 2' mode='targetbodycom' target='torso'/>

        <!--
    <light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
    <geom conaffinity="1" condim="3" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="40 40 40" type="plane"/>
    -->
    <body name="torso" pos="0 0 0.75">
      <geom name="torso_geom" pos="0 0 0" size="0.25" type="sphere"/>
      <joint armature="0" damping="0" limited="false" margin="0.01" name="root" pos="0 0 0" type="free"/>
      <body name="front_left_leg" pos="0 0 0">
        <geom fromto="0.0 0.0 0.0 0.2 0.2 0.0" name="aux_1_geom" size="0.08" type="capsule"/>
        <body name="aux_1" pos="0.2 0.2 0">
          <joint axis="0 0 1" name="hip_1" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
          <geom fromto="0.0 0.0 0.0 0.2 0.2 0.0" name="left_leg_geom" size="0.08" type="capsule"/>
          <body pos="0.2 0.2 0">
            <joint axis="-1 1 0" name="ankle_1" pos="0.0 0.0 0.0" range="30 90" type="hinge"/>
            <geom fromto="0.0 0.0 0.0 0.4 0.4 0.0" name="left_ankle_geom" size="0.08" type="capsule"/>
          </body>
        </body>
      </body>
      <body name="front_right_leg" pos="0 0 0">
        <geom fromto="0.0 0.0 0.0 -0.2 0.2 0.0" name="aux_2_geom" size="0.08" type="capsule"/>
        <body name="aux_2" pos="-0.2 0.2 0">
          <joint axis="0 0 1" name="hip_2" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
          <geom fromto="0.0 0.0 0.0 -0.2 0.2 0.0" name="right_leg_geom" size="0.08" type="capsule"/>
          <body pos="-0.2 0.2 0">
            <joint axis="1 1 0" name="ankle_2" pos="0.0 0.0 0.0" range="-90 -30" type="hinge"/>
            <geom fromto="0.0 0.0 0.0 -0.4 0.4 0.0" name="right_ankle_geom" size="0.08" type="capsule"/>
          </body>
        </body>
      </body>
      <body name="back_leg" pos="0 0 0">
        <geom fromto="0.0 0.0 0.0 -0.2 -0.2 0.0" name="aux_3_geom" size="0.08" type="capsule"/>
        <body name="aux_3" pos="-0.2 -0.2 0">
          <joint axis="0 0 1" name="hip_3" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
          <geom fromto="0.0 0.0 0.0 -0.2 -0.2 0.0" name="back_leg_geom" size="0.08" type="capsule"/>
          <body pos="-0.2 -0.2 0">
            <joint axis="-1 1 0" name="ankle_3" pos="0.0 0.0 0.0" range="-90 -30" type="hinge"/>
            <geom fromto="0.0 0.0 0.0 -0.4 -0.4 0.0" name="third_ankle_geom" size="0.08" type="capsule"/>
          </body>
        </body>
      </body>
      <body name="right_back_leg" pos="0 0 0">
        <geom fromto="0.0 0.0 0.0 0.2 -0.2 0.0" name="aux_4_geom" size="0.08" type="capsule"/>
        <body name="aux_4" pos="0.2 -0.2 0">
          <joint axis="0 0 1" name="hip_4" pos="0.0 0.0 0.0" range="-40 40" type="hinge"/>
          <geom fromto="0.0 0.0 0.0 0.2 -0.2 0.0" name="rightback_leg_geom" size="0.08" type="capsule"/>
          <body pos="0.2 -0.2 0">
            <joint axis="1 1 0" name="ankle_4" pos="0.0 0.0 0.0" range="30 90" type="hinge"/>
            <geom fromto="0.0 0.0 0.0 0.4 -0.4 0.0" name="fourth_ankle_geom" size="0.08" type="capsule"/>
          </body>
        </body>
      </body>
    </body>
  </worldbody>
  <actuator>
    <motor joint="hip_4"   gear="100"/>
    <motor joint="ankle_4" gear="80"/>
    <motor joint="hip_1"   gear="100"/>
    <motor joint="ankle_1" gear="80"/>
    <motor joint="hip_2"   gear="100"/>
    <motor joint="ankle_2" gear="80"/>
    <motor joint="hip_3"   gear="100"/>
    <motor joint="ankle_3" gear="80"/>
  </actuator>
  <sensor>
    <jointpos name='root_1' joint='hip_1' />
    <jointpos name='root_2' joint='hip_1' />
    <jointpos name='root_3' joint='hip_1' />
    <jointpos name='root_4' joint='hip_1' />
    <jointpos name='root_5' joint='hip_1' />
    
    <jointpos name='pos_hip_1' joint='hip_1' />
    <jointpos name='pos_hip_2' joint='hip_2' />
    <jointpos name='pos_hip_3' joint='hip_3' />
    <jointpos name='pos_hip_4' joint='hip_4' />
    <jointpos name='pos_ankle_1' joint='ankle_1' />
    <jointpos name='pos_ankle_2' joint='ankle_2' />
    <jointpos name='pos_ankle_3' joint='ankle_3' />
    <jointpos name='pos_ankle_4' joint='ankle_4' />

    <jointvel name='vel_hip_1'   joint='hip_1' />
    <jointvel name='vel_hip_2'   joint='hip_2' />
    <jointvel name='vel_hip_3'   joint='hip_3' />
    <jointvel name='vel_hip_4'   joint='hip_4' />
    <jointvel name='vel_ankle_1' joint='ankle_1' />
    <jointvel name='vel_ankle_2' joint='ankle_2' />
    <jointvel name='vel_ankle_3' joint='ankle_3' />
    <jointvel name='vel_ankle_4' joint='ankle_4' />
  </sensor>
</mujoco>

