Skip to main content

Chapter 4: Understanding Humanoid Structure with URDF

Introduction to URDF​

Unified Robot Description Format (URDF) is an XML-based format used in ROS to describe robot models. URDF defines the physical and visual properties of a robot, including its structure, appearance, and how its parts move relative to each other. Think of URDF as the "blueprint" or "DNA" of a robot - it contains all the information needed to understand the robot's physical structure.

URDF is crucial for humanoid robotics because it allows us to represent the complex structure of human-like robots with multiple limbs, joints, and degrees of freedom in a standardized way that ROS tools can understand and process.

A link in URDF represents a rigid part of the robot. Think of links as the solid pieces that make up a robot's structure:

  • Visual Properties: How the link looks (shape, color, texture)
  • Collision Properties: How the link interacts with obstacles (shape for collision detection)
  • Inertial Properties: Mass, center of mass, and moment of inertia for physics simulations
  • Physical Characteristics: Size, material, and other physical attributes

Common examples of links in humanoid robots:

  • Head, torso, arms, legs
  • Individual segments of limbs
  • Hands and feet
  • Sensors mounted on the robot

Joints: The Connection Points​

A joint in URDF defines how two links connect and move relative to each other. Joints specify the type of motion allowed between connected links:

  • Joint Type: Defines the kind of movement (revolute, continuous, prismatic, etc.)
  • Axis of Rotation: The axis around which the joint rotates or moves
  • Limits: Range of motion, velocity limits, and effort limits
  • Parent-Child Relationship: Which links the joint connects and how they relate

Types of joints commonly found in humanoid robots:

  • Revolute: Rotates around a single axis with limited range (like an elbow)
  • Continuous: Rotates continuously around a single axis (like a wheel)
  • Prismatic: Linear sliding motion (like a telescoping arm)
  • Fixed: No movement between links (permanent connection)

Hierarchical Structure and Kinematic Chains​

Robot Tree Structure​

URDF represents a robot as a tree structure with a single root link and multiple branches. This structure ensures that there are no loops in the robot's kinematic structure, making it easier to calculate forward and inverse kinematics.

For a humanoid robot, the typical structure might be:

  • Root: Base link (usually torso)
  • Branch 1: Left arm (shoulder → elbow → wrist → hand)
  • Branch 2: Right arm (shoulder → elbow → wrist → hand)
  • Branch 3: Left leg (hip → knee → ankle → foot)
  • Branch 4: Right leg (hip → knee → ankle → foot)
  • Branch 5: Head (neck joint)

Kinematic Chains​

A kinematic chain is a sequence of links connected by joints that work together to achieve motion. In humanoid robots, kinematic chains represent limbs or other articulated parts:

  • Forward Kinematics: Given joint angles, calculate the position and orientation of end effectors (like hands or feet)
  • Inverse Kinematics: Given desired end effector position, calculate required joint angles

For example, in a humanoid arm:

  • Shoulder joint (allows arm to move up/down and forward/backward)
  • Elbow joint (allows forearm to rotate)
  • Wrist joint (allows hand to rotate and tilt)

URDF File Structure​

Basic URDF Document​

<?xml version="1.0"?>
<robot name="humanoid_robot">
<!-- Links are defined here -->
<link name="base_link">
<visual>
<geometry>
<box size="0.5 0.2 0.4"/>
</geometry>
<material name="blue">
<color rgba="0 0 1 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.5 0.2 0.4"/>
</geometry>
</collision>
<inertial>
<mass value="10"/>
<inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
</inertial>
</link>

<!-- Joints are defined here -->
<joint name="shoulder_joint" type="revolute">
<parent link="base_link"/>
<child link="upper_arm"/>
<origin xyz="0 0.3 0" 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 URDF​

  • Visual: How the link appears in simulation and visualization tools
  • Collision: Shape used for collision detection
  • Inertial: Physical properties for dynamics simulation

Joint Definition​

  • Parent/Child: Links that the joint connects
  • Origin: Position and orientation of the joint relative to parent
  • Axis: Direction of rotation or translation
  • Limits: Constraints on joint motion

URDF for Humanoid Robots​

Special Considerations for Humanoids​

Humanoid robots present unique challenges in URDF representation:

Balance and Stability​

  • Center of mass considerations
  • Support polygon analysis for bipedal locomotion
  • Dynamic balance during movement

Degrees of Freedom​

  • Humanoid robots typically have many joints (20+ for simple humanoids)
  • Coordination between multiple joints for complex movements
  • Redundant solutions for reaching and manipulation tasks

Anthropomorphic Design​

  • Mimicking human proportions and ranges of motion
  • Ensuring realistic movement capabilities
  • Balancing anthropomorphic design with mechanical feasibility

Common URDF Patterns in Humanoids​

Spine Structure​

Humanoid robots often have spine joints to enable more natural movement:

  • Multiple small joints for flexibility
  • Limited range of motion to maintain stability
  • Integration with balance control systems

Hand Models​

Hand representation varies significantly:

  • Simplified models with few degrees of freedom
  • Detailed models with individual finger joints
  • Pre-shaped grasps for simplified manipulation

Sensor Integration​

Sensors are represented as links attached to the main structure:

  • Cameras in eye positions
  • Force/torque sensors in joints
  • IMU sensors for balance and orientation

URDF Tools and Visualization​

ROS Tools for URDF​

  • RViz: Visualizes robot models and their transformations
  • Robot State Publisher: Calculates and publishes joint transforms
  • TF2: Manages coordinate frame transformations
  • URDF Parser: Validates and processes URDF files

Validation and Testing​

  • Checking for proper kinematic structure
  • Verifying joint limits and ranges of motion
  • Testing collision detection and visualization

Applications in Robotics​

Simulation​

URDF models are essential for robot simulation in environments like Gazebo, allowing developers to test algorithms without physical hardware.

Motion Planning​

Motion planning algorithms use URDF models to understand robot structure and plan collision-free paths.

Control Systems​

Controllers use URDF information to understand robot kinematics and dynamics for precise movement control.

Visualization​

URDF enables accurate visualization of robot models in various tools and interfaces.

Summary​

URDF provides a standardized way to represent robot structure in ROS, making it essential for humanoid robotics. By understanding links, joints, and kinematic chains, you can comprehend how robots are represented digitally and how their physical structure enables complex movements. The hierarchical structure of URDF allows for modeling the complex, articulated nature of humanoid robots while maintaining the mathematical properties needed for control and planning.

With this understanding of URDF, you now have the complete foundation for understanding ROS 2 as the nervous system of humanoid robots, from the middleware that enables communication to the structural representation that enables motion and interaction.