Build a ROS2 Data Pipeline With ROS2 Topics

In this tutorial I’ll show you how you can chain ROS2 topics and thus build a data pipeline through several nodes.

This is a pretty common use case in robotics: you get some data from a sensor, and you need to pass it through several parts of your applications. Each part needs the data to do its own thing, and some parts may modify the data for other parts as well.

For this example we’ll create 3 nodes:

  • Node 1 (pipeline_step_1): create a random float number between 0 and 10, and publish it.
  • Node 2 (pipeline_step_2): get this number, multiply it by 2, and publish it.
  • Node 3 (pipeline_step_3): get this number, round it, and publish it.

Here’s the graph we’ll get at the end:

ROS2 Data Pipeline with Topics

First we’ll write the 3 nodes, then build them, test them, and create a launch file to start them together.

Scroll to Top