<!-- ======================================================
# Copyright 2019 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
#
#      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.

NOTE: Sources for the origination of this file include:
: Shadow robot company (https://github.com/shadow-robot/sr_common)
: Manipulator and Manipulation in High Dimensional Spaces. Vikash Kumar, Ph.D. Thesis, CSE, Univ. of Washington. 2016.

====================================================== -->

<mujocoinclude>
	<body name="forearm" childclass="Adroit" pos="0 .01 0" euler="0 0 0">
		<inertial pos="0.001 -0.002 0.29" quat="0.982 -0.016 0.000 -0.188" mass="4" diaginertia="0.01 0.01 0.0075" />
		<!--<joint name="base" type="free" limited="false"/>-->
		<geom class="D_Vizual" pos="0 -.01 .04" name="V_forearm"  mesh="forearm" euler="0 0 -1.57"/>
		<geom class="DC_Hand" name="C_forearm" type="mesh" mesh="forearm_cvx" pos="0 -.01 .04" euler="0 0 -1.57" rgba=".4 .5 .6 .7"/>

		<!-- ======= Wrist ======= -->
		<body name="wrist" pos="0 0 0.256">
			<inertial pos="0.003 0.000 0.016" quat="0.504 0.496 0.495 0.504" mass="0.3" diaginertia="0.001 0.001 0.001" />
			<joint name="WRJ1" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.524 0.175" damping=".5" armature=".005" user="1123"/>
			<geom class="D_Vizual" name="V_wrist" mesh="wrist"/>
			<geom class="DC_Hand" name="C_wrist" type="capsule" pos="0 0 0"  quat=".707 .707 0 0" size=".015 .01" rgba=".4 .5 .6 .1"/>

			<!-- ======= Palm ======= -->
			<body name="palm" pos="0 0 0.034">
				<inertial pos="0.006 -0.000 0.036" quat="0.716 0.044 0.075 0.693" mass="0.3" diaginertia="0.001 0.001 0.001" />
				<joint name="WRJ0" type="hinge" pos="0 0 0" axis="1 0 0" range="-0.785 0.611" damping=".5" armature=".005" user="1122"/>
				<geom class="D_Vizual" name="V_palm" mesh="palm"/>
				<geom class="DC_Hand" name="C_palm0" type="box" pos="0.011 0 0.038" size=".032 .0111 .049" rgba=".4 .5 .6 .1"/>
				<geom class="DC_Hand" name="C_palm1" type="box" pos="-.032 0 0.014" size=".011 .0111 .025" rgba=".4 .5 .6 .1"/>
				<site name="S_grasp" pos=".007 -.04 0.07" quat="0.0087 -0.6 -0.0034 -0.81" group="4"/>

				<site name="S_finger_grasp" pos="0.004 -.04 0.1" quat="0.0087 -0.6 -0.0034 -0.81" group="4"/>


				<!-- ======= First Finger ======= -->
				<body name="ffknuckle" pos="0.033 0 0.095">
					<inertial pos="-0.000 0.000 0.000" quat="0.520 0.854 0.006 -0.003" mass="0.008" diaginertia="0.00001 0.00001 0.00001"/>
					<joint name="FFJ3" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.436 0.436"  user="1103"/>
					<geom class="D_Vizual" name="V_ffknuckle" mesh="knuckle"/>
					<!--Proximal-->
					<body name="ffproximal" pos="0 0 0">
						<inertial pos="0.000 0.000 0.023" quat="0.707 -0.004 0.004 0.707" mass="0.014" diaginertia="0.00001 0.00001 0.00001"/>
						<joint name="FFJ2" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1102"/>
						<geom class="D_Vizual" name="V_ffproximal" mesh="F3"/>
						<geom class="DC_Hand" name="C_ffproximal" type="capsule" pos="0 0 .0225" size=".01 .0225"/>
						<!--middle-->
						<body name="ffmiddle" pos="0 0 0.045">
							<inertial pos="-0.000 -0.000 0.011" quat="0.707 0.000 -0.000 0.707" mass="0.012" diaginertia="0.00001 0.00001 0.00001"/>
							<joint name="FFJ1" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1101"/>
							<geom class="D_Vizual" name="V_ffmiddle" mesh="F2"/>
							<geom class="DC_Hand" name="C_ffmiddle" type="capsule" pos="0 0 .0125" size=".00805 .0125"/>
							<!--distal-->
							<body name="ffdistal" pos="0 0 0.025">
								<inertial pos="0 -0.000 0.015" quat="0.707 -0.003 0.003 0.707" mass="0.010" diaginertia="0.00001 0.00001 0.00001"/>
								<joint name="FFJ0" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1100"/>
								<geom class="D_Vizual" name="V_ffdistal" pos="0 0 .001" mesh="F1"/>
								<geom class="D_Vizual" name="V_fftip" pos="0 0 .001" mesh="biotac" material='MatVizBioTac'/>
								<!-- <geom class="DC_Hand" name="C_ffdistal" type="capsule" pos="0 0 .012" size=".00705 .012"  condim="4"/> -->
								<geom class="DC_Hand" name="C_ffdistal" type="capsule" pos="0 -.003 .012" size=".0075 .011 " condim="4" euler=".35 0 0"/>
								<geom class="DC_Hand" name="C_fftip" pos="0 0 .001" mesh="biotac" type="mesh" />
								<site name="S_fftip" pos="0.000 0 0.026" group="3"/>
								<site class="D_Touch" name="Tch_fftip"/>
							</body>
						</body>
					</body>
				</body> <!--First Finger End-->



				<!-- ======= Middle Finger ======= -->
				<body name="mfknuckle" pos="0.011 0 0.099">
					<inertial pos="-0.000 0.000 0.000" quat="0.520 0.854 0.006 -0.003" mass="0.008" diaginertia="0.00001 0.00001 0.00001"/>
					<joint name="MFJ3" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.436 0.436"  user="1107"/>
					<geom class="D_Vizual" name="V_mfknuckle" mesh="knuckle"/>
					<!--Proximal-->
					<body name="mfproximal" pos="0 0 0">
						<inertial pos="0.000 0.000 0.023" quat="0.707 -0.004 0.004 0.707" mass="0.014" diaginertia="0.00001 0.00001 0.00001"/>
						<joint name="MFJ2" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1106"/>
						<geom class="D_Vizual" name="V_mfproximal" mesh="F3"/>
						<geom class="DC_Hand" name="C_mfproximal" type="capsule" pos="0 0 .0225" size=".01 .0225"/>
						<!--Middle-->
						<body name="mfmiddle" pos="0 0 0.045">
							<inertial pos="-0.000 -0.000 0.012" quat="0.707 0.000 -0.000 0.707" mass="0.012" diaginertia="0.00001 0.00001 0.00001"/>
							<joint name="MFJ1" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1105"/>
							<geom class="D_Vizual" name="V_mfmiddle" mesh="F2"/>
							<geom class="DC_Hand" name="C_mfmiddle" type="capsule" pos="0 0 .0125" size=".00805 .0125"/>
							<!--Distal-->
							<body name="mfdistal" pos="0 0 0.025">
								<inertial pos="0 -0.000 0.015" quat="0.707 -0.003 0.003 0.707" mass="0.010" diaginertia="0.00001 0.00001 0.00001"/>
								<joint name="MFJ0" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1104"/>
								<geom class="D_Vizual" name="V_mfdistal" mesh="F1"/>
								<geom class="D_Vizual" name="V_mftip" pos="0 0 .001" mesh="biotac" material='MatVizBioTac'/>
								<!-- <geom class="DC_Hand" name="C_mfdistal" type="capsule" pos="0 0 .012" size=".00705 .012"  condim="4"/> -->
								<geom class="DC_Hand" name="C_mfdistal" type="capsule" pos="0 -.003 .012" size=".0075 .011 " condim="4" euler=".35 0 0"/>
								<geom class="DC_Hand" name="C_mftip" pos="0 0 .001" mesh="biotac" type="mesh" />
								<site name="S_mftip" pos="0.000 0 0.026" group="3"/>
								<site class="D_Touch" name="Tch_mftip"/>
							</body>
						</body>
					</body>
				</body> <!--Middle Finger End-->



				<!-- ======= Ring Finger ======= -->
				<body name="rfknuckle" pos="-0.011 0 0.095">
					<inertial pos="-0.000 0.000 0.000" quat="0.520 0.854 0.006 -0.003" mass="0.008" diaginertia="0.00001 0.00001 0.00001"/>
					<joint name="RFJ3" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.436 0.436"  user="1111"/>
					<geom class="D_Vizual" name="V_rfknuckle" mesh="knuckle"/>
					<!--Proximal-->
					<body name="rfproximal" pos="0 0 0">
						<inertial pos="0.000 0.000 0.023" quat="0.707 -0.004 0.004 0.707" mass="0.014" diaginertia="0.00001 0.00001 0.00001"/>
						<joint name="RFJ2" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1110"/>
						<geom class="D_Vizual" name="V_rfproximal" mesh="F3"/>
						<geom class="DC_Hand" name="C_rfproximal" type="capsule" pos="0 0 .0225" size=".01 .0225"/>
						<!--Middle-->
						<body name="rfmiddle" pos="0 0 0.045">
							<inertial pos="-0.000 -0.000 0.012" quat="0.707 0.000 -0.000 0.707" mass="0.012" diaginertia="0.00001 0.00001 0.00001"/>
							<joint name="RFJ1" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1109"/>
							<geom class="D_Vizual" name="V_rfmiddle" mesh="F2"/>
							<geom class="DC_Hand" name="C_rfmiddle" type="capsule" pos="0 0 .0125" size=".00805 .0125"/>
							<!--Distal-->
							<body name="rfdistal" pos="0 0 0.025">
								<inertial pos="0 -0.000 0.015" quat="0.707 -0.003 0.003 0.707" mass="0.010" diaginertia="0.00001 0.00001 0.00001"/>
								<joint name="RFJ0" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1108"/>
								<geom class="D_Vizual" name="V_rfdistal" mesh="F1" pos="0 0 .001"/>
								<geom class="D_Vizual" name="V_rftip" pos="0 0 .001" mesh="biotac" material='MatVizBioTac'/>
								<!-- <geom class="DC_Hand" name="C_rfdistal" type="capsule" pos="0 0 .012" size=".00705 .012"  condim="4"/> -->
								<geom class="DC_Hand" name="C_rfdistal" type="capsule" pos="0 -.003 .012" size=".0075 .011 " condim="4" euler=".35 0 0"/>
								<geom class="DC_Hand" name="C_rftip" pos="0 0 .001" mesh="biotac" type="mesh" />
								<site name="S_rftip" pos="0.000 0 0.026" group="3"/>
								<site class="D_Touch" name="Tch_rftip"/>
							</body>
						</body>
					</body>
				</body> <!--Ring Finger End-->



				<!-- ======= Little Finger ======= -->
				<body name="lfmetacarpal" pos="-0.017 0 0.044">
					<inertial pos="-0.014 0.001 0.014" quat="0.709 -0.092 -0.063 0.696" mass="0.075" diaginertia="0.00001 0.00001 0.00001"/>
					<joint name="LFJ4" type="hinge" pos="0 0 0" axis="0.571 0 0.821" range="0 0.698"  user="1116"/>
					<!--<joint name="LFJ4" type="hinge" pos="0 0 0" axis="0.571 0 0.821" range="0 0.0698"  user="1116"/>-->
					<geom class="D_Vizual" name="V_lfmetacarpal" pos="-0.016 0.000 -0.023" mesh="lfmetacarpal"/>
					<geom class="DC_Hand" name="C_lfmetacarpal" type="box" pos="-.0165 0 0.01" size=".0095 .0111 .025" rgba=".4 .5 .6 .2"/>
					<!--Knuckle-->
					<body name="lfknuckle" pos="-0.017 0 0.044">
						<inertial pos="-0.000 0.000 0.000" quat="0.520 0.854 0.006 -0.003" mass="0.008" diaginertia="0.00001 0.00001 0.00001"/>
						<joint name="LFJ3" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.436 0.436"  user="1115"/>
						<geom class="D_Vizual" name="V_lfknuckle" mesh="knuckle"/>
						<!--Proximal-->
						<body name="lfproximal" pos="0 0 0">
							<inertial pos="0.000 0.000 0.023" quat="0.707 -0.004 0.004 0.707" mass="0.014" diaginertia="0.00001 0.00001 0.00001"/>
							<joint name="LFJ2" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1114"/>
							<geom class="D_Vizual" name="V_lfproximal" mesh="F3"/>
							<geom class="DC_Hand" name="C_lfproximal" type="capsule" pos="0 0 .0225" size=".01 .0225"/>
							<!--Middle-->
							<body name="lfmiddle" pos="0 0 0.045">
								<inertial pos="-0.000 -0.000 0.012" quat="0.707 0.000 -0.000 0.707" mass="0.012" diaginertia="0.00001 0.00001 0.00001"/>
								<joint name="LFJ1" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1113"/>
								<geom class="D_Vizual" name="V_lfmiddle" mesh="F2"/>
								<geom class="DC_Hand" name="C_lfmiddle" type="capsule" pos="0 0 .0125" size=".00805 .0125"/>
								<!--Distal-->
								<body name="lfdistal" pos="0 0 0.025">
									<inertial pos="0 -0.000 0.015" quat="0.707 -0.003 0.003 0.707" mass="0.010" diaginertia="0.00001 0.00001 0.00001"/>
									<joint name="LFJ0" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.571"  user="1112"/>
									<geom class="D_Vizual" name="V_lfdistal" mesh="F1" pos="0 0 .001"/>
									<geom class="D_Vizual" name="V_lftip" pos="0 0 .001" mesh="biotac" material='MatVizBioTac'/>
									<!-- <geom class="DC_Hand" name="C_lfdistal" type="capsule" pos="0 0 .012" size=".00705 .012"  condim="4"/> -->
									<geom class="DC_Hand" name="C_lfdistal" type="capsule" pos="0 -.003 .012" size=".0075 .011 " condim="4" euler=".35 0 0"/>
									<geom class="DC_Hand" name="C_lftip" pos="0 0 .001" mesh="biotac" type="mesh" />
									<site name="S_lftip" pos="0.000 0 0.026" group="3"/>
									<site class="D_Touch" name="Tch_lftip"/>
								</body>
							</body>
						</body>
					</body>
				</body> <!--Little Finger End-->



				<!-- ======= Thumb Finger ======= -->
				<body name="thbase" pos="0.034 -0.009 0.029" axisangle="0  1 0  0.785" >
					<inertial pos="0 0 0" mass="0.010" diaginertia="0.00001 0.00001 0.00001"/>
					<joint name="THJ4" type="hinge" pos="0 0 0" axis="0 0 -1" range="-1.047 1.047"  user="1121"/>
					<geom class="D_Vizual" name="V_thbase" type="box" group="1" pos="0 0 0" size="0.001 0.001 0.001" />
					<!--Proximal-->
					<body name="thproximal" pos="0 0 0">
						<inertial pos="-0.000 -0.000 0.017" quat="0.982 -0.000 0.001 0.191" mass="0.016" diaginertia="0.00001 0.00001 0.00001"/>
						<joint name="THJ3" type="hinge" pos="0 0 0" axis="1 0 0" range="0 1.309"  user="1120"/>
						<geom class="D_Vizual" name="V_thproximal" mesh="TH3_z"/>
						<geom class="DC_Hand" name="C_thproximal" type="capsule" pos="0 0 .019" size=".013 .019" rgba=".4 .5 .6 .1"/>
						<!--Hub-->
						<body name="thhub" pos="0 0 0.038">
							<inertial pos="0 0 0" mass="0.002" diaginertia="0.00001 0.00001 0.00001"/>
							<joint name="THJ2" type="hinge" pos="0 0 0" axis="1 0 0" range="-0.262 0.262"  user="1119"/>
							<geom class="D_Vizual" name="V_thhub" type="box" group="1" pos="0 0 0" size="0.001 0.001 0.001"/>
							<!--Middle-->
							<body name="thmiddle" pos="0 0 0">
								<inertial pos="0.000 -0.000 0.016" quat="1.000 -0.001 -0.007 0.003" mass="0.016" diaginertia="0.00001 0.00001 0.00001"/>
								<joint name="THJ1" type="hinge" pos="0 0 0" axis="0 1 0" range="-0.524 0.524"  user="1118"/>
								<geom class="D_Vizual" name="V_thmiddle" mesh="TH2_z"/>
								<geom class="DC_Hand" name="C_thmiddle" type="capsule" pos="0 0 .016" size=".011 .016"/>
								<!--Distal-->
								<body name="thdistal" pos="0 0 0.032">
									<inertial pos="0.000 -0.000 0.016" quat="0.999 -0.005 -0.047 0.005" mass="0.016" diaginertia="0.00001 0.00001 0.00001"/>
									<joint name="THJ0" type="hinge" pos="0 0 0" axis="0 1 0" range="-1.571 0"  user="1117"/>
									<geom class="D_Vizual" name="V_thdistal" mesh="TH1_z"/>
									<!-- <geom class="DC_Hand" name="C_thdistal" type="capsule" pos="0 0 .013" size=".00918 .013" condim="4"/> -->
									<geom class="D_Vizual" name="V_thtip" pos="0 0 .001" mesh="biotac" material='MatVizBioTac' euler='0 0 -1.57'/>
									<geom class="DC_Hand" name="C_thdistal" type="capsule" pos="-.004 0 .0121" size=".01 .01"  condim="4" euler="0 -.35 0"/>
									<geom class="DC_Hand" name="C_thtip" pos="0 0 .001" mesh="biotac" type="mesh" euler='0 0 -1.57'/>
									<site name="S_thtip" pos="0.000 0 0.0275" group="3"/>
									<site class="D_Touch" name="Tch_thtip" size="0.005 0.011 0.016" pos="-.005 0 0.02" />
								</body>
							</body>
						</body>
					</body>
				</body> <!--Thumb Finger End-->
			</body> <!--Palm Ends-->
		</body> <!--Wrist Ends-->
	</body> <!--Forearm/ Hand Actuation Ends-->

</mujocoinclude>
