<mujoco model='sawyer-DHand-v2.0'>
<!-- ======================================================
    Model       :: Sawyer-DHand (MuJoCoV2.0)
    Author      :: Vikash Kumar
        Contacts    : vikashplus@gmail.com
        Last edits  : 3Apr'20,
    Copyright 2018 Vikash Kumar
        Licensed under 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 http://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.
====================================================== -->
    <compiler meshdir="../../../sawyer_sim/" texturedir="../../../dsuite-scenes/scenes/"/>

    <include file="../../../sawyer_sim/assets/basic_scene.xml"/>

    <!-- Sawyer -->
    <include file="../../../sawyer_sim/assets/sawyer_dependencies.xml"/>
    <include file="../../../sawyer_sim/assets/sawyer_mocap_ee_act.xml"/>

    <!-- D'Hand -->
    <include file="../../../robel-scenes_dev/dhand/assets/dhand_dependencies.xml"/>

    <size njmax='1500' nconmax='1500'/>

    <include file='./dependencies.xml' />
    <asset>
      <material name="screw-material" shininess='0.6' specular='0.35'/>
    </asset>
    <worldbody>
        <!-- ROBOT -->
        <include file="../../base_env/assets/sawyer_dHand_chain.xml"/> <!--dHand is imported in here-->

        <!-- <site name="mocap_workspace" type="box" size="0.15 .15 .175" pos="0.57 0.185 1" rgba="1 .4 .4 0.1"/> -->
        <!-- TABLE -->
        <body name="table" pos="0.7 0.15 0.72">
          <!-- Arena platform -->
          <geom type="box" size="0.55 0.55 0.5" pos="0 0 -0.5" rgba=".75 .75 .75 1"/>
          <!-- <geom type="box" size="0.4 0.4 0.35" pos="0 0 -.35" rgba=".6 .6 .5 1"/> -->

          <!-- Arena borders -->
          <!-- <geom type="box" size="0.65 0.02 0.15" pos="0 0.53 0.05" euler="-1.09707 0 0" rgba=".3 .3 .3 1"/>
          <geom type="box" size="0.02 0.65 0.15" pos="0.53 0 0.05"  euler="0 1.09707 0" rgba=".3 .3 .3 1"/>
          <geom type="box" size="0.02 0.65 0.15" pos="-0.53 0 0.05"  euler="0 -1.09707 0" rgba=".3 .3 .3 1"/>
          <geom type="box" size="0.65 0.02 0.15" pos="0 -0.53 0.05"  euler="1.09707 0 0" rgba=".3 .3 .3 1"/> -->

          <!-- Spherical bound of object movement, due to the string attached (see below) -->
          <site name="workspace" type="sphere" size="0.4" pos="0 0 0.165" rgba="1 1 1 0"/>

          <!-- Axes markers -->
          <site name="x_ax" type="cylinder" size="0.01 0.1" pos="0.1 0 0" rgba="1 0 0 .25" group="3" euler="0 1.57 0"/>
          <site name="y_ax" type="cylinder" size="0.01 0.1" pos="0 0.1 0" rgba="0 1 0 .25" group="3" euler="1.57 0 0"/>
        </body>

        <!-- Valve Target -->
        <body name="target" pos="0.72 0.15 0.72" euler="0 0 0">
          <include file="./valve3_free_visual.xml" />
        </body>

        <body name="phase_indicator" pos="1.02 0.45 0.715" euler="0 0 0">
          <geom name="pi" type="box" size="0.075 0.075 0.01" contype="0" conaffinity="0"  group='1' rgba="0 0 1 0"/>
        </body>

        <body name="xy_completion_indicator" pos="0.72 0.15 0.715" euler="0 0 0">
          <geom name="xy_ind" type="cylinder" size="0.1 0.01" contype="0" conaffinity="0"  group='1' rgba="0.9 0.9 0.9 0.25"/>
        </body>

        <body name="midair_xy_completion_indicator" pos="0.72 0.15 0.92" euler="0 0 0">
          <geom name="midair_xy_ind" type="cylinder" size="0.20 0.01" contype="0" conaffinity="0"  group='1' rgba="0 0 1 0"/>
        </body>

        <body name="thresh1" pos="0.72 0.15 0.81" euler="0 0 0">
          <site name="thresh1_site" type="cylinder" size="0.01 0.1" pos="0.1 0 0" rgba="1 0 0 .25" group="3" euler="0 1.57 0"/>
        </body>
        <body name="thresh2" pos="0.72 0.15 0.88" euler="0 0 0">
          <site name="thresh2_site" type="cylinder" size="0.01 0.1" pos="0.1 0 0" rgba="1 0 0 .25" group="3" euler="0 1.57 0"/>
        </body>

        <!-- Valve -->
        <body name="object" pos="0.72 0.15 0.8" euler="0 0 0">
          <include file="./valve3_free.xml" />
          <freejoint name="r1"/>
        </body>
   </worldbody>

    <tendon>
      <spatial limited="true" range="0 0.4" width="0.005">
        <site site="workspace"/>
        <site site="valve_center"/>
      </spatial>
    </tendon>


</mujoco>
