Skip to main content

Chapter 6: Nodes and Communication Patterns

Learning Objectives

By the end of this section, you will be able to:

  • Create your first ROS 2 node
  • Understand publisher/subscriber (topic) communication
  • Understand request/response (service) communication
  • Understand long-running task (action) communication
  • Choose the appropriate pattern for different use cases
  • Write Python code to implement each pattern

Status: In Progress

This section is being created by the technical writing sub-agent. Expected delivery: December 9, 2025.

Research Phase: Input from robotics_researcher - Task 1.2 Details


Coming Soon

This section will cover:

  • Creating Your First Node: Simple ROS 2 node structure
  • Publisher/Subscriber Pattern: Continuous data streams
  • Service Pattern: Request/response interactions
  • Action Pattern: Long-running tasks with feedback
  • Decision Matrix: When to use each pattern
  • Custom Message Types: Defining your own messages
  • Practical Examples: Real-world humanoid robot scenarios

Code Examples Included:

  • Publisher node reading sensor data
  • Subscriber node processing data
  • Service server providing computations
  • Service client requesting services
  • Action server for robot movement
  • Action client with feedback handling

Placeholder: Content Structure

## Introduction
Communication patterns in distributed robotics systems

## Publishers and Subscribers
Topics for continuous data streams

## Services
Request/response for discrete operations

## Actions
Long-running tasks with feedback and preemption

## Decision Matrix
Choosing the right pattern

## Custom Messages
Defining your own data types

## Real-World Examples
Humanoid robot scenarios

## Key Takeaways
Summary and reflection

Previous: 2.1 ROS 2 Architecture
Next: 2.3 Building ROS 2 Packages