Articulation
This section covers the process of articulating DexHand models with other mechanical systems, such as robot arms or floating bases.
Overview
The articulation system allows:
Attaching hands to robot arms
Creating floating base configurations
Preserving visual and collision properties
Configuring joint limits and dynamics
Basic Concepts
Articulation Methods
Two main methods of articulation:
Fixed Mount
Rigid attachment to another model
Suitable for robot arms
Preserves kinematic chain
Floating Base
6-DoF free joint
Suitable for simulating grasping/manipulation tasks without actual robot arm
Independent position/orientation control
Model Components
Each articulated model requires:
Parent model (arm/base)
Child model (hand)
Attachment specifications
Configuration parameters
Usage
Basic Articulation
Using the articulation script:
python scripts/articulate_hand.py \
--base robot_arm.xml \
--hand dexhand021_right.xml \
--output combined_model.xml \
--euler 0 90 0
Parameters:
--base
: Parent model XML path--hand
: Hand model XML path--output
: Output model path--pos
: Position offset [x y z]--euler
: Euler angles [roll pitch yaw]--quat
: Quaternion [w x y z]--add-ground
: Add ground plane
Example: Robot Arm
Attaching to a JAKA Zu7 arm:
python scripts/articulate_hand.py \
--base models/jaka_zu7_right.xml \
--hand models/dexhand021_right_simplified.xml \
--output models/dexhand021_right_jaka_zu7.xml \
--euler 0 0 0
Example: Floating Base
Creating a floating base configuration:
python scripts/articulate_hand.py \
--base models/floating_base.xml \
--hand models/dexhand021_right.xml \
--output models/dexhand021_right_floating.xml \
--euler 0 90 0
Implementation
The articulate()
Function
def articulate(
parent_xml_path,
child_xml_path,
link_name,
output_xml_path,
pos="0 0 0",
quat="1 0 0 0"
):
"""Articulate child model to parent.
Args:
parent_xml_path: Parent model XML
child_xml_path: Child model XML
link_name: Attachment link name
output_xml_path: Output path
pos: Position offset
quat: Orientation quaternion
"""
# Core steps:
# 1. Load models
# 2. Merge configurations
# 3. Update hierarchies
# 4. Configure attachment
# 5. Save combined model
MJCF Structure
Example combined model structure:
<mujoco>
<!-- Combined model -->
<compiler meshdir=""/>
<!-- Merged assets -->
<asset>
<!-- Parent assets -->
<!-- Child assets -->
</asset>
<!-- Body hierarchy -->
<worldbody>
<!-- Parent base -->
<body name="parent_base">
<!-- Parent links -->
<body name="attachment_link">
<!-- Child base -->
<body name="hand_base"
pos="0 0 0"
quat="1 0 0 0">
<!-- Hand model -->
</body>
</body>
</body>
</worldbody>
<!-- Combined actuators -->
<actuator>
<!-- Parent actuators -->
<!-- Child actuators -->
</actuator>
</mujoco>
Advanced Features
Custom Attachment Points
Specify custom attachment configurations:
# Position offset
pos = "0.1 0 0.05" # x y z
# Orientation (quaternion)
quat = "0.707 0 0.707 0" # w x y z
Mesh Management
Handle mesh file paths:
# Update mesh directory
compiler = ET.SubElement(root, "compiler")
compiler.set("meshdir", "path/to/meshes")
Asset Merging
Combine model assets:
def merge_assets(parent_root, child_root):
"""Merge assets from both models."""
# Get/create asset elements
parent_asset = get_asset_element(parent_root)
child_asset = child_root.find("asset")
# Copy child assets
if child_asset is not None:
for asset in child_asset:
parent_asset.append(asset)
Common Use Cases
Robot Arm Integration
Convert URDF to MJCF
Configure attachment point
Articulate models
Test kinematics
Verify control
Floating Manipulation
Start with floating base
Configure 6-DoF control
Add pose tracking
Implement teleoperation
Troubleshooting
Common Issues
Incorrect Placement
If hand position is wrong:
Check attachment point
Verify coordinate systems
Adjust offset values
Review transformation chain
Control Problems
If experiencing control issues:
Check actuator configurations
Verify joint limits
Review control parameters
Test individual components
Next Steps
After articulation:
Configure control in ROS Integration
Test with Hand Model Examples