<!--
 ~ Copyright 2019 The ROBEL Authors.
 ~
 ~ 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
 ~
 ~     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.
 -->

<?xml version="1.0"?>
<mujocoinclude>
  <compiler angle="radian" inertiafromgeom="auto" inertiagrouprange="3 5"/>
  <option timestep="0.0025" iterations="50" tolerance="1e-10" solver="Newton" jacobian="dense" cone="elliptic"/>
  <asset>
    <mesh name="xh28" file="../meshes/xh_base_high_poly.stl" scale=".001 .001 .001"/>
    <mesh name="acrylic_circle" file="../meshes/acrylic_circle.stl" scale=".1 .1 .1"/>
    <mesh name="plastic_finger" file="../meshes/xh_finger_tip.stl" scale=".001 .001 .001"/>
    <mesh name="metal_clamping" file="../meshes/xh_clamping_high_poly.stl" scale=".001 .001 .001"/>
    <mesh name="metal_clamping_small" file="../meshes/xh_clamping_small_high_poly.stl" scale=".001 .001 .001"/>
    <mesh name="plastic_top" file="../meshes/xh_white_top_high_poly.stl" scale=".001 .001 .001"/>
    <mesh name="xh28_hull" file="../meshes/xh_base_hull.stl" scale=".001 .001 .001"/>
    <mesh name="xh28_hull_top" file="../meshes/xh_base_hull_top.stl" scale=".001 .001 .001"/>
  </asset>
  <default>
    <default class="dclaw3xh">
      <joint limited="true" damping=".1" armature="0.001"/>
      <geom contype="0" conaffinity="0" condim="4" group="1" margin="0.0005" material="metal_black" type="mesh"/>
      <motor ctrlrange="-1.57 1.57" ctrllimited="true"/>
      <site group="1"/>
      <default class="overlay">
        <geom contype="0" conaffinity="0" group="3" type="mesh" material="greenish"/>
        <joint damping="100" frictionloss="100" armature="0"/>
        <site group="3"/>
      </default>
      <default class="phy_metal">
        <geom contype="1" conaffinity="1" group="4" type="mesh" rgba="0.0 0.0 1.0 .3"/>
        <site group="4"/>
      </default>
      <default class="phy_plastic">
        <geom contype="1" conaffinity="1" group="4" type="mesh" rgba="0.0 0.0 1.0 .3" friction=".2 0.005 0.0001"/>
        <site group="4"/>
      </default>
    </default>
  </default>
  <asset>
    <material name="metal_black" specular="1" shininess="1" rgba="0.2 0.2 0.2 1.0"/>
    <material name="metal_grey" specular="1" shininess="1" rgba="0.5 0.5 0.5 1.0"/>
    <material name="plastic" specular="0.3" shininess="0" rgba="1 1 1 1"/>
    <material name="acrylic" specular="0.3" shininess="0" rgba="1 1 1 .2"/>
    <material name="greenish" specular="0.0" shininess="0" rgba="0.3 1 0.3 1"/>
  </asset>
  <actuator>
    <position name="FFJ10" kp="2" joint="FFJ10" class="dclaw3xh" ctrlrange="-.48 .48"/>
    <position name="FFJ11" kp="2" joint="FFJ11" class="dclaw3xh"/>
    <position name="FFJ12" kp="2" joint="FFJ12" class="dclaw3xh"/>
    <position name="MFJ20" kp="2" joint="MFJ20" class="dclaw3xh" ctrlrange="-.48 .48"/>
    <position name="MFJ21" kp="2" joint="MFJ21" class="dclaw3xh"/>
    <position name="MFJ22" kp="2" joint="MFJ22" class="dclaw3xh"/>
    <position name="THJ30" kp="2" joint="THJ30" class="dclaw3xh" ctrlrange="-.48 .48"/>
    <position name="THJ31" kp="2" joint="THJ31" class="dclaw3xh"/>
    <position name="THJ32" kp="2" joint="THJ32" class="dclaw3xh"/>
  </actuator>
  <sensor>
    <jointpos name="FFJ10_pos_sensor" joint="FFJ10"/>
    <jointpos name="FFJ11_pos_sensor" joint="FFJ11"/>
    <jointpos name="FFJ12_pos_sensor" joint="FFJ12"/>
    <jointpos name="MFJ20_pos_sensor" joint="MFJ20"/>
    <jointpos name="MFJ21_pos_sensor" joint="MFJ21"/>
    <jointpos name="MFJ22_pos_sensor" joint="MFJ22"/>
    <jointpos name="THJ30_pos_sensor" joint="THJ30"/>
    <jointpos name="THJ31_pos_sensor" joint="THJ31"/>
    <jointpos name="THJ32_pos_sensor" joint="THJ32"/>
    <jointvel name="FFJ10_velocity_sensor" joint="FFJ10"/>
    <jointvel name="FFJ11_velocity_sensor" joint="FFJ11"/>
    <jointvel name="FFJ12_velocity_sensor" joint="FFJ12"/>
    <jointvel name="MFJ20_velocity_sensor" joint="MFJ20"/>
    <jointvel name="MFJ21_velocity_sensor" joint="MFJ21"/>
    <jointvel name="MFJ22_velocity_sensor" joint="MFJ22"/>
    <jointvel name="THJ30_velocity_sensor" joint="THJ30"/>
    <jointvel name="THJ31_velocity_sensor" joint="THJ31"/>
    <jointvel name="THJ32_velocity_sensor" joint="THJ32"/>
  </sensor>
</mujocoinclude>
