Humanoid Modeling with URDF
Links, Joints, and Kinematic Structure
Unified Robot Description Format (URDF) is the standard for describing robot models in ROS. For humanoid robots, URDF defines the physical and kinematic properties that enable accurate simulation and control. Understanding how to properly structure a humanoid model is essential for effective robotics development.
Basic URDF Structure
A URDF file consists of links and joints that define the robot's physical structure:
<?xml version="1.0"?>
<robot name="simple_humanoid">
<!-- Base link -->
<link name="base_link">
<visual>
<geometry>
<box size="0.2 0.1 0.1"/>
</geometry>
</visual>
<collision>
<geometry>
<box size="0.2 0.1 0.1"/>
</geometry>
</collision>
<inertial>
<mass value="1.0"/>
<inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
</inertial>
</link>
<!-- Head link -->
<link name="head">
<visual>
<geometry>
<sphere radius="0.05"/>
</geometry>
</visual>
</link>
<!-- Joint connecting base to head -->
<joint name="neck_joint" type="revolute">
<parent link="base_link"/>
<child link="head"/>
<origin xyz="0 0 0.1" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
<limit lower="-1.57" upper="1.57" effort="100" velocity="1"/>
</joint>
</robot>
Key Components of Humanoid URDF
Links
Links represent rigid bodies in the robot structure:
- Visual: Defines how the link appears in visualization
- Collision: Defines the collision properties for physics simulation
- Inertial: Specifies mass and inertia properties for dynamics
Joints
Joints define the connection between links:
- Fixed: Immovable connection
- Revolute: Rotational joint with axis of rotation
- Continuous: Revolute joint without limits
- Prismatic: Linear sliding joint
- Floating: 6 degrees of freedom
Materials and Colors
Materials can be defined separately and referenced in visual elements:
<material name="blue">
<color rgba="0 0 0.8 1"/>
</material>
<link name="arm">
<visual>
<geometry>
<cylinder length="0.1" radius="0.02"/>
</geometry>
<material name="blue"/>
</visual>
</link>
Describing Humanoid Bodies for Simulation and Control
When modeling humanoid robots, consider these best practices:
- Anatomical Accuracy: Structure joints to match human-like movement capabilities
- Mass Distribution: Ensure realistic inertial properties for stable simulation
- Joint Limits: Set appropriate ranges of motion based on mechanical constraints
- Reference Frames: Establish consistent coordinate systems throughout the model
Advanced URDF Concepts
Transmission Elements
Define how actuators interact with joints:
<transmission name="left_wheel_trans">
<type>transmission_interface/SimpleTransmission</type>
<joint name="left_wheel_joint">
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="left_wheel_motor">
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
Xacro Macros
For complex humanoid models, Xacro (XML Macros) can simplify repetitive structures:
<xacro:macro name="simple_arm" params="prefix parent *origin">
<joint name="${prefix}_joint" type="revolute">
<parent link="${parent}"/>
<child link="${prefix}_link"/>
<xacro:insert_block name="origin"/>
<axis xyz="0 1 0"/>
<limit lower="-1.57" upper="1.57" effort="100" velocity="1"/>
</joint>
<link name="${prefix}_link">
<visual>
<geometry>
<cylinder length="0.2" radius="0.02"/>
</geometry>
</visual>
</link>
</xacro:macro>
Summary
Proper URDF modeling is essential for effective humanoid robot simulation and control. By understanding links, joints, and kinematic structure, you can create accurate representations of humanoid bodies that enable both realistic simulation and precise control.