URDF and Humanoid Robot Structure
To interact with and simulate robots, we need a standardized way to describe their physical characteristics. The Unified Robot Description Format (URDF) serves this purpose in ROS environments. It's an XML format used to describe all aspects of a robot, including its kinematic and dynamic properties, visual appearance, and collision models.
What is URDF?
A URDF file essentially defines the robot's structure as a tree of links and joints:
- Links: These are the rigid bodies of the robot (e.g., a torso, a head, an arm segment, a hand). Each link has properties like its mass, inertia, and visual/collision geometry.
- Joints: These define the connections between two links and specify how they can move relative to each other. Joints have properties like type (revolute, prismatic, fixed, etc.), limits, and dynamics.
Why URDF for Humanoid Robots?
Humanoid robots are complex, with many links and articulated joints. URDF provides a structured way to:
- Model Kinematics: Define the geometric relationships between all parts of the robot, essential for forward and inverse kinematics calculations.
- Visualize: Easily visualize the robot model in various tools like RViz (ROS Visualization) or simulation environments like Gazebo.
- Simulate: Use the physical properties defined in URDF (mass, inertia) for realistic physics simulations.
- Control: Provide a common description for robot controllers to understand the robot's structure and capabilities.
Basic Structure of a URDF File
A URDF file starts with a <robot> tag, containing multiple <link> and <joint> tags.
<?xml version="1.0"?>
<robot name="humanoid_robot">
<!-- Base Link (e.g., torso) -->
<link name="torso">
<visual>
<geometry>
<box size="0.2 0.3 0.5"/>
</geometry>
<material name="blue">
<color rgba="0 0 0.8 1"/>
</material>
</visual>
<collision>
<geometry>
<box size="0.2 0.3 0.5"/>
</geometry>
</collision>
<inertial>
<mass value="10.0"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<!-- Joint connecting torso to head -->
<joint name="torso_to_head" type="revolute">
<parent link="torso"/>
<child link="head"/>
<origin xyz="0 0 0.3" rpy="0 0 0"/>
<axis xyz="0 0 1"/>
<limit lower="-1.57" upper="1.57" effort="100" velocity="10"/>
</joint>
<!-- Head Link -->
<link name="head">
<visual>
<geometry>
<sphere radius="0.15"/>
</geometry>
<material name="red">
<color rgba="0.8 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<sphere radius="0.15"/>
</geometry>
</collision>
<inertial>
<mass value="2.0"/>
<inertia ixx="0.1" ixy="0.0" ixz="0.0" iyy="0.1" iyz="0.0" izz="0.1"/>
</inertial>
</link>
<!-- Add more links and joints for arms, legs, etc. -->
</robot>
This conceptual example shows a simple two-link robot (torso and head). A full humanoid URDF would include many more links and joints to represent shoulders, elbows, wrists, hands, hips, knees, ankles, and feet.
Expanding a Humanoid URDF
When designing a humanoid URDF, you typically start from a base link (often the torso or hip) and then add branches for:
- Head: Neck joint, head link.
- Arms: Shoulder joints, upper arm links, elbow joints, forearm links, wrist joints, hand links.
- Legs: Hip joints, upper leg links, knee joints, lower leg links, ankle joints, foot links.
Each joint will have properties defining its type (e.g., revolute for a rotating joint, prismatic for a sliding joint, fixed for rigid connections) and its limits of motion.
The level of detail in a URDF can vary from simple geometric primitives for visualization to highly accurate meshes with detailed inertial properties for advanced simulation and control.