ROS2 Nav2 Tutorial

In this ROS2 Nav2 tutorial you will learn the basics of the Navigation 2 stack, step by step. You will first install the Nav2 stack on ROS2 Humble, then you will start directly to generate a map with SLAM. After this, we will check what’s inside the map, and then use this map with the … Read more

ROS2 Nav2 – Generate a Map with slam_toolbox

In this tutorial I will show you how to create a map for the Nav2 stack, using the ROS2 slam_toolbox package. We are going to use a simulation of a robot, the Turtlebot3, but all the steps that are related to SLAM can be replicated for any other robot, as long as you have a … Read more

ROS2 XML Launch File Example

In this tutorial I will show you how to write, install and run a ROS2 XML launch file. Whenever you start to have multiple nodes (with parameters, arguments, …) in your application, creating a launch file becomes an almost mandatory step to be able to scale and go beyond 2-3 nodes without creating a huge … Read more

How to Uninstall ROS2 Completely

In this short tutorial I will show you all the steps to do in order to completely uninstall ROS2 from Ubuntu. I will assume that you have installed ROS2 using apt (binary install). >> Watch this video as an additional resource to this article: After watching the video, subscribe to the Robotics Back-End Youtube channel so you … Read more

ROS2 rclcpp Parameter Callback [Tutorial]

In this ROS2 tutorial I will show you how to use an rclcpp parameter callback, so you can dynamically change parameters’ values while a node is alive. With parameters you can already change the configuration of the node at runtime. But after that, any change to any parameter won’t be taken into account. With a … Read more

ROS2 rclpy Parameter Callback [Tutorial]

After starting a ROS2 node with some parameters, you want to be able to dynamically change those parameters and get notified inside your code? Well, the rclpy parameter callback is what you need to use. (if you were using ROS1 before, this is the same as dynamic_reconfigure, but better). In this tutorial I will show … Read more

ROS2 Create Custom Message (Msg/Srv)

In this tutorial you will learn how to create your own ROS2 custom message (Msg). I will also cover how to create custom services (Srv), as the configuration and the process are the same. In ROS2 the word “message” – when talking about the concept – has been replaced by “interface”. So, to create your … Read more

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 … Read more

ros2 service Command Line Tool – Debug ROS2 Services

In this tutorial you’ll use the ros2 service command line tool to debug the services that you start from within your nodes – or nodes that already exist in your graph. As a reminder, a service has 2 sides: the server (unique), and the client (multiple clients possible). With topics, you can use ros2 topic … Read more

ros2 bag – Save and Replay Topic Data

In this tutorial you’ll learn how to use ROS2 bags, with the ros2 bag command line tool, in order to save and replay data from your ROS2 topics. >> Watch this video as an additional resource to this article: After watching the video, subscribe to the Robotics Back-End Youtube channel so you don’t miss the next tutorials! … Read more

Create a ROS2 package for Both Python and Cpp Nodes

In ROS2, when you create a package you have to select a build type: either ament_cmake or ament_python. This will determine whether your package is a Cpp package, or a Python package. But… How to do if you want to create a ROS2 package containing both Python nodes and Cpp nodes? Good news for you: … Read more

Create a ROS2 Cpp Package

In this tutorial you’ll learn how to create and setup a ROS2 Cpp package. I will explain every step, what every file does, how to install nodes and launch files. This will give you a good foundation for any future ROS2 Cpp package you create. >> Watch this video as an additional resource to this … Read more

Create a ROS2 Python package

In this tutorial you’ll learn how to create and setup a ROS2 Python package. I’ll show you every step, and explain the relation between files, where to write your nodes, how to add launch files, etc. >> Here’s a video tutorial that recaps the first part of this article. Watch it as an additional resource: … Read more

ROS2 Python Publisher Example

In this tutorial I will show you a ROS2 Python publisher example. I will break down the code so you can learn how to create your own ROS2 publisher node in Python. So, here we’ll suppose we have a temperature sensor, and we want to publish the measured temperature every 2 seconds (at 0.5 Hz). … Read more

Install ROS2 Humble on Raspberry Pi 4

In this tutorial you will learn how to install ROS2 Humble Hawksbill on Raspberry Pi 4. ROS2 is a great framework/middleware for robotics applications. With a Raspberry Pi board you can go much further, and embed a complete ROS2 application inside a small robot. For example, if you want to build a mobile base with … Read more

ROS2 Global Parameters [How To]

In this tutorial I will show you how to create a sort of “global parameter server” node to keep ROS2 global parameters for all your other nodes. The thing is, in ROS2, params are specific to a specific node. You set params for a node, you start the node, and if you kill the node, … Read more

Write a Minimal ROS2 Cpp Node

In this tutorial you’ll learn how to create a ROS2 Cpp Node. The code will be simple to focus on the basics, and get a base structure for all your future ROS2 Cpp programs. After a minimal running example I’ll show you what is the recommended way to write your node, using Object Oriented Programming … Read more

How to Learn ROS2

So, you’ve decided to learn ROS2. Great! And now, you wonder where to start. That’s quite normal to feel lost at the beginning. ROS is not an easy subject. It’s big and diverse, and you won’t become an expert in 2 days. In this post I’ll give you some tips about what you should focus … Read more

Write a Minimal ROS2 Python Node

In this tutorial we’re going to write a minimal ROS2 Python node, with no extra functionality, just to see how to start writing any of your ROS2 program. This code will serve as a base structure, and then you’ll be able to add any ROS2 functionality you want: topics, services, parameters, and so on. First … Read more

ROS2 YAML For Parameters

In this tutorial you will see how to use YAML to handle your ROS2 parameters. >> Watch this video as an additional resource to this article: After watching the video, subscribe to the Robotics Back-End Youtube channel so you don’t miss the next tutorials! Why using YAML for ROS2 params So, you start to write a ROS2 … Read more