ROS 2 Topics and Multi-Topic Nodes

Learn how ROS 2 topics enable communication between robot components. This post breaks down how to structure nodes, use timers, and organize publishers and subscribers efficiently.
Blog>
ros-2-topics-and-multi-topic-nodes
Last updated: 
June 29, 2025

Topics are named channels where one part of your robot sends data (a publisher), and another receives it (a subscriber). It’s a one-way, anonymous communication system—perfect for real-time streams like sensor readings or motor commands. Think of it like a radio:

📻 Publisher = DJ broadcasting on 98.7 FM

🎧 Subscriber = Your robot’s software tuned to that station

🔧 Technical Description: ROS 2 Topics

In ROS 2, a topic is a named bus over which nodes exchange messages using a publish/subscribe (pub/sub) model. This architecture enables real-time, one-way, asynchronous communication that is:

  • Decoupled: Publishers and subscribers don’t know about each other.
  • Non-blocking: Data flows without waiting for acknowledgment.
  • Unidirectional: From publisher → topic → subscriber(s).

This decoupled architecture enables real-time data exchange without requiring nodes to be aware of each other. Each topic is bound to a specific message type (or interface), such as sensor_msgs/msg/Image or geometry_msgs/msg/Twist. The ROS 2 middleware (DDS) ensures automatic discovery and routing of messages. Multiple publishers and subscribers can use the same topic simultaneously, and advanced Quality of Service (QoS) settings allow for tuning communication reliability, latency, and history depth based on system constraints.

🤖 Topics in Isaac Sim

Isaac Sim uses ROS 2 topics as the communication bridge between simulated robots and the external ROS 2 ecosystem. Simulated sensors (like LiDARs or cameras) publish synthetic data on ROS 2 topics, while motion commands (like /cmd_vel) are subscribed to by Isaac Sim and applied to the virtual robot. This enables realistic, closed-loop testing of robotics applications, where ROS-based software can be validated without physical hardware.

| Use Case            | Isaac Sim Role            | ROS 2 Topic             | Message Type                          |
| ------------------- | ------------------------- | ----------------------- | ------------------------------------- |
| Simulated LiDAR     | Publishes point cloud     | `/scan`                 | `sensor_msgs/msg/LaserScan`           |
| Differential Drive  | Subscribes to velocity    | `/cmd_vel`              | `geometry_msgs/msg/Twist`             |
| Robotic Arm         | Publishes joint state     | `/joint_states`         | `sensor_msgs/msg/JointState`          |
| Camera Sensor       | Publishes RGB image       | `/camera/image_raw`     | `sensor_msgs/msg/Image`               |
| Articulated Control | Subscribes to joint input | `/arm/joint_trajectory` | `trajectory_msgs/msg/JointTrajectory` |

🤹 One Node, Many Topics

ROS 2 allows multiple publishers and subscribers inside a single node. This pattern works best when:

  • Tasks are tightly coupled (like sensor input + motor output)
  • You want minimal latency
  • You need shared internal state

🪢 Multiple Nodes

When tasks are logically separate, split them into multiple nodes. This is great for:

  • Better team collaboration
  • Code reuse across robots
  • Distributed deployments

📦 Example structure for a warehouse robot:

  • navigation_node
  • lidar_node
  • controller_node
  • battery_monitor_node

Each node handles its own job, and topics connect them.

⏱ Timers

ROS 2 timers let you schedule a function to run repeatedly (e.g., every 0.1s). Timers are essential for:

  • Publishing regular status or sensor updates
  • Running control loops
  • Simulating ticking clocks in robots

Timers are lightweight, event-driven, and fully integrated into the ROS 2 execution model.

Available Now

Book a demo and get early access. Free trial!

Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Email Address:
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.