<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='1000' nconmax='1000'/>

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

        <!-- Sawyer physical boundary -->
        <!-- <site name="sawyer_physical_xy_lim" type="cylinder" size="0.945 0.01" pos="0 0 0.715" rgba="1 0 0 0.2"/> -->

        <!-- 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"/>

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

          <!-- Axes markers -->
          <!-- <site name="x_ax" type="cylinder" size="0.01 0.1" pos="0.1 0 0" rgba="1 0 0 .25" 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" euler="1.57 0 0"/> -->
        </body>

        <body name="phase_indicator" pos="0.72 0.6 0.715" euler="0 0 0">
          <geom name="pi0" type="box" pos="0.15 0 0" size="0.05 0.05 0.01" contype="0" conaffinity="0" group='1' rgba="0 0 1 0"/>
          <geom name="pi1" type="box" pos="0.05 0 0" size="0.05 0.05 0.01" contype="0" conaffinity="0" group='1' rgba="0 0 1 0"/>
          <geom name="pi2" type="box" pos="-0.05 0 0" size="0.05 0.05 0.01" contype="0" conaffinity="0" group='1' rgba="0 0 1 0"/>
          <geom name="pi3" type="box" pos="-0.15 0 0" size="0.05 0.05 0.01" contype="0" conaffinity="0" group='1' rgba="0 0 1 0"/>
        </body>

        <body name="xy_completion_indicator" pos="0.5 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>

        <!-- <site name="rad" type="sphere" size="0.3" pos="0.5 0.15 1.2" rgba="1 0 0 0.05"/> -->

        <!-- Dodecahedron Target -->
        <body name="target" pos="0.92 0.15 1.22" euler="0 0 0">
          <include file="./dodecahedron_visual.xml" />
        </body>

        <!-- Dodecahedron -->
        <body name="object" pos="0.72 0.15 0.8" euler="0 0 0">
          <geom type="mesh" mesh="basketball" rgba="0.843 0.447 0.172 1" pos="0.0 0 0." quat="1. 0. 0. 0." contype="0" conaffinity="0"/>

          <include file="./dodecahedron.xml" />
          <freejoint name="r1"/>
        </body>


        <body name="basket" pos="0.94 0.15 0.70">
          <body name="pole" pos="0 0 0">
            <geom class='station_phy_plastic' type="cylinder" pos="0.11 0 0" size="0.02 0.3" rgba='0.8 0.8 0.8 1' group='1' />
          </body>
          <body name="backboard" pos="0 0 0.4">
            <geom type="box" pos="0.11 0 0" size="0.001 0.225 0.15" rgba='1 1 1 1.0' group='1' />
            <geom type="box" pos="0.109 0 -0.03" size="0.001 0.1 0.1" rgba='1 0 0 1.0' group='1' />
            <geom type="box" pos="0.108 0 -0.03" size="0.001 0.08 0.08" rgba='1 1 1 1.0' group='1' />


          </body>

        <body name="hoop" pos="0 0 0.275">
          <site name="hoop_center" type="sphere" size="0.01" pos="0 0 0.025" rgba=".4 .4 .4 0.1"/>
          <body euler='0 0 0'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 1.57'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 3.14'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 4.71'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 0.785'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 2.36'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 3.93'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 5.50'>
            <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 0.392'>
            <body euler='0 0 0'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 1.57'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 3.14'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 4.71'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 0.785'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 2.36'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 3.93'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 5.50'>
              <geom class='station_phy_plastic' type="capsule" pos="0.115 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
          </body>
          </body>
        </body>

        <!-- <body name="hoop" pos="0 0 0.275">
          <site name="hoop_center" type="sphere" size="0.01" pos="0 0 0.025" rgba=".4 .4 .4 0.1"/>
          <body euler='0 0 0'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 1.57'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 3.14'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 4.71'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 0.785'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 2.36'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 3.93'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 5.50'>
            <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
          </body>
          <body euler='0 0 0.392'>
            <body euler='0 0 0'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 1.57'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 3.14'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 4.71'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 0.785'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 2.36'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 3.93'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
            <body euler='0 0 5.50'>
              <geom class='station_phy_plastic' type="capsule" pos="0.11 0 0.02" size="0.02 0.015 0.015" rgba='0.905 0.3 0.235 1' euler="1.57 0 0" group='1' />
            </body>
          </body>
          </body>
        </body> -->

   </worldbody>

    <tendon>
      <spatial limited="true" range="0 0.45" width="0.005">
        <site site="workspace"/>
        <site site="dodecahedron_center"/>
      </spatial>
    </tendon>


</mujoco>
