<?xml version="1.0" encoding="utf-8"?>
<mujoco model="table_cabinet_arena">
	<!-- <compiler angle="radian"/> -->
    <!-- <include file="../../robot/franka/touch_sensors.xml"/>
	<include file="../../robot/franka/franka_panda_door.xml"/> -->
	<!-- <option gravity="0 0 0" timestep="0.001"/> -->
	<visual>
		<map fogend="5" fogstart="3" force="0.1" zfar="10" znear="0.01"/>
		<quality shadowsize="2048"/>
		<global offheight="256" offwidth="256"/>
	</visual>
	<asset>
        <mesh name="cabinet_body" file="./cabinet/cabinet_body.STL" scale="0.001 0.001 0.001" />
        <mesh name="cabinet_door" file="./cabinet/cabinet_door.STL" scale="0.001 0.001 0.001" />
        <mesh name="cabinet_knob" file="./cabinet/cabinet_knob.STL" scale="0.001 0.001 0.001" />
		<texture builtin="flat" height="32" name="wall_geom" type="2d" width="32"/>
		<texture builtin="flat" height="32" name="frame_geom" type="2d" width="32"/>
		<texture builtin="flat" height="32" name="door_geom" type="2d" width="32"/>
		<texture builtin="flat" height="32" name="knob_geom" type="2d" width="32"/>
		<texture builtin="gradient" height="128" rgb1="0.4 0.6 0.8" rgb2="0 0 0" type="skybox" width="128"/>
		<texture builtin="checker" height="512" name="texplane" rgb1="0.2 0.3 0.4" rgb2="0.1 0.15 0.2" type="2d" width="512"/>
		<material name="Paint" shininess="0.46" specular="0.44" texture="wall_geom"/>
		<material name="Wood" shininess="0.14" specular="0.16" texture="frame_geom"/>
		<material name="Carpet" shininess="0.04" specular="0.03" texture="door_geom"/>
		<material name="Metal" shininess="0.89" specular="0.95" texture="knob_geom"/>
		<material name="Floor" texture="texplane"/>
	</asset>

	<default>
		<joint armature="1" damping="1" limited="true"/>
		<default class="wall">
			<geom rgba="0.62 0.11 0.58 1.0" type="mesh"/>
		</default>
		<default class="frame">
			<geom rgba="0.73 0.72 0.73 1.0" type="mesh"/>
		</default>
		<default class="door">
			<geom rgba="0 0 0.8 1" type="mesh"/>
		</default>
		<default class="door_knob">
			<geom condim="4" rgba="0.3 0.88 0.43 1.0" type="mesh"/>
		</default>
	</default>
	<worldbody>
		<light diffuse="0.9 1.0 0.9" dir="0.2 -0.16 -0.43" directional="true" pos="1.05 4.16 5.09"/>
		<light diffuse="1.0 0.9 0.9" dir="-0.24 0.17 -0.49" directional="true" pos="4.97 4.53 3.09"/>s
		<geom material="Floor" name="floor" pos="0 0 -0.05" size="4.0 4.0 0.05" type="plane"/>

		<body name="table" pos="0 0 0.45" euler='0 0 0'>
			<geom pos="0 0 0" size="0.4 0.9 0.45" type="box" name="table_collision" friction="1 0.005 0.0001"/>
			<geom pos="0 0 0" size="0.4 0.9 0.45" type="box" conaffinity="0" contype="0" group="1" name="table_visual"/>
			<site pos="0 0 0" name="table_top" size="0.001 0.001 0.001" rgba="0 0 0 0"/>
		</body>

		<light diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
		<light diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="false"/>
		<!-- front view -->
		<camera mode="fixed" name="frontview" pos="1.6 0 1.45" quat="0.56 0.43 0.43 0.56"/>
		<!-- bird view -->
		<camera mode="fixed" name="birdview" pos="-0.2 0 3.0" quat="0.7071 0 0 0.7071"/>
		<!-- agent view -->
		<camera mode="fixed" name="agentview" pos="0.5 0 1.35" quat="0.653 0.271 0.271 0.653"/>

  
    <body childclass="door" name="frame_link" pos="0 0 0.9" euler='0 0 -1.5708'>
        <inertial mass="100" pos="0 0 0" diaginertia="0.0001 0.0001 0.0001"/>
        <geom quat="0.707388 0.706825 0 0" type="mesh" contype="0" conaffinity="1" group="1"   mesh="cabinet_body"/>
        <body childclass="door" name="door_link" pos="0.774 -0.0055 0.095">
            <inertial pos="0 0 0" quat="0.707107 0 0 0.707107" mass="0.1144" diaginertia="0.071059 0.051411 0.019672" />
            <joint name="hinge0" pos="0 0 0" axis="0 0 1" stiffness="0.1" limited="true" range="-1.57 0" />
            <geom  pos="0.006 -0.0055 0" quat="0.000563312 0.000562864 0.706825 0.707388" type="mesh" contype="0"
                    conaffinity="1" group="1" rgba="1 1 1 1" mesh="cabinet_door"  />
			<body name="knob_link">
				<inertial pos="0 0 0" quat="0.707107 0 0 0.707107" mass="0.199" diaginertia="0.028487 0.020509 0.0087724" />
				<joint name="door_to_knob" pos="0 0 0" damping="0.09" axis="0 0 1" range="0.0 0.001"/>
				<geom friction="1 0 0" pos="-0.2175 0.0055 0.217" condim="4" name='cabinet_knob' type="mesh" contype="1" conaffinity="1" group="1" rgba="0 0 0 1" mesh="cabinet_knob" />
				<geom name='center_cabinet_knob' type="cylinder" conaffinity="0" fromto="-0.2051 0.064 0.363  -0.205 0.064 0.363" size="0.00001" rgba="1 0 0 1" group="1"/>

			</body>
        </body>
      <body name="door_link2" pos="0.774 -0.0055 0.095">
        <inertial pos="0 0 0" quat="0.707107 0 0 0.707107" mass="1.144" diaginertia="0.071059 0.051411 0.019672" />
        <joint name="base_to_door2" pos="0 0 0" axis="0 0 1" limited="true" range="-0.01 0" />
        <geom pos="-0.235 -0.0055 0" quat="0.000563312 0.000562864 0.706825 0.707388" type="mesh" contype="0" conaffinity="1" group="1" rgba="1 1 1 1" mesh="cabinet_door" />
      </body>
    </body>
	</worldbody>
</mujoco>


