Skip to content

Commit

Permalink
Finish shadow_hand demo
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangGiang93 committed Jul 30, 2024
1 parent dac6aa5 commit a276907
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 66 deletions.
136 changes: 72 additions & 64 deletions multiverse/resources/muv/shadow_hands.muv
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,34 @@ simulations:
simulator: mujoco
world:
name: world
path: floor.xml
path: work_table.xml
objects:
# left_hand:
# path: left_hand.xml
# apply:
# body:
# left_shadow_hand:
# pos: [0.0, 0.25, 1.05]
# prefix:
# geom: left_
task_board:
path: task_board.xml
apply:
body:
task_board:
pos: [0.0, 0.0, 1.05]
quat: [-0.7071, 0.0, 0.0, 0.7071]
prefix:
geom: task_board_
task_board_tool:
path: task_board_tool.xml
apply:
body:
task_board_tool:
pos: [-0.102, 0.014, 1.146]
quat: [1.0, 0.0, 0.0, 0.0]
prefix:
geom: task_board_tool_
left_hand:
path: left_hand.xml
apply:
body:
left_shadow_hand:
pos: [0.0, 0.25, 1.05]
prefix:
geom: left_
right_hand:
path: right_hand.xml
apply:
Expand All @@ -32,53 +50,43 @@ simulations:
prefix:
geom: right_
references:
# left_shadow_hand:
# body1: LeftHand_WristRoot
# body2: left_shadow_hand
# lh_thdistal:
# body1: LeftHand_ThumbTip
# body2: lh_thdistal
# torquescale: 0.1
# lh_ffdistal:
# body1: LeftHand_IndexTip
# body2: lh_ffdistal
# torquescale: 0.1
# lh_mfdistal:
# body1: LeftHand_MiddleTip
# body2: lh_mfdistal
# torquescale: 0.1
# lh_rfdistal:
# body1: LeftHand_RingTip
# body2: lh_rfdistal
# torquescale: 0.1
# lh_lfdistal:
# body1: LeftHand_PinkyTip
# body2: lh_lfdistal
# torquescale: 0.1
left_shadow_hand:
body1: LeftHand_WristRoot
body2: lh_wrist_ref
lh_thdistal:
body1: LeftHand_ThumbTip
body2: lh_thdistal_ref
lh_ffdistal:
body1: LeftHand_IndexTip
body2: lh_ffdistal_ref
lh_mfdistal:
body1: LeftHand_MiddleTip
body2: lh_mfdistal_ref
lh_rfdistal:
body1: LeftHand_RingTip
body2: lh_rfdistal_ref
lh_lfdistal:
body1: LeftHand_PinkyTip
body2: lh_lfdistal_ref

right_shadow_hand:
body1: RightHand_WristRoot
body2: rh_wrist_ref
# rh_thdistal:
# body1: RightHand_ThumbTip
# body2: rh_thdistal
# torquescale: 0.1
# rh_ffdistal:
# body1: RightHand_IndexTip
# body2: rh_ffdistal
# torquescale: 0.1
# rh_mfdistal:
# body1: RightHand_MiddleTip
# body2: rh_mfdistal
# torquescale: 0.1
# rh_rfdistal:
# body1: RightHand_RingTip
# body2: rh_rfdistal
# torquescale: 0.1
# rh_lfdistal:
# body1: RightHand_PinkyTip
# body2: rh_lfdistal
# torquescale: 0.1
rh_thdistal:
body1: RightHand_ThumbTip
body2: rh_thdistal_ref
rh_ffdistal:
body1: RightHand_IndexTip
body2: rh_ffdistal_ref
rh_mfdistal:
body1: RightHand_MiddleTip
body2: rh_mfdistal_ref
rh_rfdistal:
body1: RightHand_RingTip
body2: rh_rfdistal_ref
rh_lfdistal:
body1: RightHand_PinkyTip
body2: rh_lfdistal_ref

config:
max_time_step: 0.002
Expand All @@ -95,20 +103,20 @@ multiverse_clients:
body: ["position", "quaternion"]
joint: ["joint_rvalue", "joint_tvalue", "joint_linear_velocity", "joint_angular_velocity", "joint_force", "joint_torque"]
receive:
# LeftHand_WristRoot: ["position", "quaternion"]
# LeftHand_ThumbTip: ["position", "quaternion"]
# LeftHand_IndexTip: ["position", "quaternion"]
# LeftHand_MiddleTip: ["position", "quaternion"]
# LeftHand_RingTip: ["position", "quaternion"]
# LeftHand_PinkyTip: ["position", "quaternion"]
LeftHand_WristRoot: ["position", "quaternion"]
LeftHand_ThumbTip: ["position", "quaternion"]
LeftHand_IndexTip: ["position", "quaternion"]
LeftHand_MiddleTip: ["position", "quaternion"]
LeftHand_RingTip: ["position", "quaternion"]
LeftHand_PinkyTip: ["position", "quaternion"]
RightHand_WristRoot: ["position", "quaternion"]
# RightHand_ThumbTip: ["position", "quaternion"]
# RightHand_IndexTip: ["position", "quaternion"]
# RightHand_MiddleTip: ["position", "quaternion"]
# RightHand_RingTip: ["position", "quaternion"]
# RightHand_PinkyTip: ["position", "quaternion"]
RightHand_ThumbTip: ["position", "quaternion"]
RightHand_IndexTip: ["position", "quaternion"]
RightHand_MiddleTip: ["position", "quaternion"]
RightHand_RingTip: ["position", "quaternion"]
RightHand_PinkyTip: ["position", "quaternion"]

# ros:
# ros2:
# ros_nodes:
# publishers:
# tf:
Expand Down
18 changes: 18 additions & 0 deletions multiverse/resources/robots/shadow_hand/left_hand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
<geom class="left_plastic_collision" size="0.035 0.035 0.035" pos="0.01 0.0 0.181" quat="0.380188 0.924909 0 0"
type="box"/>
<body name="lh_wrist" pos="0.01 0 0.21301" quat="1 0 0 1">
<body name="lh_wrist_ref" quat="0 1 0 1" pos="0 0 0.03" >
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_wrist" material="metallic"/> -->
</body>
<inertial mass="0.1" pos="0 0 0.029" quat="0.5 0.5 0.5 0.5" diaginertia="6.4e-05 4.38e-05 3.5e-05"/>
<joint class="left_wrist_y" name="lh_WRJ2"/>
<geom class="left_plastic_visual" mesh="left_wrist" material="metallic"/>
Expand Down Expand Up @@ -144,6 +147,9 @@
<geom class="left_plastic_visual" mesh="left_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="left_plastic_collision"/>
<body name="lh_ffdistal" pos="0 0 0.025">
<body name="lh_ffdistal_ref" quat="0 1 0 1">
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="lh_FFJ1" class="left_middle_distal"/>
Expand All @@ -169,6 +175,9 @@
<geom class="left_plastic_visual" mesh="left_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="left_plastic_collision"/>
<body name="lh_mfdistal" pos="0 0 0.025">
<body name="lh_mfdistal_ref" quat="0 1 0 1">
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="lh_MFJ1" class="left_middle_distal"/>
Expand All @@ -194,6 +203,9 @@
<geom class="left_plastic_visual" mesh="left_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="left_plastic_collision"/>
<body name="lh_rfdistal" pos="0 0 0.025">
<body name="lh_rfdistal_ref" quat="0 1 0 1">
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="lh_RFJ1" class="left_middle_distal"/>
Expand Down Expand Up @@ -224,6 +236,9 @@
<geom class="left_plastic_visual" mesh="left_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="left_plastic_collision"/>
<body name="lh_lfdistal" pos="0 0 0.025">
<body name="lh_lfdistal_ref" quat="0 1 0 1">
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="lh_LFJ1" class="left_middle_distal"/>
Expand Down Expand Up @@ -254,6 +269,9 @@
<geom size="0.009 0.009" pos="0 0 0.012" type="capsule" class="left_plastic_collision"/>
<geom size="0.01" pos="0 0 0.03" class="left_plastic_collision"/>
<body name="lh_thdistal" pos="0 0 0.032" quat="1 0 0 -1">
<body name="lh_thdistal_ref" quat="0 1 0 1">
<!-- <geom class="left_plastic_visual" quat="0 -1 0 -1" mesh="left_th_distal_pst"/> -->
</body>
<inertial mass="0.017" pos="0 0 0.0145588" quat="1 0 0 1"
diaginertia="2.37794e-06 2.27794e-06 1e-06"/>
<joint name="lh_THJ1" class="left_thdistal"/>
Expand Down
21 changes: 19 additions & 2 deletions multiverse/resources/robots/shadow_hand/right_hand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,17 @@
<worldbody>
<body name="right_shadow_hand">
<freejoint/>
<body name="rh_forearm" childclass="right_hand" quat="0 1 0 1">
<body name="rh_forearm" childclass="right_hand" quat="1 0 0 0">
<inertial mass="3" pos="0 0 0.09" diaginertia="0.0138 0.0138 0.00744"/>
<geom class="right_plastic_visual" mesh="right_forearm_0" material="gray"/>
<geom class="right_plastic_visual" mesh="right_forearm_1"/>
<geom class="right_plastic_collision" type="mesh" mesh="right_forearm_collision"/>
<geom class="right_plastic_collision" size="0.035 0.035 0.035" pos="0.01 0.0 0.181" quat="0.380188 0.924909 0 0"
type="box"/>
<body name="rh_wrist_ref" pos="0.01 0 0.21301" quat="1 -1 1 1"/>
<body name="rh_wrist" pos="0.01 0 0.21301" quat="1 0 0 1">
<body name="rh_wrist_ref" pos="0 0 0.03" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_wrist" material="metallic"/> -->
</body>
<inertial mass="0.1" pos="0 0 0.029" quat="0.5 0.5 0.5 0.5" diaginertia="6.4e-05 4.38e-05 3.5e-05"/>
<joint class="right_wrist_y" name="rh_WRJ2"/>
<geom class="right_plastic_visual" mesh="right_wrist" material="metallic"/>
Expand Down Expand Up @@ -146,6 +148,9 @@
<geom class="right_plastic_visual" mesh="right_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="right_plastic_collision"/>
<body name="rh_ffdistal" pos="0 0 0.025">
<body name ="rh_ffdistal_ref" pos="0 0 0" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="rh_FFJ1" class="right_middle_distal"/>
Expand All @@ -171,6 +176,9 @@
<geom class="right_plastic_visual" mesh="right_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="right_plastic_collision"/>
<body name="rh_mfdistal" pos="0 0 0.025">
<body name ="rh_mfdistal_ref" pos="0 0 0" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="rh_MFJ1" class="right_middle_distal"/>
Expand All @@ -196,6 +204,9 @@
<geom class="right_plastic_visual" mesh="right_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="right_plastic_collision"/>
<body name="rh_rfdistal" pos="0 0 0.025">
<body name ="rh_rfdistal_ref" pos="0 0 0" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="rh_RFJ1" class="right_middle_distal"/>
Expand Down Expand Up @@ -226,6 +237,9 @@
<geom class="right_plastic_visual" mesh="right_f_middle"/>
<geom size="0.009 0.0125" pos="0 0 0.0125" type="capsule" class="right_plastic_collision"/>
<body name="rh_lfdistal" pos="0 0 0.025">
<body name ="rh_lfdistal_ref" pos="0 0 0" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_f_distal_pst"/> -->
</body>
<inertial mass="0.013" pos="0 0 0.0130769" quat="1 0 0 1"
diaginertia="1.28092e-06 1.12092e-06 5.3e-07"/>
<joint name="rh_LFJ1" class="right_middle_distal"/>
Expand Down Expand Up @@ -256,6 +270,9 @@
<geom size="0.009 0.009" pos="0 0 0.012" type="capsule" class="right_plastic_collision"/>
<geom size="0.01" pos="0 0 0.03" class="right_plastic_collision"/>
<body name="rh_thdistal" pos="0 0 0.032" quat="1 0 0 -1">
<body name ="rh_thdistal_ref" pos="0 0 0" quat="1 0 1 0">
<!-- <geom class="right_plastic_visual" quat="-1 0 1 0" mesh="right_th_distal_pst"/> -->
</body>
<inertial mass="0.017" pos="0 0 0.0145588" quat="1 0 0 1"
diaginertia="2.37794e-06 2.27794e-06 1e-06"/>
<joint name="rh_THJ1" class="right_thdistal"/>
Expand Down

0 comments on commit a276907

Please sign in to comment.