Skip to main content

Bringing Robots to Life with URDF and ros2_control

Module Objective

To introduce the core concepts and practical applications of ROS 2 as the foundational software framework for humanoid robotics, enabling students to set up, understand, and interact with a robot's "nervous system."

Learning Goals

Upon completing this chapter, you will be able to:

  • Understand the Unified Robot Description Format (URDF) for robot modeling.
  • Create a simple URDF model for a humanoid limb.
  • Introduce ros2_control for hardware abstraction and simple joint control.
  • Visualize URDF models in RViz2.

Core Topics

This chapter will cover:

1. Unified Robot Description Format (URDF)

  • Introduction to URDF: What it is and why it's used.
  • XML structure of URDF: <robot>, <link>, <joint>.
  • Defining kinematic chains: parent and child links, joint types.
  • Adding visual and collision properties.
  • Using xacro for modular and parametric URDF models.

2. Robot State Publishing and Visualization

  • robot_state_publisher: Publishing joint states to TF.
  • joint_state_publisher: Reading joint values and publishing them.
  • Introduction to RViz2: A powerful 3D visualization tool for ROS 2.
  • Displaying URDF models in RViz2.

3. Introduction to ros2_control

  • Overview of ros2_control architecture: Hardware interfaces, controllers.
  • Why ros2_control? Hardware abstraction and standardization.
  • Setting up a simple ros2_control configuration for a basic robot.
  • Basic concepts of position and velocity controllers.

Hands-on Exercise: 2-DOF Robotic Arm with URDF and ros2_control

Model a 2-Degrees-of-Freedom (DOF) robotic arm using URDF. Configure robot_state_publisher and joint_state_publisher to visualize this arm in RViz2. Extend the model to integrate with ros2_control to implement a basic position controller for one of the arm's joints, allowing you to command its movement through ROS 2.

Constraints

  • This chapter focuses on kinematic models and basic position control.
  • We will not cover complex dynamics, advanced force control, or real-world hardware integration in this chapter.