topic-pub-sub

Configure ROS 2 publishers and subscribers with QoS profiles in Python and C++.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill topic-pub-sub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: topic-pub-sub
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/topic-pub-sub
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill topic-pub-sub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishing robust ROS 2 pub/sub communication requires correct QoS settings, clear message flow, and reliable diagnosis of topic health. This guide teaches best practices for designing publishers and subscribers, selecting appropriate QoS, and ensuring reliable data exchange in Jazzy/Rolling.

Core Features & Use Cases

  • Publisher/Subscriber patterns in Python and C++ with correct topic naming, QoS profiles, and message types.
  • QoS control and diagnostics including depth, reliability, durability, and tools to verify publisher/subscriber health.
  • Latched topics support for late subscribers to receive the last message.
  • Multi-topic subscription patterns for data fusion and synchronized processing across topics.
  • Health checks and debugging guidance using ros2 topic commands (list, info, hz, bw, echo).

Quick Start

Publish a minimal Python publisher and subscriber on a topic, then verify with ros2 topic echo.

Frequently Asked Questions about topic-pub-sub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a latched topic in ROS 2 so late subscribers receive the last published message?

To configure a latched topic in ROS 2, set the QoS durability profile to Transient Local. This ensures late subscribers automatically receive the last published message upon connection.

What's the best way to synchronize and fuse data across multiple ROS 2 topics?

For multi-topic subscription and data fusion in ROS 2, implement synchronized subscriber patterns. This allows concurrent processing across multiple topics to align and fuse incoming data streams effectively.

How do I select the right Quality of Service profile for ROS 2 publishers and subscribers?

Selecting the right QoS profile for ROS 2 involves configuring depth, reliability, and durability settings. Match publisher and subscriber QoS policies to ensure compatible and robust message delivery.

Why does my ROS 2 subscriber fail to receive messages from a publisher?

A ROS 2 subscriber fails to receive messages when publisher and subscriber QoS profiles are incompatible. Verify topic health and diagnose connection issues using ros2 topic info and ros2 topic hz commands.

Can I implement ROS 2 publish-subscribe patterns in both Python and C++?

Yes, you can implement ROS 2 publish-subscribe patterns in both Python and C++. The skill provides deterministic publisher and subscriber examples with correct topic naming and QoS profiles for both languages.

How do I check the health and bandwidth of a ROS 2 topic?

Check ROS 2 topic health and bandwidth using diagnostic commands like ros2 topic bw and ros2 topic echo. These tools verify publisher and subscriber activity and measure message flow rates.