<?xml version="1.0" encoding="utf-8"?>
<mujoco>
	<compiler angle="radian" coordinate="local" meshdir="./stls/fetch" texturedir="./textures"></compiler>
	<option timestep="0.002">
		<flag warmstart="enable"></flag>
	</option>

	<asset>
        <texture type="skybox" builtin="gradient" rgb1="0.4 0.5 0.6" rgb2="0.1 0.3 0.4" width="32" height="32"></texture>
        <texture name="texture_block" file="block.png" gridsize="3 4" gridlayout=".U..LFRB.D.."></texture>

        <material name="floor_mat" specular="0" shininess="0.5" reflectance="0" rgba="0.2 0.2 0.2 1"></material>
        <material name="table_mat" specular="0" shininess="0.5" reflectance="0" rgba="0.3 0.93 0.93 1"></material>
        <material name="block_mat" specular="0" shininess="0.5" reflectance="0" rgba="0.2 0.2 0.2 1"></material>
        <material name="puck_mat" specular="0" shininess="0.5" reflectance="0" rgba="0.2 0.2 0.2 1"></material>
        <material name="robot0:geomMat" shininess="0.03" specular="0.4"></material>
        <material name="robot0:gripper_finger_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        <material name="robot0:gripper_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        <material name="robot0:arm_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        <material name="robot0:head_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        <material name="robot0:torso_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        <material name="robot0:base_mat" shininess="0.03" specular="0.4" reflectance="0"></material>
        
        <mesh file="base_link_collision.stl" name="robot0:base_link"></mesh>
        <mesh file="bellows_link_collision.stl" name="robot0:bellows_link"></mesh>
        <mesh file="elbow_flex_link_collision.stl" name="robot0:elbow_flex_link"></mesh>
        <mesh file="estop_link.stl" name="robot0:estop_link"></mesh>
        <mesh file="forearm_roll_link_collision.stl" name="robot0:forearm_roll_link"></mesh>
        <mesh file="gripper_link.stl" name="robot0:gripper_link"></mesh>
        <mesh file="head_pan_link_collision.stl" name="robot0:head_pan_link"></mesh>
        <mesh file="head_tilt_link_collision.stl" name="robot0:head_tilt_link"></mesh>
        <mesh file="l_wheel_link_collision.stl" name="robot0:l_wheel_link"></mesh>
        <mesh file="laser_link.stl" name="robot0:laser_link"></mesh>
        <mesh file="r_wheel_link_collision.stl" name="robot0:r_wheel_link"></mesh>
        <mesh file="torso_lift_link_collision.stl" name="robot0:torso_lift_link"></mesh>
        <mesh file="shoulder_pan_link_collision.stl" name="robot0:shoulder_pan_link"></mesh>
        <mesh file="shoulder_lift_link_collision.stl" name="robot0:shoulder_lift_link"></mesh>
        <mesh file="upperarm_roll_link_collision.stl" name="robot0:upperarm_roll_link"></mesh>
        <mesh file="wrist_flex_link_collision.stl" name="robot0:wrist_flex_link"></mesh>
        <mesh file="wrist_roll_link_collision.stl" name="robot0:wrist_roll_link"></mesh>
        <mesh file="torso_fixed_link.stl" name="robot0:torso_fixed_link"></mesh>
        <!-- <mesh file="bump3.stl" name="bump"></mesh> -->
    </asset>
    
    <default>
        <default class="ball">
            <joint type="hinge" axis="0 0 1" limited="true" range="-40 40" damping=".01"/>
            <motor gear="0.1" ctrlrange="-1 1" ctrllimited="true"/>
            <geom  solref="0.1 0.01"/>
        </default>
    </default>
	
	<worldbody>
		<geom name="floor0" pos="0.8 0.75 0" size="0.85 0.70 1" type="plane" condim="3" material="floor_mat"></geom>
		<body name="floor0" pos="0.8 0.75 0">
			<site name="target0" pos="0 0 0.5" size="0.02 0.02 0.02" rgba="1 0 0 1" type="sphere"></site>
		</body>

        <body pos="1.3 0.75 0.2" name="table0">
			<geom size="0.75 0.75 0.2" type="box" mass="2000" material="table_mat" condim='3' conaffinity='1' ></geom>
        </body>

        <!-- Robot start -->
        <body childclass="ball" name="torso" pos="0 0 .43">
            <joint name="root_x" type="slide"  pos="0 0 0" axis="1 0 0" />
            <joint name="root_y" type="slide"  pos="0 0 0" axis="0 1 0" />
            <joint axis="0 0 1" limited="false" name="rot" pos="0 0 0" type="hinge"/>
            <geom name="pointmass" type="sphere" size="0.025" rgba=".7 .5 .3 1" mass="0.15"/>
        </body>
        <!-- Robot end -->



		<!-- <body name="table0" pos="1.12441906 0.75018422 0.2">
			<geom size="0.425 0.45 0.2" type="box" condim="3" name="table0" material="table_mat" mass="2000" friction="0.1 0.005 0.0001"></geom>
		</body> -->
		
		<!-- <body name="object0" pos="0.025 0.025 0.025">
			<joint name="object0:joint" type="free" damping="0.01"></joint>
			<geom size="0.025 0.025 0.025" type="box" condim="3" name="object0" material="block_mat" mass="2"></geom>
			<site name="object0" pos="0 0 0" size="0.02 0.02 0.02" rgba="1 0 0 1" type="sphere"></site>
		</body> -->
		<light directional="true" ambient="0.2 0.2 0.2" diffuse="0.8 0.8 0.8" specular="0.3 0.3 0.3" castshadow="false" pos="0 0 4" dir="0 0 -1" name="light0"></light>
	</worldbody>

    <tendon>
        <fixed name="t1">
            <joint joint="root_x" coef="1"/>
            <joint joint="root_y" coef="0"/>
        </fixed>
        <fixed name="t2">
            <joint joint="root_x" coef="0"/>
            <joint joint="root_y" coef="1"/>
        </fixed>
    </tendon>
	
    <actuator>
        <motor name="t1" tendon="t1" ctrlrange="-1 1" ctrllimited="true"/>
        <motor name="t2" tendon="t2" ctrlrange="-1 1" ctrllimited="true"/>
    </actuator>
</mujoco>
