<?xml version="1.0" ?>

<mujoco model="human7">
    <compiler angle="radian" inertiafromgeom="false" coordinate="local"/>
    <default>
        <joint armature="0" damping="0" limited="true"/>
        <geom conaffinity="1" condim="1" contype="1" margin="0.001" material="geom" type="mesh" rgba="0.8 0.6 .4 1"/>
        <motor ctrllimited="true" ctrlrange="-.4 .4"/>
    </default>
    <option integrator="RK4" iterations="50" solver="Newton" timestep="0.001">
    </option>
    <size nkey="5" nuser_geom="1"/>
    <visual>
        <map fogend="5" fogstart="3"/>
        <!--visualize contact force vector and coordination frame-->
        <scale forcewidth="0.05" contactwidth="0.02" contactheight="0.1" framelength="0.4" framewidth="0.02"/>
    </visual>

    <asset>
        <texture builtin="gradient" height="100" rgb1=".4 .5 .6" 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="1000" name="texplane" rgb1=".4 .4 .4" rgb2=".6 .6 .6" type="2d" width="1000"/>
        <material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
        <material name='mat_torso' reflectance='0.1' rgba='.96 0.26 0.21 1'/>
        <material name='mat_thigh' reflectance='0.1' rgba='0.22 .56 0.34 1'/>
        <material name='mat_shank' reflectance='0.1' rgba='0.27 0.54 1 1'/>
        <material name="geom" texture="texgeom" texuniform="true"/>

        <mesh name="foot_l" file="Geometry/foot_left.stl"/>
        <mesh name="foot_r" file="Geometry/foot_right.stl"/>
        <mesh name="shank_l" file="Geometry/shank_left_scaled.stl"/>
        <mesh name="shank_r" file="Geometry/shank_right_scaled.stl"/>
        <mesh name="thigh_l" file="Geometry/thigh_left_scaled.stl"/>
        <mesh name="thigh_r" file="Geometry/thigh_right_scaled.stl"/>
        <mesh name="torso" file="Geometry/torso.stl"/>
    </asset>
    <worldbody>
        <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 condim="3" friction="1 .1 .1" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="80 80 0.125" type="plane"/>
        <body name="torso" pos="0 0 1.08">
            <camera name="track" mode="trackcom" pos="0 -4 0" xyaxes="1 0 0 0 0 1"/>

            <geom type="mesh" mesh="torso" material='mat_torso'/>
            <geom name="torso" size="0.12 0.15 0.4" pos="0 0 0.4" rgba="0.6 0.3 0 0.1" type="box" />
            <!--Joint between world and torso-->
            <joint armature="0" damping="0" limited="false" name="root" pos="0 0 0" stiffness="0" type="free"/>
            <inertial pos="0 0 0.35" mass="53.5" diaginertia="2.5 4.0 1.5"/>
            <!--show center of mass position-->
            <!--<geom name="torso_com" size="0.2" pos="0 0 0.3" type="sphere"/>-->

            <!--define right thigh-->
            <body name="right_thigh" pos="0 -0.08 0"> 
                <!--joint range limit -45, 5 deg-->
                <joint name="right_hip_frontal" axis="1 0 0" armature="0" damping="0" range="-0.7854 0.0873" type="hinge"/>
                <!--joint range limit -50, 50 deg-->
                <joint name="right_hip_sagittal" axis="0 1 0" armature="0" damping="0" range="-0.8727 0.8727" type="hinge"/>
                <geom type="mesh" mesh="thigh_r"/>
                <geom name="right_thigh" fromto="0 0 -0.05 0 0 -0.45" rgba="0.6 0.3 0 0.2" size="0.06" type="capsule"/>

                <inertial pos="0 0 -0.2" mass="8.5" diaginertia="0.15 0.15 0.03"/>
                <!--show center of mass position-->
                <!--<geom name="right_thigh_com" size="0.1" pos="0 0 -0.2" type="sphere"/>-->

                <!--define right shank-->
                <body name="right_shank" pos="0 0 -0.5">
                    <!--joint range limit 5, 150 deg-->
                    <joint name="right_knee" axis="0 1 0" armature="0" damping="0" range="0.0873 2.6180" type="hinge"/>
                    <geom type="mesh" mesh="shank_r"/>
                    <geom name="right_shank" fromto="0 0 -0.05 0 0 -0.45" rgba="0.8 0.1 0 0.2" size="0.04" type="capsule"/>

                    <inertial pos="0 0 -0.2" mass="3.5" diaginertia="0.05 0.05 0.003"/>
                    <!--show center of mass position-->
                    <!--<geom name="right_shank_com" size="0.1" pos="0 0 -0.2" type="sphere"/>-->

                    <!--define right foot-->
                    <body name="right_foot" pos="0 0 -0.5">
                        <!--joint range limit -20, 40-->
                        <joint name="right_ankle" axis="0 1 0" armature="0" damping="0" range="-0.3491 0.6981" type="hinge"/>
                        <geom type="mesh" mesh="foot_r"/>
                        <geom axisangle="0 0 1 -.05" name="right_foot" size="0.11 0.05 0.04" pos="0.0675 -0.005 -0.04" rgba="0.9 0 0 0.2" type="box"/>

                        <inertial pos="0.06 0 -0.07" mass="1.5" diaginertia="0.003 0.006 0.005"/>
                        <!--show center of mass position-->
                        <!--<geom name="right_foot_com" size="0.05" pos="0.06 0 -0.07" type="sphere"/>-->
                    </body>
                </body>
            </body>

            <!--define left thigh-->
            <body name="left_thigh" pos="0 0.08 0">
                <!--joint range limit -5, 45 deg-->
                <joint name="left_hip_frontal" axis="1 0 0" armature="0" damping="0" range="-0.0873 0.7854" type="hinge"/>
                <joint name="left_hip_sagittal" axis="0 1 0" armature="0" damping="0" range="-0.8727 0.8727" type="hinge"/>
                <geom type="mesh" mesh="thigh_l"/>
                <geom name="left_thigh" fromto="0 0 -0.05 0 0 -0.45" rgba="0 0.2 0.7 0.2" size="0.06" type="capsule"/>

                <inertial pos="0 0 -0.2" mass="8.5" diaginertia="0.15 0.15 0.03"/>
                <!--show center of mass position-->
                <!--<geom name="left_thigh_com" size="0.1" pos="0 0 -0.2" type="sphere"/>-->

                <!--define left shank-->
                <body name="left_shank" pos="0 0 -0.5">
                    <joint name="left_knee" axis="0 1 0" armature="0" damping="0" range="0.0873 2.6180" type="hinge"/>
                    <geom type="mesh" mesh="shank_l"/>
                    <geom name="left_shank" fromto="0 0 -0.05 0 0 -0.45" rgba="0 0.1 0.8 0.2" size="0.04" type="capsule"/>

                    <inertial pos="0 0 -0.2" mass="3.5" diaginertia="0.05 0.05 0.003"/>
                    <!--show center of mass position-->
                    <!--<geom name="left_shank_com" size="0.1" pos="0 0 -0.2" type="sphere"/>-->

                    <!--define left foot-->
                    <body name="left_foot" pos="0 0 -0.5">
                        <joint name="left_ankle" axis="0 1 0" armature="0" damping="0" range="-0.3491 0.6981" type="hinge"/>
                        <geom type="mesh" mesh="foot_l"/>
                        <geom axisangle="0 0 1 .05" name="left_foot" size="0.11 0.05 0.04" pos="0.0675 0.005 -0.04" rgba="0 0 0.9 0.2" type="box"/>

                        <inertial pos="0.06 0 -0.07" mass="1.5" diaginertia="0.003 0.006 0.005"/>
                        <!--show center of mass position-->
                        <!--<geom name="left_foot_com" size="0.05" pos="0.06 0 -0.07" type="sphere"/>-->
                    </body>
                </body>
            </body>
        </body>
    </worldbody>

    <actuator>
        <motor ctrllimited="true" ctrlrange="-160 120" gear="1" joint="right_hip_frontal" name="right_hip_frontal"/>
        <motor ctrllimited="true" ctrlrange="-160 160" gear="1" joint="right_hip_sagittal" name="right_hip_sagittal"/>
        <motor ctrllimited="true" ctrlrange="-160 120" gear="1" joint="right_knee" name="right_knee"/>
        <motor ctrllimited="true" ctrlrange="-60 120" gear="1" joint="right_ankle" name="right_ankle"/>

        <motor ctrllimited="true" ctrlrange="-120 160" gear="1" joint="left_hip_frontal" name="left_hip_frontal"/>
        <motor ctrllimited="true" ctrlrange="-160 160" gear="1" joint="left_hip_sagittal" name="left_hip_sagittal"/>
        <motor ctrllimited="true" ctrlrange="-160 120" gear="1" joint="left_knee" name="left_knee"/>
        <motor ctrllimited="true" ctrlrange="-60 120" gear="1" joint="left_ankle" name="left_ankle"/>
    </actuator>

</mujoco>
