<!-- 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.5 .02 -1.2  0.5 .02" name="wall1" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-1.2  0.5 .02 0.8  0.5 .02" name="wall-area1" rgba=".6 0.2 0.2 0.6" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="1.2  0.5 .02 1.5  0.5 .02" name="wall2" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>

        <geom conaffinity="1" fromto="-1.5  -0.5 .02 -1.2  -0.5 .02" name="wall3" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-1.2  -0.5 .02 -1.0  -0.5 .02" name="wall-area2" rgba=".6 0.2 0.2 0.6" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-0.6  -0.5 .02 1.2  -0.5 .02" name="wall-area" rgba=".6 0.2 0.2 0.6" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="1.2  -0.5 .02 1.5  -0.5 .02" name="wall4" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>


        <geom conaffinity="1" fromto="-1.5  0.0 .02 -1.2  0.0 .02" name="wall5" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="-1.2  0.0 .02 0.3  0.0 .02" name="wall-area3" rgba=".6 0.2 0.2 0.6" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="0.7  0.0 .02 1.2  0.0 .02" name="wall-area5" rgba=".6 0.2 0.2 0.6" size=".04" type="capsule" mass="0.1"/>
        <geom conaffinity="1" fromto="1.2  0.0 .02 1.5  0.0 .02" name="wall6" rgba="0.3 0.4 0.3 1.0" size=".04" type="capsule" mass="0.1"/>

        <!-- 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="door1" pos="0.8 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />
        <site name="door2" pos="0.8 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />
        <site name="door3" pos="0.8 0.3 .05" rgba="0.6 0.2 0.2 0." size=".07" type="sphere" />

        <site name="door0" pos="0.8 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>
