<!--Copyright 2020 Google LLC-->

<!--Licensed under the Apache License, Version 2.0 (the "License");-->
<!--you may not use this file except in compliance with the License.-->
<!--You may obtain a copy of the License at-->

<!--https://www.apache.org/licenses/LICENSE-2.0-->

<!--Unless required by applicable law or agreed to in writing, software-->
<!--distributed under the License is distributed on an "AS IS" BASIS,-->
<!--WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-->
<!--See the License for the specific language governing permissions and-->
<!--limitations under the License.-->
<mujoco model="franka_kitchen">
    <compiler angle="radian"/>
    <option timestep="0.002" cone="elliptic" impratio="2" noslip_iterations="20"/>
    <!-- <option timestep="0.002"/> -->
    <size njmax='1000' nconmax='1000'/>

    <include file="franka/actuator0.xml"/>
    <!-- <include file="franka2/actuator0.xml"/> -->
    <include file="franka/franka_panda_headers.xml"/>

    <!-- <include file="xarm7/actuator0.xml"/>
    <include file="xarm7/xarm7_headers.xml"/> -->

    <include file="objects/oven_asset.xml"/>
    <include file="objects/counters_asset.xml"/>
    <include file="objects/backwall_asset.xml"/>
    <include file="objects/slidecabinet_asset.xml"/>
    <include file="objects/hingecabinet_asset.xml"/>
    <include file="objects/microwave_asset.xml"/>
    <include file="objects/kettle_asset.xml"/>
    <!-- <include file="objects/trashbin_asset.xml"/> -->

    <!-- change this if you want to render at higher resolutions -->
    <visual>
        <!-- <global offwidth="2560" offheight="1920" /> -->
        <!-- <quality shadowsize="4096" offsamples="8" /> -->

        <global offwidth="640" offheight="480" />
        <quality shadowsize="1024" offsamples="4" />

        <!-- <map force="0.1" fogend="5" /> -->
    </visual>

    <!-- from adept_models/scenes/basic_scene.xml -->
    <asset>
        <!-- <texture name="skybox" type="skybox" builtin="gradient" rgb1=".08 .09 .10" rgb2="0 0 0" width="800" height="800" mark="random" markrgb=".8 .8 .8"/> -->

        <!-- <texture name="texplane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2" width="512" height="512" markrgb='.1 .1 .1' mark='random' random='.05'/> -->
        <texture name="texplane" type="2d" height="1" width="1" file="textures/white_marble_tile2.png"/>
        <material name='MatPlane' reflectance='0.05' texture="texplane" texrepeat="4 4" texuniform="true"/>
    </asset>

    <compiler inertiafromgeom='auto' inertiagrouprange='3 5' angle="radian"/>

    <worldbody>
        <!-- from adept_models/scenes/basic_scene.xml-->
        <light directional='true' diffuse='.3 .3 .3' specular='0.3 0.3 0.3' pos='-1 -1 1' dir='1 1 -1'/>
        <light directional='true' diffuse='.3 .3 .3' specular='0.3 0.3 0.3' pos='1 -1 1' dir='-1 1 -1'/>
        <light directional='true' diffuse='.3 .3 .3' specular='0.3 0.3 0.3' pos='0 1 1' dir='0 -1 -1'/>
        <geom name='floor' pos='0 0 0' size='5 5 .1' conaffinity='1' contype='1' type='plane' material="MatPlane" condim='3'/>
        <site name='xaxis' pos='.5 0 0' size='.005 .5' type='capsule' rgba='1 0 0 .25' euler='0 1.57 0' group='3'/>
        <site name='yaxis' pos='0 .5 0' size='.005 .5' type='capsule' rgba='0 1 0 .25' euler='1.57 0 0' group='3'/>

        <!-- Robot -->
        <body pos='0. 0 1.8' euler='0 0 1.57'>
            <geom type='cylinder' size='.120 .90' pos='-.04 0 -0.90' class='panda_viz'/>
            <include file="franka/franka_panda.xml"/>
            <!-- <include file="franka2/franka_panda.xml"/> -->
        </body>

        <!-- <body pos='0. 0 1.8' euler='0 0 1.57'>
            <geom type='cylinder' size='.120 .90' pos='-.04 0 -0.90' class='xarm_viz'/>
            <include file="xarm7/xarm7.xml"/>
        </body> -->

        <body name='desk' pos='-0.1 0.75 0'>
            <body name="counters1" pos="0 0 0">
                <include file="objects/chains/counters_chain.xml"/>
            </body>
            <body name="oven" pos="0 0 0">
                <include file="objects/chains/oven_chain.xml"/>
            </body>
            <body name="ovenhood" pos="0 0 0">
                <include file="objects/chains/ovenhood_chain.xml"/>
            </body>
            <body name="backwall" pos="0 0 0">
                <include file="objects/chains/backwall_chain.xml"/>
            </body>
            <body name="slidecabinet" pos="0.4 0.3 2.6">
                <include file="objects/chains/slidecabinet_chain.xml"/>
            </body>
            <body name="hingecabinet" pos="-0.504 0.28 2.6">
                <include file="objects/chains/hingecabinet_chain.xml"/>
            </body>
            <body name="microwave" pos="-0.750 -0.025 1.6" euler="0 0 0.3">
                <include file="objects/chains/microwave_chain0.xml"/>
            </body>
        </body>

        <body name="kettle" pos="-0.269 0.35 1.626">
            <freejoint/>
            <include file="objects/chains/kettle_chain0.xml"/>
        </body>

        <!-- TODO: add collision geoms for trashbin -->
        <!-- <body name="trashbin" pos="0.5 0.35 2.5" euler="1.57 0 0">
            <include file="objects/chains/trashbin_chain.xml"/>
        </body> -->

    </worldbody>

    <!-- <keyframe>
        <key qpos='0.16 -1.76 1.84 -2.51 0.36 0.79 1.55 0.00 0.0 1.25561e-05 1.57437e-07 1.25561e-05 1.57437e-07 1.25561e-05 1.57437e-07 1.25561e-05 1.57437e-07 8.24417e-05 9.48283e-05 0 0 0 0 -0.269 0.35 1.61523 1 1.34939e-19 -3.51612e-05 -7.50168e-19'/>
    </keyframe> -->

</mujoco>