<!-- Author + Copyright (C) Aravind Rajeswaran, rajeswaran.aravind@gmail.com. 
See LICENSE file for legal notices. LICENSE must be kept together with this file. -->
<mujoco model="Doors">
  <include file="./common/skybox.xml"/>
  <include file="./common/visual.xml"/>
  <include file="./common/materials.xml"/>

    <compiler inertiafromgeom="true" angle="radian" />
    <default>
        <joint armature="0.01" damping="0.1" limited="true"/>
        <geom contype="0" friction="1 0.1 0.1" rgba="0.7 0.7 0 1"/>
        <motor ctrllimited="true" ctrlrange="-1.0 1.0" />
    </default>
    <option gravity="0 0 0" integrator="RK4" timestep="0.01"/>

    <asset>
        <!-- <texture type="skybox" builtin="gradient" rgb1=".1 .12 .15" rgb2="0 0 0" width="100" height="100"/> -->
        <texture builtin="flat" height="100" name="grayplane" rgb1="0.4 0.4 0.4" rgb2=".1 0.15 0.2" type="2d" width="100"/>
        <!-- <material name="grayfloor" reflectance="0" shininess="0" specular="1" texture="grayplane"/> -->
    </asset>

    <worldbody>
        <light name="light" pos="0 0 1.2"/>
        <camera name="fixed" pos="0 0 5" quat="1 0 0 0"/>
        <!-- Arena -->
        <geom conaffinity="0" contype="0" pos="0 0 0" size="1.5 1.5 .05" rgba="1.0 1.0 1.0 1.0" type="plane" material="site"/>
        <geom conaffinity="0" fromto="-1.5 -1.5 .02 1.5 -1.5 .02" name="sideS" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="0" fromto=" 1.5 -1.5 .02 1.5  1.5 .02" name="sideE" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="0" fromto="-1.5  1.5 .02 1.5  1.5 .02" name="sideN" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="0" fromto="-1.5 -1.5 .02 -1.5 1.5 .02" name="sideW" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>

        <geom conaffinity="1" fromto="-1.5  0.3 .02 -1.2  0.3 .02" name="wall1" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-0.8  0.3 .02 -0.6  0.3 .02" name="wall2" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-0.2  0.3 .02  0.2  0.3 .02" name="wall3" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1"  fromto="0.6  0.3 .02  0.8  0.3 .02" name="wall4" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1"  fromto="1.2  0.3 .02  1.5  0.3 .02" name="wall5" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>

        <!-- <body name="door0_body" pos="0 0 0"> -->
        <geom conaffinity="1" fromto="-1.2  0.3 .02 -0.8  0.3 .02" name="door0_geom" rgba="1.0 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <!-- </body> -->
        <!-- <body name="door1_body" pos="0 0 0"> -->
        <geom conaffinity="1" fromto="-0.6  0.3 .02 -0.2  0.3 .02" name="door1_geom" rgba="1.0 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <!-- </body> -->
        <!-- <body name="door2_body" pos="0 0 0"> -->
        <geom conaffinity="1"  fromto="0.2  0.3 .02  0.6  0.3 .02" name="door2_geom" rgba="1.0 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <!-- </body> -->
        <!-- <body name="door3_body" pos="0 0 0"> -->
        <geom conaffinity="1"  fromto="0.8  0.3 .02  1.2  0.3 .02" name="door3_geom" rgba="1.0 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <!-- </body> -->


        <!-- Agent -->
        <body name="agent" pos="0 0 .05">
            <joint axis="1 0 0" name="agent_x" pos="0 0 0" range="-1.4 1.4" stiffness="0" type="slide"/>
            <joint axis="0 1 0" name="agent_y" pos="0 0 0" range="-1.4 1.4" stiffness="0" type="slide"/>
            <geom conaffinity="1" contype="1" name="agent" pos="0 0 0" rgba="0.2 0.2 0.6 1" size=".05" type="sphere"/>
        </body>

        <!-- Target -->
        <site name="target" pos="0 1.2 .05" rgba="0.6 0.2 0.2 1.0" size=".07" type="sphere" />

        <!-- Doors -->
        <site name="door0" pos="-1.0 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />
        <site name="door1" pos="-0.4 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />
        <site name="door2" pos="0.4 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />
        <site name="door3" pos="1.0 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />


    </worldbody>

    <actuator>
        <motor gear="2.0" joint="agent_x"/>
        <motor gear="2.0" joint="agent_y"/>
    </actuator>

</mujoco>
