Organize hand models and launchers; use linear active joint mapping

This commit is contained in:
2026-09-28 11:05:30 +08:00
parent 325dff6870
commit 01c9aa5c7a
712 changed files with 205077 additions and 6209 deletions
+10
View File
@@ -0,0 +1,10 @@
# O6
[统一入口与映射说明](../README.md)
- `compare_left.sh`
- `compare_right.sh`
- `run_left.sh`
- `run_right.sh`
`assets/` 是包内模型链接;`scripts/` 为内部实现及辅助工具。
+1
View File
@@ -0,0 +1 @@
../../src/linkerhand-sim/linker_hand_mujoco_ros2/linker_hand_mujoco_ros2/urdf/O6
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/run_o6_left_dual_compare.sh" "$@"
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/run_o6_right_dual_compare.sh" "$@"
+666
View File
@@ -0,0 +1,666 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="linkerhand_o6_left">
<material name="silver">
<color rgba="0.5 0.5 0.52 1.0"/>
</material>
<material name="BlackAccent">
<color rgba="0.15 0.15 0.15 1.0"/>
</material>
<link
name="lh_hand_base_link">
<inertial>
<origin
xyz="-0.00157788568070457 -0.00034876725935859 0.0538452219801211"
rpy="0 0 0" />
<mass
value="0.0672935238166485" />
<inertia
ixx="5.22525212160954E-05"
ixy="3.06955729584715E-07"
ixz="-3.90341166950521E-07"
iyy="3.33522349207724E-05"
iyz="-7.76680063574627E-07"
izz="2.28469461105385E-05" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
</collision>
</link>
<link
name="lh_thumb_metacarpals_base2">
<inertial>
<origin
xyz="0.00162800681276937 -0.0027668017246415 -0.00184234438641236"
rpy="0 0 0" />
<mass
value="0.00138588296544333" />
<inertia
ixx="5.26292160685909E-08"
ixy="-3.92888681640568E-09"
ixz="-2.43767371295222E-09"
iyy="4.82620491570326E-08"
iyz="3.71869784206147E-09"
izz="2.88550286112821E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
<material name="BlackAccent"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_cmc_yaw"
type="revolute">
<origin
xyz="0.011508 -0.022975 0.032794"
rpy="0 0 0.167545678324764" />
<parent
link="lh_hand_base_link" />
<child
link="lh_thumb_metacarpals_base2" />
<axis
xyz="0 0 1" />
<limit
lower="0"
upper="1.2431454"
effort="100"
velocity="1" />
</joint>
<link
name="lh_thumb_metacarpals">
<inertial>
<origin
xyz="4.24816204999817E-05 1.74183907812875E-05 0.0228341640631254"
rpy="0 0 0" />
<mass
value="0.0123381586619931" />
<inertia
ixx="1.10292537368909E-06"
ixy="-5.99642232777877E-10"
ixz="-1.14233573940545E-07"
iyy="1.76757772551884E-06"
iyz="-4.03963570823777E-10"
izz="9.36347792411098E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_cmc_pitch"
type="revolute">
<origin
xyz="0.0061649 -0.010678 -0.004891"
rpy="0 -1.1529 2.0944" />
<parent
link="lh_thumb_metacarpals_base2" />
<child
link="lh_thumb_metacarpals" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="0.588901345"
effort="100"
velocity="1" />
</joint>
<link
name="lh_thumb_distal">
<inertial>
<origin
xyz="-0.00413725702921841 -5.90704520436747E-08 0.023011401589736"
rpy="0 0 0" />
<mass
value="0.00763332957284057" />
<inertia
ixx="1.3057487813702E-06"
ixy="-1.19781508112714E-11"
ixz="-7.19551697268541E-08"
iyy="1.2248908905341E-06"
iyz="4.55347974652679E-12"
izz="2.77271910592615E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_ip"
type="revolute">
<origin
xyz="0.0037776 0 0.045368"
rpy="0 0 0" />
<parent
link="lh_thumb_metacarpals" />
<child
link="lh_thumb_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.16064834"
effort="100"
velocity="1" />
<mimic
joint="lh_thumb_cmc_pitch"
multiplier="1.96832996705076"
offset="0" />
</joint>
<link
name="lh_index_proximal">
<inertial>
<origin
xyz="-0.00208656556336452 2.53838713251686E-06 0.0172734941980264"
rpy="0 0 0" />
<mass
value="0.00253174651934627" />
<inertia
ixx="2.65988714157799E-07"
ixy="-1.67174578825824E-11"
ixz="-4.31047725546034E-08"
iyy="2.72914069166233E-07"
iyz="1.8756709532167E-10"
izz="8.56017305636748E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_index_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 -0.02419 0.098779"
rpy="0.05236 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_index_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="lh_index_distal">
<inertial>
<origin
xyz="0.00658986616416549 5.13855642059191E-06 0.0194393600039178"
rpy="0 0 0" />
<mass
value="0.00376951085886838" />
<inertia
ixx="3.22347106085043E-07"
ixy="1.3801788663582E-11"
ixz="1.14352857317951E-07"
iyy="3.65328133721509E-07"
iyz="-2.11505011705634E-10"
izz="1.24287996386442E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_index_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_index_proximal" />
<child
link="lh_index_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="lh_index_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="lh_middle_proximal">
<inertial>
<origin
xyz="-0.00208660654138235 2.56918180119303E-06 0.0172735011723351"
rpy="0 0 0" />
<mass
value="0.00253177375206983" />
<inertia
ixx="2.65989021304483E-07"
ixy="-1.69816046635662E-11"
ixz="-4.31046683215273E-08"
iyy="2.72914402745606E-07"
iyz="1.87484652324395E-10"
izz="8.5602213431865E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_middle_mcp_pitch"
type="revolute">
<origin
xyz="0.00052576 -0.00634 0.1027"
rpy="0 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_middle_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="lh_middle_distal">
<inertial>
<origin
xyz="0.00658986516319194 5.10862924271716E-06 0.0194393315699782"
rpy="0 0 0" />
<mass
value="0.00376952789210256" />
<inertia
ixx="3.22348591068053E-07"
ixy="1.37122394856588E-11"
ixz="1.1435291391668E-07"
iyy="3.65329535087755E-07"
iyz="-2.10453810291991E-10"
izz="1.24288425862546E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_middle_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_middle_proximal" />
<child
link="lh_middle_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="lh_middle_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="lh_ring_proximal">
<inertial>
<origin
xyz="-0.00208667931345812 2.63000419462034E-06 0.0172734926448377"
rpy="0 0 0" />
<mass
value="0.00253182223645066" />
<inertia
ixx="2.65989756076584E-07"
ixy="-1.74912952703656E-11"
ixz="-4.31043325594253E-08"
iyy="2.7291510093393E-07"
iyz="1.87158326740895E-10"
izz="8.56031522765909E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_ring_mcp_pitch"
type="revolute">
<origin
xyz="0.0010258 0.011135 0.098767"
rpy="-0.05236 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_ring_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="lh_ring_distal">
<inertial>
<origin
xyz="0.00658986648895491 5.05883528165163E-06 0.019439397215532"
rpy="0 0 0" />
<mass
value="0.00376949588316609" />
<inertia
ixx="3.2234524157181E-07"
ixy="1.35766976056011E-11"
ixz="1.14353011012842E-07"
iyy="3.65326570102147E-07"
iyz="-2.08672149138738E-10"
izz="1.24287770218135E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_ring_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_ring_proximal" />
<child
link="lh_ring_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="lh_ring_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="lh_pinky_proximal">
<inertial>
<origin
xyz="-0.00208673599799501 2.68062251165824E-06 0.0172734848131236"
rpy="0 0 0" />
<mass
value="0.00253185993162408" />
<inertia
ixx="2.6599033687183E-07"
ixy="-1.79030790016555E-11"
ixz="-4.31040829565781E-08"
iyy="2.72915617381577E-07"
iyz="1.86906787420486E-10"
izz="8.56039175034871E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_pinky_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 0.028372 0.092741"
rpy="-0.087266 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_pinky_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="lh_pinky_distal">
<inertial>
<origin
xyz="0.00658987588903027 5.03087534178825E-06 0.0194394491065091"
rpy="0 0 0" />
<mass
value="0.00376948071276134" />
<inertia
ixx="3.22343583730488E-07"
ixy="1.35768173270357E-11"
ixz="1.14353289593012E-07"
iyy="3.65325180884183E-07"
iyz="-2.0744198062439E-10"
izz="1.24287567374229E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_pinky_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_pinky_proximal" />
<child
link="lh_pinky_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="lh_pinky_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
</robot>
+666
View File
@@ -0,0 +1,666 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="linkerhand_o6_left">
<material name="silver">
<color rgba="0.5 0.5 0.52 1.0"/>
</material>
<material name="BlackAccent">
<color rgba="0.15 0.15 0.15 1.0"/>
</material>
<link
name="lh_hand_base_link">
<inertial>
<origin
xyz="-0.00157788568070457 -0.00034876725935859 0.0538452219801211"
rpy="0 0 0" />
<mass
value="0.0672935238166485" />
<inertia
ixx="5.22525212160954E-05"
ixy="3.06955729584715E-07"
ixz="-3.90341166950521E-07"
iyy="3.33522349207724E-05"
iyz="-7.76680063574627E-07"
izz="2.28469461105385E-05" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
</collision>
</link>
<link
name="lh_thumb_metacarpals_base2">
<inertial>
<origin
xyz="0.00162800681276937 -0.0027668017246415 -0.00184234438641236"
rpy="0 0 0" />
<mass
value="0.00138588296544333" />
<inertia
ixx="5.26292160685909E-08"
ixy="-3.92888681640568E-09"
ixz="-2.43767371295222E-09"
iyy="4.82620491570326E-08"
iyz="3.71869784206147E-09"
izz="2.88550286112821E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
<material name="BlackAccent"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_cmc_yaw"
type="revolute">
<origin
xyz="0.011508 -0.022975 0.032794"
rpy="0 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_thumb_metacarpals_base2" />
<axis
xyz="0 0 1" />
<limit
lower="0"
upper="1.3"
effort="100"
velocity="1" />
</joint>
<link
name="lh_thumb_metacarpals">
<inertial>
<origin
xyz="4.24816204999817E-05 1.74183907812875E-05 0.0228341640631254"
rpy="0 0 0" />
<mass
value="0.0123381586619931" />
<inertia
ixx="1.10292537368909E-06"
ixy="-5.99642232777877E-10"
ixz="-1.14233573940545E-07"
iyy="1.76757772551884E-06"
iyz="-4.03963570823777E-10"
izz="9.36347792411098E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_cmc_pitch"
type="revolute">
<origin
xyz="0.0061649 -0.010678 -0.004891"
rpy="0 -1.1529 2.0944" />
<parent
link="lh_thumb_metacarpals_base2" />
<child
link="lh_thumb_metacarpals" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="0.58"
effort="100"
velocity="1" />
</joint>
<link
name="lh_thumb_distal">
<inertial>
<origin
xyz="-0.00413725702921841 -5.90704520436747E-08 0.023011401589736"
rpy="0 0 0" />
<mass
value="0.00763332957284057" />
<inertia
ixx="1.3057487813702E-06"
ixy="-1.19781508112714E-11"
ixz="-7.19551697268541E-08"
iyy="1.2248908905341E-06"
iyz="4.55347974652679E-12"
izz="2.77271910592615E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_thumb_ip"
type="revolute">
<origin
xyz="0.0037776 0 0.045368"
rpy="0 0 0" />
<parent
link="lh_thumb_metacarpals" />
<child
link="lh_thumb_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.08"
effort="100"
velocity="1" />
<mimic
joint="lh_thumb_cmc_pitch"
multiplier="2.29"
offset="0" />
</joint>
<link
name="lh_index_proximal">
<inertial>
<origin
xyz="-0.00208656556336452 2.53838713251686E-06 0.0172734941980264"
rpy="0 0 0" />
<mass
value="0.00253174651934627" />
<inertia
ixx="2.65988714157799E-07"
ixy="-1.67174578825824E-11"
ixz="-4.31047725546034E-08"
iyy="2.72914069166233E-07"
iyz="1.8756709532167E-10"
izz="8.56017305636748E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_index_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 -0.02419 0.098779"
rpy="0.05236 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_index_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="lh_index_distal">
<inertial>
<origin
xyz="0.00658986616416549 5.13855642059191E-06 0.0194393600039178"
rpy="0 0 0" />
<mass
value="0.00376951085886838" />
<inertia
ixx="3.22347106085043E-07"
ixy="1.3801788663582E-11"
ixz="1.14352857317951E-07"
iyy="3.65328133721509E-07"
iyz="-2.11505011705634E-10"
izz="1.24287996386442E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_index_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_index_proximal" />
<child
link="lh_index_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="lh_index_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="lh_middle_proximal">
<inertial>
<origin
xyz="-0.00208660654138235 2.56918180119303E-06 0.0172735011723351"
rpy="0 0 0" />
<mass
value="0.00253177375206983" />
<inertia
ixx="2.65989021304483E-07"
ixy="-1.69816046635662E-11"
ixz="-4.31046683215273E-08"
iyy="2.72914402745606E-07"
iyz="1.87484652324395E-10"
izz="8.5602213431865E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_middle_mcp_pitch"
type="revolute">
<origin
xyz="0.00052576 -0.00634 0.1027"
rpy="0 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_middle_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="lh_middle_distal">
<inertial>
<origin
xyz="0.00658986516319194 5.10862924271716E-06 0.0194393315699782"
rpy="0 0 0" />
<mass
value="0.00376952789210256" />
<inertia
ixx="3.22348591068053E-07"
ixy="1.37122394856588E-11"
ixz="1.1435291391668E-07"
iyy="3.65329535087755E-07"
iyz="-2.10453810291991E-10"
izz="1.24288425862546E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_middle_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_middle_proximal" />
<child
link="lh_middle_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="lh_middle_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="lh_ring_proximal">
<inertial>
<origin
xyz="-0.00208667931345812 2.63000419462034E-06 0.0172734926448377"
rpy="0 0 0" />
<mass
value="0.00253182223645066" />
<inertia
ixx="2.65989756076584E-07"
ixy="-1.74912952703656E-11"
ixz="-4.31043325594253E-08"
iyy="2.7291510093393E-07"
iyz="1.87158326740895E-10"
izz="8.56031522765909E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_ring_mcp_pitch"
type="revolute">
<origin
xyz="0.0010258 0.011135 0.098767"
rpy="-0.05236 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_ring_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="lh_ring_distal">
<inertial>
<origin
xyz="0.00658986648895491 5.05883528165163E-06 0.019439397215532"
rpy="0 0 0" />
<mass
value="0.00376949588316609" />
<inertia
ixx="3.2234524157181E-07"
ixy="1.35766976056011E-11"
ixz="1.14353011012842E-07"
iyy="3.65326570102147E-07"
iyz="-2.08672149138738E-10"
izz="1.24287770218135E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_ring_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_ring_proximal" />
<child
link="lh_ring_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="lh_ring_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="lh_pinky_proximal">
<inertial>
<origin
xyz="-0.00208673599799501 2.68062251165824E-06 0.0172734848131236"
rpy="0 0 0" />
<mass
value="0.00253185993162408" />
<inertia
ixx="2.6599033687183E-07"
ixy="-1.79030790016555E-11"
ixz="-4.31040829565781E-08"
iyy="2.72915617381577E-07"
iyz="1.86906787420486E-10"
izz="8.56039175034871E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_pinky_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 0.028372 0.092741"
rpy="-0.087266 0 0" />
<parent
link="lh_hand_base_link" />
<child
link="lh_pinky_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="lh_pinky_distal">
<inertial>
<origin
xyz="0.00658987588903027 5.03087534178825E-06 0.0194394491065091"
rpy="0 0 0" />
<mass
value="0.00376948071276134" />
<inertia
ixx="3.22343583730488E-07"
ixy="1.35768173270357E-11"
ixz="1.14353289593012E-07"
iyy="3.65325180884183E-07"
iyz="-2.0744198062439E-10"
izz="1.24287567374229E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="lh_pinky_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="lh_pinky_proximal" />
<child
link="lh_pinky_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="lh_pinky_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
</robot>
+664
View File
@@ -0,0 +1,664 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="linkerhand_o6_right">
<material name="silver">
<color rgba="0.5 0.5 0.52 1.0"/>
</material>
<material name="BlackAccent">
<color rgba="0.15 0.15 0.15 1.0"/>
</material>
<link
name="rh_hand_base_link">
<inertial>
<origin
xyz="-0.00160320773490556 0.000358462699237561 0.0538002704027215"
rpy="0 0 0" />
<mass
value="0.06740077960995" />
<inertia
ixx="5.22359941041901E-05"
ixy="3.0391535852764E-07"
ixz="3.88322215371643E-07"
iyy="3.33473043513648E-05"
iyz="-7.77555280794861E-07"
izz="2.28342677422006E-05" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
</collision>
</link>
<link
name="rh_thumb_metacarpals_base2">
<inertial>
<origin
xyz="0.00162795738393507 0.00276671978336815 -0.00184227725602707"
rpy="0 0 0" />
<mass
value="0.00138591070212997" />
<inertia
ixx="5.26294625624223E-08"
ixy="-3.9288013799604E-09"
ixz="2.43766268199571E-09"
iyy="4.82623724532942E-08"
iyz="3.71867754115443E-09"
izz="2.88555522060562E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
<material name="BlackAccent"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_cmc_yaw"
type="revolute">
<origin
xyz="0.011508 0.022975 0.032794"
rpy="0 0 -0.167545678324764" />
<parent
link="rh_hand_base_link" />
<child
link="rh_thumb_metacarpals_base2" />
<axis
xyz="0 0 -1" />
<limit
lower="0"
upper="1.2431454"
effort="100"
velocity="1" />
</joint>
<link
name="rh_thumb_metacarpals">
<inertial>
<origin
xyz="4.24920612856275E-05 -1.67885666835232E-05 0.0228341522590467"
rpy="0 0 0" />
<mass
value="0.0123381607727595" />
<inertia
ixx="1.10292488693766E-06"
ixy="-6.14241939151719E-10"
ixz="1.14233108676795E-07"
iyy="1.76757658485787E-06"
iyz="-4.24576599367025E-10"
izz="9.36348143657406E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_cmc_pitch"
type="revolute">
<origin
xyz="0.0061649 0.010678 -0.004891"
rpy="0 -1.1529 -2.0944" />
<parent
link="rh_thumb_metacarpals_base2" />
<child
link="rh_thumb_metacarpals" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="0.588901345"
effort="100"
velocity="1" />
</joint>
<link
name="rh_thumb_distal">
<inertial>
<origin
xyz="-0.00413690727496815 -4.54842793429222E-07 0.0230097179163771"
rpy="0 0 0" />
<mass
value="0.00763302603723749" />
<inertia
ixx="1.30546842791578E-06"
ixy="-2.61617511029467E-12"
ixz="7.19030685242407E-08"
iyy="1.22457212713176E-06"
iyz="1.66931068485225E-11"
izz="2.7729897944409E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_ip"
type="revolute">
<origin
xyz="0.0037776 0 0.045368"
rpy="0 0 0" />
<parent
link="rh_thumb_metacarpals" />
<child
link="rh_thumb_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.16064834"
effort="100"
velocity="1" />
<mimic
joint="rh_thumb_cmc_pitch"
multiplier="1.96832996705076"
offset="0" />
</joint>
<link
name="rh_index_proximal">
<inertial>
<origin
xyz="-0.00208665596033792 -4.8964990644329E-06 0.0172736718900068"
rpy="0 0 0" />
<mass
value="0.00253178529301663" />
<inertia
ixx="2.65990159539482E-07"
ixy="-3.55165625722842E-11"
ixz="4.31046335852167E-08"
iyy="2.72915460277804E-07"
iyz="1.75935978708959E-10"
izz="8.56026306687528E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_index_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 0.02419 0.098779"
rpy="-0.05236 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_index_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="rh_index_distal">
<inertial>
<origin
xyz="0.00658940011630532 -4.59976557022623E-06 0.0194434136420913"
rpy="0 0 0" />
<mass
value="0.00376787129082313" />
<inertia
ixx="3.22116619426455E-07"
ixy="1.03152735699049E-11"
ixz="-1.14363506430985E-07"
iyy="3.65131844686317E-07"
iyz="-1.97263639269362E-10"
izz="1.24256890612907E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_index_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_index_proximal" />
<child
link="rh_index_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="rh_index_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="rh_middle_proximal">
<inertial>
<origin
xyz="-0.00208661081773556 -4.93451838476378E-06 0.0172736805321904"
rpy="0 0 0" />
<mass
value="0.00253175497594429" />
<inertia
ixx="2.65989683690695E-07"
ixy="-3.58343951791586E-11"
ixz="4.31048601085216E-08"
iyy="2.72915006047006E-07"
iyz="1.75718024412593E-10"
izz="8.56020467202518E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_middle_mcp_pitch"
type="revolute">
<origin
xyz="0.00052576 0.00634 0.1027"
rpy="0 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_middle_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="rh_middle_distal">
<inertial>
<origin
xyz="0.00658940304809306 -4.5885743593238E-06 0.0194434523296449"
rpy="0 0 0" />
<mass
value="0.00376786259758948" />
<inertia
ixx="3.221153658306E-07"
ixy="1.02639617308432E-11"
ixz="-1.14363547272711E-07"
iyy="3.65130723083104E-07"
iyz="-1.96904618797577E-10"
izz="1.24256787913797E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_middle_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_middle_proximal" />
<child
link="rh_middle_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="rh_middle_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="rh_ring_proximal">
<inertial>
<origin
xyz="-0.00208654311325356 -4.98538564003281E-06 0.0172736743497407"
rpy="0 0 0" />
<mass
value="0.00253170963529411" />
<inertia
ixx="2.6598913795678E-07"
ixy="-3.62757108675266E-11"
ixz="4.31050611555507E-08"
iyy="2.72914417061517E-07"
iyz="1.75554984053478E-10"
izz="8.56012458677515E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_ring_mcp_pitch"
type="revolute">
<origin
xyz="0.0010258 -0.011135 0.098767"
rpy="0.05236 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_ring_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="rh_ring_distal">
<inertial>
<origin
xyz="0.00658940273069729 -4.56628863591824E-06 0.0194435005686854"
rpy="0 0 0" />
<mass
value="0.0037678395356105" />
<inertia
ixx="3.22112632437858E-07"
ixy="1.01848408913558E-11"
ixz="-1.1436348915342E-07"
iyy="3.65128262095686E-07"
iyz="-1.96145632992445E-10"
izz="1.24256284608064E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_ring_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_ring_proximal" />
<child
link="rh_ring_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="rh_ring_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
<link
name="rh_pinky_proximal">
<inertial>
<origin
xyz="-0.00208649034130813 -5.02314582560837E-06 0.0172736680793697"
rpy="0 0 0" />
<mass
value="0.00253167400540778" />
<inertia
ixx="2.65988718820404E-07"
ixy="-3.66012295280295E-11"
ixz="4.31052220484445E-08"
iyy="2.72913936904813E-07"
iyz="1.75447396222308E-10"
izz="8.56006424720129E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_pinky_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 -0.028372 0.092741"
rpy="0.087266 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_pinky_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.609333425"
effort="100"
velocity="1" />
</joint>
<link
name="rh_pinky_distal">
<inertial>
<origin
xyz="0.00658940431519205 -4.55268314210333E-06 0.0194435341098305"
rpy="0 0 0" />
<mass
value="0.00376782669873412" />
<inertia
ixx="3.22111112339498E-07"
ixy="1.01707985908333E-11"
ixz="-1.14363524419061E-07"
iyy="3.65126916899176E-07"
iyz="-1.95589215866356E-10"
izz="1.24256004854426E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_pinky_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_pinky_proximal" />
<child
link="rh_pinky_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.49597186651782"
effort="100"
velocity="1" />
<mimic
joint="rh_pinky_mcp_pitch"
multiplier="0.904318245922221"
offset="0" />
</joint>
</robot>
+664
View File
@@ -0,0 +1,664 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot
name="linkerhand_o6_right">
<material name="silver">
<color rgba="0.5 0.5 0.52 1.0"/>
</material>
<material name="BlackAccent">
<color rgba="0.15 0.15 0.15 1.0"/>
</material>
<link
name="rh_hand_base_link">
<inertial>
<origin
xyz="-0.00160320773490556 0.000358462699237561 0.0538002704027215"
rpy="0 0 0" />
<mass
value="0.06740077960995" />
<inertia
ixx="5.22359941041901E-05"
ixy="3.0391535852764E-07"
ixz="3.88322215371643E-07"
iyy="3.33473043513648E-05"
iyz="-7.77555280794861E-07"
izz="2.28342677422006E-05" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/hand_base_link.STL" />
</geometry>
</collision>
</link>
<link
name="rh_thumb_metacarpals_base2">
<inertial>
<origin
xyz="0.00162795738393507 0.00276671978336815 -0.00184227725602707"
rpy="0 0 0" />
<mass
value="0.00138591070212997" />
<inertia
ixx="5.26294625624223E-08"
ixy="-3.9288013799604E-09"
ixz="2.43766268199571E-09"
iyy="4.82623724532942E-08"
iyz="3.71867754115443E-09"
izz="2.88555522060562E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
<material name="BlackAccent"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals_base2.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_cmc_yaw"
type="revolute">
<origin
xyz="0.011508 0.022975 0.032794"
rpy="0 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_thumb_metacarpals_base2" />
<axis
xyz="0 0 -1" />
<limit
lower="0"
upper="1.36"
effort="100"
velocity="1" />
</joint>
<link
name="rh_thumb_metacarpals">
<inertial>
<origin
xyz="4.24920612856275E-05 -1.67885666835232E-05 0.0228341522590467"
rpy="0 0 0" />
<mass
value="0.0123381607727595" />
<inertia
ixx="1.10292488693766E-06"
ixy="-6.14241939151719E-10"
ixz="1.14233108676795E-07"
iyy="1.76757658485787E-06"
iyz="-4.24576599367025E-10"
izz="9.36348143657406E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_metacarpals.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_cmc_pitch"
type="revolute">
<origin
xyz="0.0061649 0.010678 -0.004891"
rpy="0 -1.1529 -2.0944" />
<parent
link="rh_thumb_metacarpals_base2" />
<child
link="rh_thumb_metacarpals" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="0.58"
effort="100"
velocity="1" />
</joint>
<link
name="rh_thumb_distal">
<inertial>
<origin
xyz="-0.00413690727496815 -4.54842793429222E-07 0.0230097179163771"
rpy="0 0 0" />
<mass
value="0.00763302603723749" />
<inertia
ixx="1.30546842791578E-06"
ixy="-2.61617511029467E-12"
ixz="7.19030685242407E-08"
iyy="1.22457212713176E-06"
iyz="1.66931068485225E-11"
izz="2.7729897944409E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/thumb_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_thumb_ip"
type="revolute">
<origin
xyz="0.0037776 0 0.045368"
rpy="0 0 0" />
<parent
link="rh_thumb_metacarpals" />
<child
link="rh_thumb_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.08"
effort="100"
velocity="1" />
<mimic
joint="rh_thumb_cmc_pitch"
multiplier="1.86"
offset="0" />
</joint>
<link
name="rh_index_proximal">
<inertial>
<origin
xyz="-0.00208665596033792 -4.8964990644329E-06 0.0172736718900068"
rpy="0 0 0" />
<mass
value="0.00253178529301663" />
<inertia
ixx="2.65990159539482E-07"
ixy="-3.55165625722842E-11"
ixz="4.31046335852167E-08"
iyy="2.72915460277804E-07"
iyz="1.75935978708959E-10"
izz="8.56026306687528E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_index_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 0.02419 0.098779"
rpy="-0.05236 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_index_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="rh_index_distal">
<inertial>
<origin
xyz="0.00658940011630532 -4.59976557022623E-06 0.0194434136420913"
rpy="0 0 0" />
<mass
value="0.00376787129082313" />
<inertia
ixx="3.22116619426455E-07"
ixy="1.03152735699049E-11"
ixz="-1.14363506430985E-07"
iyy="3.65131844686317E-07"
iyz="-1.97263639269362E-10"
izz="1.24256890612907E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/index_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_index_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_index_proximal" />
<child
link="rh_index_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="rh_index_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="rh_middle_proximal">
<inertial>
<origin
xyz="-0.00208661081773556 -4.93451838476378E-06 0.0172736805321904"
rpy="0 0 0" />
<mass
value="0.00253175497594429" />
<inertia
ixx="2.65989683690695E-07"
ixy="-3.58343951791586E-11"
ixz="4.31048601085216E-08"
iyy="2.72915006047006E-07"
iyz="1.75718024412593E-10"
izz="8.56020467202518E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_middle_mcp_pitch"
type="revolute">
<origin
xyz="0.00052576 0.00634 0.1027"
rpy="0 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_middle_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="rh_middle_distal">
<inertial>
<origin
xyz="0.00658940304809306 -4.5885743593238E-06 0.0194434523296449"
rpy="0 0 0" />
<mass
value="0.00376786259758948" />
<inertia
ixx="3.221153658306E-07"
ixy="1.02639617308432E-11"
ixz="-1.14363547272711E-07"
iyy="3.65130723083104E-07"
iyz="-1.96904618797577E-10"
izz="1.24256787913797E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/middle_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_middle_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_middle_proximal" />
<child
link="rh_middle_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="rh_middle_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="rh_ring_proximal">
<inertial>
<origin
xyz="-0.00208654311325356 -4.98538564003281E-06 0.0172736743497407"
rpy="0 0 0" />
<mass
value="0.00253170963529411" />
<inertia
ixx="2.6598913795678E-07"
ixy="-3.62757108675266E-11"
ixz="4.31050611555507E-08"
iyy="2.72914417061517E-07"
iyz="1.75554984053478E-10"
izz="8.56012458677515E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_ring_mcp_pitch"
type="revolute">
<origin
xyz="0.0010258 -0.011135 0.098767"
rpy="0.05236 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_ring_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="rh_ring_distal">
<inertial>
<origin
xyz="0.00658940273069729 -4.56628863591824E-06 0.0194435005686854"
rpy="0 0 0" />
<mass
value="0.0037678395356105" />
<inertia
ixx="3.22112632437858E-07"
ixy="1.01848408913558E-11"
ixz="-1.1436348915342E-07"
iyy="3.65128262095686E-07"
iyz="-1.96145632992445E-10"
izz="1.24256284608064E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/ring_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_ring_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_ring_proximal" />
<child
link="rh_ring_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="rh_ring_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
<link
name="rh_pinky_proximal">
<inertial>
<origin
xyz="-0.00208649034130813 -5.02314582560837E-06 0.0172736680793697"
rpy="0 0 0" />
<mass
value="0.00253167400540778" />
<inertia
ixx="2.65988718820404E-07"
ixy="-3.66012295280295E-11"
ixz="4.31052220484445E-08"
iyy="2.72913936904813E-07"
iyz="1.75447396222308E-10"
izz="8.56006424720129E-08" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_proximal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_pinky_mcp_pitch"
type="revolute">
<origin
xyz="0.0024758 -0.028372 0.092741"
rpy="0.087266 0 0" />
<parent
link="rh_hand_base_link" />
<child
link="rh_pinky_proximal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.60"
effort="100"
velocity="1" />
</joint>
<link
name="rh_pinky_distal">
<inertial>
<origin
xyz="0.00658940431519205 -4.55268314210333E-06 0.0194435341098305"
rpy="0 0 0" />
<mass
value="0.00376782669873412" />
<inertia
ixx="3.22111112339498E-07"
ixy="1.01707985908333E-11"
ixz="-1.14363524419061E-07"
iyy="3.65126916899176E-07"
iyz="-1.95589215866356E-10"
izz="1.24256004854426E-07" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
<material name="silver"/>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="meshes/pinky_distal.STL" />
</geometry>
</collision>
</link>
<joint
name="rh_pinky_dip"
type="revolute">
<origin
xyz="-0.0052516 0 0.036625"
rpy="0 0 0" />
<parent
link="rh_pinky_proximal" />
<child
link="rh_pinky_distal" />
<axis
xyz="0 1 0" />
<limit
lower="0"
upper="1.43"
effort="100"
velocity="1" />
<mimic
joint="rh_pinky_mcp_pitch"
multiplier="0.89"
offset="0" />
</joint>
</robot>
+1
View File
@@ -0,0 +1 @@
../../outputs/reports/O6
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/run_o6_left_mujoco_plan.sh" "$@"
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/run_o6_right_mujoco_plan.sh" "$@"
+200
View File
@@ -0,0 +1,200 @@
#!/usr/bin/env bash
# 同时开两个 MuJoCo:O6 左手标定 vs 未标定 URDF
#
# 未标定: /home/lxqs/linkerhand-urdf/o6/left
# 标定: /home/lxqs/Linkerbot_URDF/06/LEFT(9/3 版,直接用 linker_hand_o6_left.xml)
#
# 两个窗口共用同一条 6 维 SDK 控制话题(默认 /cb_left_hand_control_cmd)。
#
# 用法:
# ./hands/O6/scripts/run_o6_left_dual_compare.sh
# ./hands/O6/scripts/run_o6_left_dual_compare.sh --pd-drive
# ./hands/O6/scripts/run_o6_left_dual_compare.sh --cmd-topic /cb_left_hand_control_cmd --speed 1.0
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$ROOT"
URDF_UNCALIBRATED="$ROOT/hands/O6/reference/left_uncalibrated.urdf"
URDF_CALIBRATED="$ROOT/hands/O6/reference/left_calibrated.urdf"
PKG_O6="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_left"
# 9/3 标定 MJCF:与 ./hands/O6/scripts/run_o6_left_mujoco_plan.sh 单开完全相同
CALIB_XML="$PKG_O6/linker_hand_o6_left.xml"
STOCK_XML="$PKG_O6/linker_hand_o6_left_stock.xml"
if [[ ! -f "$URDF_UNCALIBRATED" ]]; then
echo "[error] missing uncalibrated URDF: $URDF_UNCALIBRATED" >&2
exit 1
fi
if [[ ! -f "$URDF_CALIBRATED" ]]; then
echo "[error] missing calibrated URDF: $URDF_CALIBRATED" >&2
exit 1
fi
if [[ ! -f "$CALIB_XML" ]]; then
echo "[error] missing calibrated MJCF (9/3): $CALIB_XML" >&2
exit 1
fi
set +u
# shellcheck disable=SC1091
source /opt/ros/jazzy/setup.bash
if [[ -f "$ROOT/install/setup.bash" ]]; then
# shellcheck disable=SC1091
source "$ROOT/install/setup.bash"
fi
set -u
VENV_SITE="$ROOT/venv/lib/python3.12/site-packages"
if [[ -d "$VENV_SITE" ]]; then
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
fi
PKG_SRC="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2"
export PYTHONPATH="$PKG_SRC${PYTHONPATH:+:$PYTHONPATH}"
echo "[o6-dual] calibrated xml=$CALIB_XML (9/3, same as single-run)"
echo "[o6-dual] build uncalibrated MJCF from $URDF_UNCALIBRATED"
python3 - "$CALIB_XML" "$URDF_UNCALIBRATED" "$STOCK_XML" <<'PY'
import math
import re
import sys
from pathlib import Path
template_xml = Path(sys.argv[1])
urdf_uncal = Path(sys.argv[2])
out_uncal = Path(sys.argv[3])
joint_body = {"lh_thumb_cmc_yaw": "lh_thumb_metacarpals_base2"}
def parse_urdf_limits(path: Path) -> dict[str, dict]:
text = path.read_text()
joints: dict[str, dict] = {}
for m in re.finditer(r"<joint\b([^>]*)>(.*?)</joint>", text, re.S):
attrs, body = m.group(1), m.group(2)
name_m = re.search(r'name="([^"]+)"', attrs)
if not name_m:
continue
name = name_m.group(1)
jtype_m = re.search(r'type="([^"]+)"', attrs)
if not jtype_m or jtype_m.group(1) != "revolute":
continue
origin = re.search(r'<origin[^>]*xyz="([^"]+)"[^>]*rpy="([^"]+)"', body)
lim = re.search(r'lower="([^"]+)"[^>]*upper="([^"]+)"', body)
rpy = [float(x) for x in origin.group(2).split()] if origin else [0.0, 0.0, 0.0]
joints[name] = {
"lo": float(lim.group(1)),
"hi": float(lim.group(2)),
"rpy": rpy,
}
return joints
def apply_urdf_to_mjcf(template: str, urdf_path: Path, model_name: str) -> str:
joints = parse_urdf_limits(urdf_path)
xml = template.replace(
'model="linkerhand_o6_left"',
f'model="{model_name}"',
1,
)
for jname, info in joints.items():
lo, hi = info["lo"], info["hi"]
pat = rf'(<joint name="{re.escape(jname)}"[^>]*\srange=")([^"]+)(")'
xml = re.sub(
pat,
lambda m, lo=lo, hi=hi: f"{m.group(1)}{lo} {hi}{m.group(3)}",
xml,
count=1,
)
r, p, y = info["rpy"]
bname = joint_body.get(jname)
if bname and abs(r) + abs(p) + abs(y) > 1e-9:
w = math.cos(r * 0.5) * math.cos(p * 0.5) * math.cos(y * 0.5) + math.sin(
r * 0.5
) * math.sin(p * 0.5) * math.sin(y * 0.5)
x = math.sin(r * 0.5) * math.cos(p * 0.5) * math.cos(y * 0.5) - math.cos(
r * 0.5
) * math.sin(p * 0.5) * math.sin(y * 0.5)
yq = math.cos(r * 0.5) * math.sin(p * 0.5) * math.cos(y * 0.5) + math.sin(
r * 0.5
) * math.cos(p * 0.5) * math.sin(y * 0.5)
z = math.cos(r * 0.5) * math.cos(p * 0.5) * math.sin(y * 0.5) - math.sin(
r * 0.5
) * math.sin(p * 0.5) * math.cos(y * 0.5)
quat = f"{w:.9f} {x:.9f} {yq:.9f} {z:.9f}"
bpat = rf'(<body name="{re.escape(bname)}"[^>]*)(>)'
def add_quat(m, quat=quat):
tag = m.group(1)
if 'quat="' in tag:
tag = re.sub(r'quat="[^"]+"', f'quat="{quat}"', tag, count=1)
else:
tag = tag + f' quat="{quat}"'
return tag + m.group(2)
xml = re.sub(bpat, add_quat, xml, count=1)
elif bname:
bpat = rf'(<body name="{re.escape(bname)}"[^>]*)\squat="[^"]+"([^>]*>)'
xml = re.sub(bpat, r"\1\2", xml, count=1)
act_map = {
"lh_thumb_cmc_yaw_pos": "lh_thumb_cmc_yaw",
"lh_thumb_cmc_pitch_pos": "lh_thumb_cmc_pitch",
"lh_index_mcp_pitch_pos": "lh_index_mcp_pitch",
"lh_middle_mcp_pitch_pos": "lh_middle_mcp_pitch",
"lh_ring_mcp_pitch_pos": "lh_ring_mcp_pitch",
"lh_pinky_mcp_pitch_pos": "lh_pinky_mcp_pitch",
}
for act, jname in act_map.items():
lo, hi = joints[jname]["lo"], joints[jname]["hi"]
pat = rf'(<position name="{act}"[^>]*\sctrlrange=")([^"]+)(")'
xml = re.sub(
pat,
lambda m, lo=lo, hi=hi: f"{m.group(1)}{lo} {hi}{m.group(3)}",
xml,
count=1,
)
return xml
import mujoco
out_uncal.write_text(
apply_urdf_to_mjcf(template_xml.read_text(), urdf_uncal, "linkerhand_o6_left_uncalibrated")
)
mujoco.MjModel.from_xml_path(str(out_uncal))
print(f"[o6-dual] uncalibrated MJCF -> {out_uncal}")
PY
EXTRA=("$@")
cleanup() {
[[ -n "${PID_UNCAL:-}" ]] && kill "$PID_UNCAL" 2>/dev/null || true
[[ -n "${PID_CALIB:-}" ]] && kill "$PID_CALIB" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
echo "[o6-dual] launch uncalibrated window"
"$ROOT/hands/O6/scripts/run_o6_left_mujoco_plan.sh" \
--xml "$STOCK_XML" \
--mapping-urdf "$URDF_UNCALIBRATED" \
--node-name o6_left_uncalibrated \
--window-title "O6 left 未标定 (linkerhand-urdf)" \
--sim-state-topic /sim/mujoco/o6/left/uncalibrated/joint_state \
"${EXTRA[@]}" &
PID_UNCAL=$!
sleep 1
echo "[o6-dual] launch calibrated window (9/3 MJCF)"
"$ROOT/hands/O6/scripts/run_o6_left_mujoco_plan.sh" \
--xml "$CALIB_XML" \
--mapping-urdf "$URDF_CALIBRATED" \
--node-name o6_left_calibrated \
--window-title "O6 left 标定 (Linkerbot_URDF 9/3)" \
--sim-state-topic /sim/mujoco/o6/left/calibrated/joint_state \
"${EXTRA[@]}" &
PID_CALIB=$!
echo "[o6-dual] both started. same cmd topic (default /cb_left_hand_control_cmd)."
echo "[o6-dual] Ctrl+C stops both."
wait "$PID_UNCAL" "$PID_CALIB"
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# MuJoCo O6 左手仿真桥
# URDF/MJCF 来源: /home/lxqs/Linkerbot_URDF/06/LEFT(9/3 标定版)
# 默认订阅 /cb_left_hand_control_cmd(6 维 SDK 0~255)
# 发布 /sim/mujoco/o6/left/joint_state
#
# 用法:
# ./hands/O6/scripts/run_o6_left_mujoco_plan.sh
# ./hands/O6/scripts/run_o6_left_mujoco_plan.sh --pd-drive
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$ROOT"
set +u
# shellcheck disable=SC1091
source /opt/ros/jazzy/setup.bash
if [[ -f "$ROOT/install/setup.bash" ]]; then
# shellcheck disable=SC1091
source "$ROOT/install/setup.bash"
fi
set -u
VENV_SITE="$ROOT/venv/lib/python3.12/site-packages"
if [[ -d "$VENV_SITE" ]]; then
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
fi
PKG_SRC="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2"
export PYTHONPATH="$PKG_SRC${PYTHONPATH:+:$PYTHONPATH}"
XML="$PKG_SRC/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_left/linker_hand_o6_left.xml"
URDF="$PKG_SRC/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_left/linkerhand_o6_left.urdf"
if [[ ! -f "$XML" ]]; then
echo "[error] missing O6 left MJCF: $XML" >&2
exit 1
fi
echo "[o6-left] urdf=$URDF"
echo "[o6-left] xml=$XML"
echo "[o6-left] cmd-topic=/cb_left_hand_control_cmd"
echo "[o6-left] sim-state=/sim/mujoco/o6/left/joint_state"
echo "[o6-left] SDK 6ch: pitch, yaw, index, middle, ring, pinky"
exec python3 -m linker_hand_mujoco_ros2.o6_left_plan_bridge \
--xml "$XML" \
--node-name o6_mujoco_plan_bridge_left \
--window-title "O6 left" \
--cmd-topic /cb_left_hand_control_cmd \
--sim-state-topic /sim/mujoco/o6/left/joint_state \
--nominal-topic /retarget/o6/left/joint_target_nominal \
--mapping g20_urdf \
"$@"
+199
View File
@@ -0,0 +1,199 @@
#!/usr/bin/env bash
# 同时开两个 MuJoCo:O6 右手标定 vs 未标定 URDF
#
# 未标定: /home/lxqs/linkerhand-urdf/o6/right
# 标定: /home/lxqs/Linkerbot_URDF/06/RIGHT(直接用 linker_hand_o6_right.xml,与单开相同)
#
# 两个窗口共用同一条 6 维 SDK 控制话题(默认 /cb_right_hand_control_cmd)。
#
# 用法:
# ./hands/O6/scripts/run_o6_right_dual_compare.sh
# ./hands/O6/scripts/run_o6_right_dual_compare.sh --pd-drive
# ./hands/O6/scripts/run_o6_right_dual_compare.sh --cmd-topic /cb_right_hand_control_cmd --speed 1.0
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$ROOT"
URDF_UNCALIBRATED="$ROOT/hands/O6/reference/right_uncalibrated.urdf"
URDF_CALIBRATED="$ROOT/hands/O6/reference/right_calibrated.urdf"
PKG_O6="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_right"
CALIB_XML="$PKG_O6/linker_hand_o6_right.xml"
STOCK_XML="$PKG_O6/linker_hand_o6_right_stock.xml"
if [[ ! -f "$URDF_UNCALIBRATED" ]]; then
echo "[error] missing uncalibrated URDF: $URDF_UNCALIBRATED" >&2
exit 1
fi
if [[ ! -f "$URDF_CALIBRATED" ]]; then
echo "[error] missing calibrated URDF: $URDF_CALIBRATED" >&2
exit 1
fi
if [[ ! -f "$CALIB_XML" ]]; then
echo "[error] missing calibrated MJCF: $CALIB_XML" >&2
exit 1
fi
set +u
# shellcheck disable=SC1091
source /opt/ros/jazzy/setup.bash
if [[ -f "$ROOT/install/setup.bash" ]]; then
# shellcheck disable=SC1091
source "$ROOT/install/setup.bash"
fi
set -u
VENV_SITE="$ROOT/venv/lib/python3.12/site-packages"
if [[ -d "$VENV_SITE" ]]; then
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
fi
PKG_SRC="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2"
export PYTHONPATH="$PKG_SRC${PYTHONPATH:+:$PYTHONPATH}"
echo "[o6-right-dual] calibrated xml=$CALIB_XML (same as single-run)"
echo "[o6-right-dual] build uncalibrated MJCF from $URDF_UNCALIBRATED"
python3 - "$CALIB_XML" "$URDF_UNCALIBRATED" "$STOCK_XML" <<'PY'
import math
import re
import sys
from pathlib import Path
template_xml = Path(sys.argv[1])
urdf_uncal = Path(sys.argv[2])
out_uncal = Path(sys.argv[3])
joint_body = {"rh_thumb_cmc_yaw": "rh_thumb_metacarpals_base2"}
def parse_urdf_limits(path: Path) -> dict[str, dict]:
text = path.read_text()
joints: dict[str, dict] = {}
for m in re.finditer(r"<joint\b([^>]*)>(.*?)</joint>", text, re.S):
attrs, body = m.group(1), m.group(2)
name_m = re.search(r'name="([^"]+)"', attrs)
if not name_m:
continue
name = name_m.group(1)
jtype_m = re.search(r'type="([^"]+)"', attrs)
if not jtype_m or jtype_m.group(1) != "revolute":
continue
origin = re.search(r'<origin[^>]*xyz="([^"]+)"[^>]*rpy="([^"]+)"', body)
lim = re.search(r'lower="([^"]+)"[^>]*upper="([^"]+)"', body)
rpy = [float(x) for x in origin.group(2).split()] if origin else [0.0, 0.0, 0.0]
joints[name] = {
"lo": float(lim.group(1)),
"hi": float(lim.group(2)),
"rpy": rpy,
}
return joints
def rpy_to_quat(r: float, p: float, y: float) -> tuple[float, float, float, float]:
cr, sr = math.cos(r * 0.5), math.sin(r * 0.5)
cp, sp = math.cos(p * 0.5), math.sin(p * 0.5)
cy, sy = math.cos(y * 0.5), math.sin(y * 0.5)
w = cr * cp * cy + sr * sp * sy
x = sr * cp * cy - cr * sp * sy
yq = cr * sp * cy + sr * cp * sy
z = cr * cp * sy - sr * sp * cy
return w, x, yq, z
def apply_urdf_to_mjcf(template: str, urdf_path: Path, model_name: str) -> str:
joints = parse_urdf_limits(urdf_path)
xml = template.replace(
'model="linkerhand_o6_right"',
f'model="{model_name}"',
1,
)
for jname, info in joints.items():
lo, hi = info["lo"], info["hi"]
pat = rf'(<joint name="{re.escape(jname)}"[^>]*\srange=")([^"]+)(")'
xml = re.sub(
pat,
lambda m, lo=lo, hi=hi: f"{m.group(1)}{lo} {hi}{m.group(3)}",
xml,
count=1,
)
r, p, y = info["rpy"]
bname = joint_body.get(jname)
if bname and abs(r) + abs(p) + abs(y) > 1e-9:
w, x, yq, z = rpy_to_quat(r, p, y)
quat = f"{w:.9f} {x:.9f} {yq:.9f} {z:.9f}"
bpat = rf'(<body name="{re.escape(bname)}"[^>]*)(>)'
def add_quat(m, quat=quat):
tag = m.group(1)
if 'quat="' in tag:
tag = re.sub(r'quat="[^"]+"', f'quat="{quat}"', tag, count=1)
else:
tag = tag + f' quat="{quat}"'
return tag + m.group(2)
xml = re.sub(bpat, add_quat, xml, count=1)
elif bname:
bpat = rf'(<body name="{re.escape(bname)}"[^>]*)\squat="[^"]+"([^>]*>)'
xml = re.sub(bpat, r"\1\2", xml, count=1)
act_map = {
"rh_thumb_cmc_yaw_pos": "rh_thumb_cmc_yaw",
"rh_thumb_cmc_pitch_pos": "rh_thumb_cmc_pitch",
"rh_index_mcp_pitch_pos": "rh_index_mcp_pitch",
"rh_middle_mcp_pitch_pos": "rh_middle_mcp_pitch",
"rh_ring_mcp_pitch_pos": "rh_ring_mcp_pitch",
"rh_pinky_mcp_pitch_pos": "rh_pinky_mcp_pitch",
}
for act, jname in act_map.items():
lo, hi = joints[jname]["lo"], joints[jname]["hi"]
pat = rf'(<position name="{act}"[^>]*\sctrlrange=")([^"]+)(")'
xml = re.sub(
pat,
lambda m, lo=lo, hi=hi: f"{m.group(1)}{lo} {hi}{m.group(3)}",
xml,
count=1,
)
return xml
import mujoco
out_uncal.write_text(
apply_urdf_to_mjcf(template_xml.read_text(), urdf_uncal, "linkerhand_o6_right_uncalibrated")
)
mujoco.MjModel.from_xml_path(str(out_uncal))
print(f"[o6-right-dual] uncalibrated MJCF -> {out_uncal}")
PY
EXTRA=("$@")
cleanup() {
[[ -n "${PID_UNCAL:-}" ]] && kill "$PID_UNCAL" 2>/dev/null || true
[[ -n "${PID_CALIB:-}" ]] && kill "$PID_CALIB" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
echo "[o6-right-dual] launch uncalibrated window"
"$ROOT/hands/O6/scripts/run_o6_right_mujoco_plan.sh" \
--xml "$STOCK_XML" \
--mapping-urdf "$URDF_UNCALIBRATED" \
--node-name o6_right_uncalibrated \
--window-title "O6 right 未标定 (linkerhand-urdf)" \
--sim-state-topic /sim/mujoco/o6/right/uncalibrated/joint_state \
"${EXTRA[@]}" &
PID_UNCAL=$!
sleep 1
echo "[o6-right-dual] launch calibrated window"
"$ROOT/hands/O6/scripts/run_o6_right_mujoco_plan.sh" \
--xml "$CALIB_XML" \
--mapping-urdf "$URDF_CALIBRATED" \
--node-name o6_right_calibrated \
--window-title "O6 right 标定 (Linkerbot_URDF)" \
--sim-state-topic /sim/mujoco/o6/right/calibrated/joint_state \
"${EXTRA[@]}" &
PID_CALIB=$!
echo "[o6-right-dual] both started. same cmd topic (default /cb_right_hand_control_cmd)."
echo "[o6-right-dual] Ctrl+C stops both."
wait "$PID_UNCAL" "$PID_CALIB"
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# MuJoCo O6 右手仿真桥
# URDF 来源: /home/lxqs/下载/linkerhand_o6_right_O6_RIGHT_001_partial_zero_calibrated+copy.urdf
# 默认订阅 /cb_right_hand_control_cmd(与 SDK / GUI 一致,6 维 SDK 0~255)
# 发布 /sim/mujoco/o6/right/joint_state
#
# 用法:
# ./hands/O6/scripts/run_o6_right_mujoco_plan.sh
# ./hands/O6/scripts/run_o6_right_mujoco_plan.sh --pd-drive
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "$ROOT"
set +u
# shellcheck disable=SC1091
source /opt/ros/jazzy/setup.bash
if [[ -f "$ROOT/install/setup.bash" ]]; then
# shellcheck disable=SC1091
source "$ROOT/install/setup.bash"
fi
set -u
VENV_SITE="$ROOT/venv/lib/python3.12/site-packages"
if [[ -d "$VENV_SITE" ]]; then
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
fi
PKG_SRC="$ROOT/src/linkerhand-sim/linker_hand_mujoco_ros2"
export PYTHONPATH="$PKG_SRC${PYTHONPATH:+:$PYTHONPATH}"
XML="$PKG_SRC/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_right/linker_hand_o6_right.xml"
URDF="$PKG_SRC/linker_hand_mujoco_ros2/urdf/O6/linker_hand_o6_right/linkerhand_o6_right.urdf"
if [[ ! -f "$XML" ]]; then
echo "[error] missing O6 MJCF: $XML" >&2
exit 1
fi
echo "[o6-right] urdf=$URDF"
echo "[o6-right] xml=$XML"
echo "[o6-right] cmd-topic=/cb_right_hand_control_cmd"
echo "[o6-right] sim-state=/sim/mujoco/o6/right/joint_state"
echo "[o6-right] SDK 6ch: pitch, yaw, index, middle, ring, pinky"
exec python3 -m linker_hand_mujoco_ros2.o6_plan_bridge \
--xml "$XML" \
--node-name o6_mujoco_plan_bridge_right \
--window-title "O6 right" \
--cmd-topic /cb_right_hand_control_cmd \
--sim-state-topic /sim/mujoco/o6/right/joint_state \
--nominal-topic /retarget/o6/right/joint_target_nominal \
--mapping g20_urdf \
"$@"