<mujoco model="finger">
    <include file="./common/visual.xml"/>
    <include file="./common/skybox.xml"/>
    <include file="./common/materials.xml"/>
    
    <option timestep="0.02" iterations="50" solver="Newton" tolerance="1e-10" gravity = "0 0 0" collision="predefined" viscosity="0.1"/>

    <size njmax="100" nconmax="10" nstack="200"/>
    
    <visual>
        <rgba haze=".15 .25 .35 1"/>
    </visual>
    
    <default>
        <joint type="hinge" pos="0 0 0" axis="0 1 0" limited="false" range="-180 180" damping=".5"/>
        <motor ctrllimited="false" ctrlrange="-1 1" gear="1"/>
		<tendon stiffness="0" damping=".5" width="0.03"/>
		<geom size="0.05"/>
		<site size="0.08"/>
    </default>

    <worldbody>
        <geom name="floor" pos="0 0 0" size="0 0 1" type="plane" material="grid"/>
        <light directional="true" diffuse=".8 .8 .8" specular=".2 .2 .2" pos="0 0 5" dir="0 0 -1"/>
        <site name="target" pos="3.5 0 3" size="0.14" rgba="1 0 0 .3"/>
        <body name="vbar1" pos="0 0 1">
            <geom type="capsule" fromto="0 0 0  0 0 2" material="self" mass="1"/>
            <site name="vb1s" pos="0 0 0"/>
			<site name="vb1e" pos="0 0 2"/>
            <site name="vb1m" pos="0 0 0.5"/>
            <body name="hbar1" pos="0 0 0.5">
                <geom type="capsule" fromto="0 0 0  4 0 0" material="self" mass="1"/>
                <joint name="j2" pos="0 0 0"/>
                <body name="vbar2" pos="4 0 0">
                    <geom type="capsule" fromto="0 0 -0.25  0 0 0.75" material="self" mass="1"/>
                    <site name="vb2s" pos="0 0 -0.25"/>
                    <site name="vb2e" pos="0 0 0.75"/>
                    <site name="vb2m" pos="0 0 0"/>
                    <joint name="j3" pos="0 0 0"/>
                    <body name="hbar2" pos="0 0 0">
                        <geom type="capsule" fromto="0 0 0  2 0 0" material="self" mass="1"/>
                        <joint name="j4" pos="0 0 0"/>
                        <body name="vbar3" pos="2 0 0">
                            <geom type="capsule" fromto="0 0 -0.125  0 0 0.375" material="self" mass="1"/>
                            <site name="vb3s" pos="0 0 -0.125"/>
                            <site name="vb3e" pos="0 0 0.375"/>
                            <site name="vb3m" pos="0 0 0"/>
                            <joint name="j5" pos="0 0 0"/>
                            <body name="hbar3" pos="0 0 0">
                                <geom type="capsule" fromto="0 0 0  1 0 0" material="self" mass="1"/>
                                <site name="hb3e" pos="1 0 0"/>
                                <joint name="j6" pos="0 0 0"/>
                            </body>
                        </body>
                    </body>
                </body>
            </body>
        </body>
    </worldbody>

    <tendon>
        <spatial name="S11">
            <site site="vb1s"/>
            <site site="vb2s"/>
        </spatial>
		<spatial name="S12">
            <site site="vb1m"/>
            <site site="vb2s"/>
        </spatial>
		<spatial name="S13">
            <site site="vb1m"/>
            <site site="vb2e"/>
        </spatial>
		<spatial name="S14">
            <site site="vb1e"/>
            <site site="vb2e"/>
        </spatial>
        
        <spatial name="S21">
            <site site="vb2s"/>
            <site site="vb3s"/>
        </spatial>
		<spatial name="S22">
            <site site="vb2m"/>
            <site site="vb3s"/>
        </spatial>
		<spatial name="S23">
            <site site="vb2m"/>
            <site site="vb3e"/>
        </spatial>
		<spatial name="S24">
            <site site="vb2e"/>
            <site site="vb3e"/>
        </spatial>
        
        <spatial name="S31">
            <site site="vb3s"/>
            <site site="hb3e"/>
        </spatial>
        <spatial name="S32">
            <site site="vb3e"/>
            <site site="hb3e"/>
        </spatial>
    </tendon>   

    <actuator>
        <motor tendon="S11"/>
        <motor tendon="S12"/>
		<motor tendon="S13"/>
        <motor tendon="S14"/>
        
        <motor tendon="S21"/>
        <motor tendon="S22"/>
		<motor tendon="S23"/>
        <motor tendon="S24"/>
        
        <motor tendon="S31"/>
        <motor tendon="S32"/>
    </actuator>
</mujoco>
