<mujoco model="Hexapod:Nimbus">
    <asset>
        <texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2" width="512" height="512" mark="cross" markrgb=".8 .8 .8"/>
        <material name="matplane" reflectance="0.3" texture="texplane" texrepeat="1 1" texuniform="true"/>

        <texture type="skybox" builtin="gradient" rgb1="1 1 1" rgb2=".6 .8 1" width="256" height="256"/>
        <mesh name="upper" scale="0.001 0.001 0.001" file="STLs/Upper_Chassis.stl"></mesh>
        <mesh name="lower" scale="0.001 0.001 0.001" file="STLs/Lower_Chassis.stl"></mesh>
        <mesh name="coxa_left" scale="0.001 0.001 0.001" file="STLs/left_servo_with_bracket.stl"></mesh>
        <mesh name="coxa_right" scale="0.001 0.001 0.001" file="STLs/right_servo_with_bracket.stl"></mesh>
        <mesh name="femur" scale="0.001 0.001 0.001" file="STLs/Tibia.stl"></mesh>
        <mesh name="tibia_left" scale="0.001 0.001 0.001" file="STLs/left_leg_with_servo.stl"></mesh>
        <mesh name="tibia_right" scale="0.001 0.001 0.001" file="STLs/right_leg_with_servo.stl"></mesh>
    </asset>

    <default class="main">
        <geom condim="6" />
        <joint limited="true" damping="0.75" stiffness="0.5" range="-60 60"/>
    </default>

<worldbody>
        <!-- <light pos="1 1 1" dir="0 -1 -1" diffuse="1 1 1"/> -->
        <!-- <geom type="plane" size="1 1 0.1" rgba="1 0 0 0.3"/> -->
        <geom name="floor" pos="0 0 0" size="0 0 .25" type="plane" material="matplane" condim="3"/>
        <light directional="false" diffuse=".2 .2 .2" specular="0 0 0" pos="0 0 5" dir="0 0 -1" castshadow="false"/>
        <light mode="targetbodycom" target="upper" directional="false" diffuse=".8 .8 .8" specular="0.3 0.3 0.3" pos="0 0 4.0" dir="0 0 -1"/>

        <body name="lower">
            <geom type="mesh" name="lower" mesh="lower" quat="0 0 0.707 0.707" pos="-0.010 0 .075" mass="0.294"></geom>
            <freejoint />
        </body>

        <body name="upper">
            <geom type="mesh" name="upper" mesh="upper" quat="0 0 0.707 0.707" pos="-.010 0 0.142" mass="0.216" ></geom>
            <freejoint />
        <body name="cx_1" pos=".091 -.0574 .112" euler="0 0 45">
            <geom type="mesh" name="coxa_left:1" mesh="coxa_left" euler="0 0 -90" mass="0.176"></geom>
            <joint name="coxa:1" type="hinge"  pos="-.005 .0163 .030" axis="0 0 1"/>
            <body  pos=".020 -.035 .0212" >
                <geom type="mesh" name="femur_left:1" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:1" type="hinge"  pos=".003 .021 -.0145" axis="1 0 0"/>
                <body  pos=".105 .102 -.086" >
                    <geom type="mesh" name="tibia_left:1" mesh="tibia_left" euler="0 90 90" mass="0.085"></geom>
                    <joint name="tibia:1" type="hinge"  pos="-.105 -.1572 .0717" axis="1 0 0"/>
                    <site name="touch:1" size=".005" pos="-.123 -.1522 -.036" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>
        <body name="cx_2" pos="-.0052 -.0842 .112">
            <geom type="mesh" name="coxa_left:2" mesh="coxa_left" euler="0 0 -90" mass="0.176"></geom>
            <joint name="coxa:2" type="hinge"  pos="-.005 .0163 .030" axis="0 0 1"/>
            <body  pos=".020 -.035 .0212" >
                <geom type="mesh" name="femur_left:2" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:2" type="hinge"  pos=".003 .021 -.0145" axis="1 0 0"/>
                <body  pos=".105 .102 -.086" >
                    <geom type="mesh" name="tibia_left:2" mesh="tibia_left" euler="0 90 90" mass="0.085"></geom>
                    <joint name="tibia:2" type="hinge"  pos="-.105 -.1572 .0717" axis="1 0 0"/>
                    <site name="touch:2" size=".005" pos="-.123 -.1522 -.036" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>
        <body name="cx_3" pos="-.1043 -.0641 .112" euler="0 0 -45">
            <geom type="mesh" name="coxa_left:3" mesh="coxa_left" euler="0 0 -90" mass="0.176"></geom>
            <joint name="coxa:3" type="hinge"  pos="-.005 .0163 .030" axis="0 0 1"/>
            <body  pos=".020 -.035 .0212" >
                <geom type="mesh" name="femur_left:3" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:3" type="hinge"  pos=".003 .021 -.0145" axis="1 0 0"/>
                <body  pos=".105 .102 -.086" >
                    <geom type="mesh" name="tibia_left:3" mesh="tibia_left" euler="0 90 90" mass="0.085"></geom>
                    <joint name="tibia:3" type="hinge"  pos="-.105 -.1572 .0717" axis="1 0 0"/>
                    <site name="touch:3" size=".005" pos="-.123 -.1522 -.036" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>

        <body name="cx_4" pos=".0867 .0393 .102" euler="0 0 -45">
            <geom type="mesh" name="coxa_right:1" mesh="coxa_right" euler="0 0 -90"  mass="0.176"></geom>
            <joint name="coxa:4" type="hinge"  pos="-.014 .001 .041" axis="0 0 1"/>
            <body  pos=".010 .0845 .0315" >
                <geom type="mesh" name="femur_right:1" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:4" type="hinge"  pos=".003 -.0552 -.0145" axis="1 0 0"/>
                <body  pos="-.072 .1953 .0873" >
                    <geom type="mesh" name="tibia_right:1" mesh="tibia_right" euler="0 90 90"  mass="0.085"></geom>
                    <joint name="tibia:4" type="hinge"  pos=".075 -.1742 -.1018" axis="1 0 0"/>
                    <site name="touch:4" size=".005" pos=".055 -.182 -.210" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>

        <body name="cx_5" pos=".0045 .0685 .102" >
            <geom type="mesh" name="coxa_right:2" mesh="coxa_right" euler="0 0 -90"  mass="0.176"></geom>
            <joint name="coxa:5" type="hinge"  pos="-.014 .001 .041" axis="0 0 1"/>
            <body  pos=".010 .0845 .0315" >
                <geom type="mesh" name="femur_right:2" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:5" type="hinge"  pos=".003 -.0552 -.0145" axis="1 0 0"/>
                <body  pos="-.072 .1953 .0873" >
                    <geom type="mesh" name="tibia_right:2" mesh="tibia_right" euler="0 90 90"  mass="0.085"></geom>
                    <joint name="tibia:5" type="hinge"  pos=".075 -.1742 -.1018" axis="1 0 0"/>
                    <site name="touch:5" size=".005" pos=".055 -.182 -.210" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>

        <body name="cx_6" pos="-.0863 .0597 .102" euler="0 0 45">
            <geom type="mesh" name="coxa_right:3" mesh="coxa_right" euler="0 0 -90"  mass="0.176"></geom>
            <joint name="coxa:6" type="hinge"  pos="-.014 .001 .041" axis="0 0 1"/>
            <body  pos=".010 .0845 .0315" >
                <geom type="mesh" name="femur_right:3" mesh="femur" euler="90 90 -45"  mass="0.216"></geom>
                <joint name="femur:6" type="hinge"  pos=".003 -.0552 -.0145" axis="1 0 0"/>
                <body  pos="-.072 .1953 .0873" >
                    <geom type="mesh" name="tibia_right:3" mesh="tibia_right" euler="0 90 90"  mass="0.085"></geom>
                    <joint name="tibia:6" type="hinge"  pos=".075 -.1742 -.1018" axis="1 0 0"/>
                    <site name="touch:6" size=".005" pos=".055 -.182 -.210" rgba="1 1 1 0"/>
                </body>
            </body>
        </body>


        </body>
</worldbody>

  <equality>
      <connect name="cc_2" body1="lower" body2="cx_2" anchor="-.0102 -.0679 .092"/>
      <connect name="cc_5" body1="lower" body2="cx_5" anchor="-.0102 .0679 .092"/>
      <connect name="cc_4" body1="lower" body2="cx_4" anchor=".0775 .0505 .092"/>
      <connect name="cc_6" body1="lower" body2="cx_6" anchor="-.0975 .0505 .092"/>
      <connect name="cc_1" body1="lower" body2="cx_1" anchor=".0775 -.0505 .092"/>
      <connect name="cc_3" body1="lower" body2="cx_3" anchor="-.0975 -.0505 .092"/>
  </equality>


  <sensor>
      <touch name="touch_1" site="touch:1"></touch>
      <touch name="touch_2" site="touch:2"></touch>
      <touch name="touch_3" site="touch:3"></touch>
      <touch name="touch_4" site="touch:4"></touch>
      <touch name="touch_5" site="touch:5"></touch>
      <touch name="touch_6" site="touch:6"></touch>
  </sensor>


  <actuator>
      <position name="coxa_1" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:1"/>
      <position name="coxa_2" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:2"/>
      <position name="coxa_3" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:3"/>
      <position name="coxa_4" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:4"/>
      <position name="coxa_5" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:5"/>
      <position name="coxa_6" forcelimited="true" forcerange="-1 1" kp="5" joint="coxa:6"/>
      <position name="femur_1" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:1"/>
      <position name="femur_2" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:2"/>
      <position name="femur_3" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:3"/>
      <position name="femur_4" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:4"/>
      <position name="femur_5" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:5"/>
      <position name="femur_6" forcelimited="true" forcerange="-1 1" kp="5" joint="femur:6"/>
      <position name="tibia_1" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:1"/>
      <position name="tibia_2" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:2"/>
      <position name="tibia_3" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:3"/>
      <position name="tibia_4" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:4"/>
      <position name="tibia_5" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:5"/>
      <position name="tibia_6" forcelimited="true" forcerange="-1 1" kp="5" joint="tibia:6"/>
  </actuator>

</mujoco>
