<!--
  Humanoid from dm_control: https://github.com/deepmind/dm_control/blob/33cea51/dm_control/suite/humanoid.xml
  Originally released under Apache License, version 2.0.
  Modifications: removed non-robot element and sensor definitions, redefined actuators to be PD controllers.
-->
<mujoco model="humanoid">
  <statistic extent="2" center="0 0 1"/>
  <compiler angle="degree"/>

  <option timestep=".005"/>
  <custom>
    <numeric name="frameskip" data="5"/> 
  </custom>
  <visual>
    <quality shadowsize="8192"/>
  </visual>

  <asset>
    <material name="self" rgba=".7 .5 .3 1"/>
  </asset>

  <default>
    <general forcelimited="true" ctrllimited="true" ctrlrange="-1 1" biastype="affine"/>
    <default class="body">
      <geom  type="capsule" condim="1" friction=".7" solimp=".9 .99 .003" solref=".015 1" material="self"/>
      <joint type="hinge" damping=".2" stiffness="1" armature=".01" limited="true" solimplimit="0 .99 .01"/>
      <default class="big_joint">
        <joint damping="5" stiffness="10"/>
        <default class="big_stiff_joint">
          <joint stiffness="20"/>
        </default>
      </default>
      <site size=".04" group="3"/>
      <default class="force-torque">
        <site type="box" size=".01 .01 .02" rgba="1 0 0 1" />
      </default>
      <default class="touch">
        <site type="capsule" rgba="0 0 1 .3"/>
      </default>
    </default>
  </default>

  <worldbody>
    <body name="torso" pos="0 0 1.3" childclass="body">
      <camera name="track" mode="trackcom" pos="0 -4 0" xyaxes="1 0 0 0 0 1"/>
      <camera name="back" pos="-3 0 1" xyaxes="0 -1 0 1 0 2" mode="trackcom"/>
      <camera name="side" pos="0 -3 1" xyaxes="1 0 0 0 1 2" mode="trackcom"/>
      <freejoint name="root"/>
      <site name="root" class="force-torque"/>
      <geom name="torso" fromto="0 -.07 0 0 .07 0" size=".07"/>
      <geom name="upper_waist" fromto="-.01 -.06 -.12 -.01 .06 -.12" size=".06"/>
      <site name="torso" class="touch" type="box" pos="0 0 -.05" size=".075 .14 .13"/>
      <body name="head" pos="0 0 .19">
        <geom name="head" type="sphere" size=".09"/>
        <site name="head" class="touch" type="sphere" size=".091"/>
        <camera name="egocentric" pos=".09 0 0" xyaxes="0 -1 0 .1 0 1" fovy="80"/>
      </body>
      <body name="lower_waist" pos="-.01 0 -.260" quat="1.000 0 -.002 0">
        <geom name="lower_waist" fromto="0 -.06 0 0 .06 0" size=".06"/>
        <site name="lower_waist" class="touch" size=".061 .06" zaxis="0 1 0"/>
        <joint name="abdomen_z" pos="0 0 .065" axis="0 0 1" range="-45 45" class="big_stiff_joint"/>
        <joint name="abdomen_y" pos="0 0 .065" axis="0 1 0" range="-75 30" class="big_joint"/>
        <body name="pelvis" pos="0 0 -.165" quat="1.000 0 -.002 0">
          <joint name="abdomen_x" pos="0 0 .1" axis="1 0 0" range="-35 35" class="big_joint"/>
          <geom name="butt" fromto="-.02 -.07 0 -.02 .07 0" size=".09"/>
          <site name="butt" class="touch" size=".091 .07" pos="-.02 0 0" zaxis="0 1 0"/>
          <body name="right_thigh" pos="0 -.1 -.04">
            <site name="right_hip" class="force-torque"/>
            <joint name="right_hip_x" axis="1 0 0" range="-25 5"   class="big_joint"/>
            <joint name="right_hip_z" axis="0 0 1" range="-60 35"  class="big_joint"/>
            <joint name="right_hip_y" axis="0 1 0" range="-110 20" class="big_stiff_joint"/>
            <geom name="right_thigh" fromto="0 0 0 0 .01 -.34" size=".06"/>
            <site name="right_thigh" class="touch" pos="0 .005 -.17" size=".061 .17" zaxis="0 -1 34"/>
            <body name="right_shin" pos="0 .01 -.403">
              <site name="right_knee" class="force-torque" pos="0 0 .02"/>
              <joint name="right_knee" pos="0 0 .02" axis="0 -1 0" range="-160 2"/>
              <geom name="right_shin" fromto="0 0 0 0 0 -.3"  size=".049"/>
              <site name="right_shin" class="touch" pos="0 0 -.15" size=".05 .15"/>
              <body name="right_foot" pos="0 0 -.39">
                <site name="right_ankle" class="force-torque"/>
                <joint name="right_ankle_y" pos="0 0 .08" axis="0 1 0"   range="-50 50" stiffness="6"/>
                <joint name="right_ankle_x" pos="0 0 .04" axis="1 0 .5" range="-50 50" stiffness="3"/>
                <geom name="right_right_foot" fromto="-.07 -.02 0 .14 -.04 0" size=".027"/>
                <geom name="left_right_foot" fromto="-.07 0 0 .14  .02 0" size=".027"/>
                <site name="right_right_foot" class="touch" pos=".035 -.03 0" size=".03 .11" zaxis="21 -2 0"/>
                <site name="left_right_foot" class="touch" pos=".035 .01 0" size=".03 .11" zaxis="21 2 0"/>
              </body>
            </body>
          </body>
          <body name="left_thigh" pos="0 .1 -.04">
            <site name="left_hip" class="force-torque"/>
            <joint name="left_hip_x" axis="-1 0 0" range="-25 5"  class="big_joint"/>
            <joint name="left_hip_z" axis="0 0 -1" range="-60 35" class="big_joint"/>
            <joint name="left_hip_y" axis="0 1 0" range="-120 20" class="big_stiff_joint"/>
            <geom name="left_thigh" fromto="0 0 0 0 -.01 -.34" size=".06"/>
            <site name="left_thigh" class="touch" pos="0 -.005 -.17" size=".061 .17" zaxis="0 1 34"/>
            <body name="left_shin" pos="0 -.01 -.403">
              <site name="left_knee" class="force-torque" pos="0 0 .02"/>
              <joint name="left_knee" pos="0 0 .02" axis="0 -1 0" range="-160 2"/>
              <geom name="left_shin" fromto="0 0 0 0 0 -.3"  size=".049"/>
              <site name="left_shin" class="touch"  pos="0 0 -.15" size=".05 .15"/>
              <body name="left_foot" pos="0 0 -.39">
                <site name="left_ankle" class="force-torque"/>
                <joint name="left_ankle_y" pos="0 0 .08" axis="0 1 0"   range="-50 50" stiffness="6"/>
                <joint name="left_ankle_x" pos="0 0 .04" axis="1 0 .5" range="-50 50" stiffness="3"/>
                <geom name="left_left_foot" fromto="-.07 .02 0 .14 .04 0" size=".027"/>
                <geom name="right_left_foot" fromto="-.07 0 0 .14  -.02 0" size=".027"/>
                <site name="right_left_foot" class="touch" pos=".035 -.01 0" size=".03 .11" zaxis="21 -2 0"/>
                <site name="left_left_foot" class="touch" pos=".035 .03 0" size=".03 .11" zaxis="21 2 0"/>
              </body>
            </body>
          </body>
        </body>
      </body>
      <body name="right_upper_arm" pos="0 -.17 .06">
        <joint name="right_shoulder1" axis="2 1 1"  range="-85 60"/>
        <joint name="right_shoulder2" axis="0 -1 1" range="-85 60"/>
        <geom name="right_upper_arm" fromto="0 0 0 .16 -.16 -.16" size=".04 .16"/>
        <site name="right_upper_arm" class="touch" pos=".08 -.08 -.08" size=".041 .14" zaxis="1 -1 -1"/>
        <body name="right_lower_arm" pos=".18 -.18 -.18">
          <joint name="right_elbow" axis="0 -1 1" range="-90 50" stiffness="0"/>
          <geom name="right_lower_arm" fromto=".01 .01 .01 .17 .17 .17" size=".031"/>
          <site name="right_lower_arm" class="touch" pos=".09 .09 .09" size=".032 .14" zaxis="1 1 1"/>
          <body name="right_hand" pos=".18 .18 .18">
            <geom name="right_hand" type="sphere" size=".04"/>
            <site name="right_hand" class="touch" type="sphere" size=".041"/>
          </body>
        </body>
      </body>
      <body name="left_upper_arm" pos="0 .17 .06">
        <joint name="left_shoulder1" axis="2 -1 1" range="-60 85"/>
        <joint name="left_shoulder2" axis="0 1 1" range="-60 85"/>
        <geom name="left_upper_arm" fromto="0 0 0 .16 .16 -.16" size=".04 .16"/>
        <site name="left_upper_arm" class="touch" pos=".08 .08 -.08" size=".041 .14" zaxis="1 1 -1"/>
        <body name="left_lower_arm" pos=".18 .18 -.18">
          <joint name="left_elbow" axis="0 -1 -1" range="-90 50" stiffness="0"/>
          <geom name="left_lower_arm" fromto=".01 -.01 .01 .17 -.17 .17" size=".031"/>
          <site name="left_lower_arm" class="touch" pos=".09 -.09 .09" size=".032 .14" zaxis="1 -1 1"/>
          <body name="left_hand" pos=".18 -.18 .18">
            <geom name="left_hand" type="sphere" size=".04"/>
            <site name="left_hand" class="touch" type="sphere" size=".041"/>
          </body>
        </body>
      </body>
    </body>
  </worldbody>

  <actuator>
    <general name="abdomen_y" forcerange="-40 40" joint="abdomen_y" gainprm="36.651914291880921" biasprm="-15.707963267948966 -40 0"/>
    <general name="abdomen_z" forcerange="-40 40" joint="abdomen_z" gainprm="31.415926535897931" biasprm="0 -40 0"/>
    <general name="abdomen_x" forcerange="-40 40" joint="abdomen_x" gainprm="24.434609527920614" biasprm="0 -40 0"/>
    <general name="right_hip_x" forcerange="-40 40" joint="right_hip_x" gainprm="10.471975511965976" biasprm="-6.981317007977319 -40 0"/>
    <general name="right_hip_z" forcerange="-40 40" joint="right_hip_z" gainprm="33.161255787892259" biasprm="-8.7266462599716466 -40 0"/>
    <general name="right_hip_y" forcerange="-120 120" joint="right_hip_y" gainprm="136.1356816555577" biasprm="-94.247779607693786 -120 0"/>
    <general name="right_knee" forcerange="-80 80" joint="right_knee" gainprm="113.09733552923255" biasprm="-110.30480872604161 -80 0"/>
    <general name="right_ankle_x" forcerange="-20 20" joint="right_ankle_x" gainprm="17.453292519943297" biasprm="0 -20 0"/>
    <general name="right_ankle_y" forcerange="-20 20" joint="right_ankle_y" gainprm="17.453292519943297" biasprm="0 -20 0"/>
    <general name="left_hip_x" forcerange="-40 40" joint="left_hip_x" gainprm="10.471975511965976" biasprm="-6.981317007977319 -40 0"/>
    <general name="left_hip_z" forcerange="-40 40" joint="left_hip_z" gainprm="33.161255787892259" biasprm="-8.7266462599716466 -40 0"/>
    <general name="left_hip_y" forcerange="-120 120" joint="left_hip_y" gainprm="146.60765716752368" biasprm="-104.71975511965977 -120 0"/>
    <general name="left_knee" forcerange="-80 80" joint="left_knee" gainprm="113.09733552923255" biasprm="-110.30480872604161 -80 0"/>
    <general name="left_ankle_x" forcerange="-20 20" joint="left_ankle_x" gainprm="17.453292519943297" biasprm="0 -20 0"/>
    <general name="left_ankle_y" forcerange="-20 20" joint="left_ankle_y" gainprm="17.453292519943297" biasprm="0 -20 0"/>
    <general name="right_shoulder1" forcerange="-20 20" joint="right_shoulder1" gainprm="25.307274153917774" biasprm="-4.3633231299858277 -20 0"/>
    <general name="right_shoulder2" forcerange="-20 20" joint="right_shoulder2" gainprm="25.307274153917774" biasprm="-4.3633231299858277 -20 0"/>
    <general name="right_elbow" forcerange="-40 40" joint="right_elbow" gainprm="48.869219055841228" biasprm="-13.962634015954638 -40 0"/>
    <general name="left_shoulder1" forcerange="-20 20" joint="left_shoulder1" gainprm="25.307274153917774" biasprm="4.3633231299858233 -20 0"/>
    <general name="left_shoulder2" forcerange="-20 20" joint="left_shoulder2" gainprm="25.307274153917774" biasprm="4.3633231299858233 -20 0"/>
    <general name="left_elbow" forcerange="-40 40" joint="left_elbow" gainprm="48.869219055841228" biasprm="-13.962634015954638 -40 0"/>
  </actuator>
</mujoco>
