ROS2 and Gazebo: multiple robots

Introduction

In this section I am going to add Nav2 functionality to the multi robots example from the previous section. Note that a single robot example (I created earlier) also has scripts that do navigation, for example, waypoint following. This section does include such scripts for historical reasons, andt they work: in a "multi-robot script" 04_charger_docking_obstacles_multi.py you need to comment out descriptions for two different robots and uncomment description for a single robot with name equal to "".

The code for this section is located in multi_bot_04 part of an archive. Note that archive includes some additional folders, like maps and worlds, that are used by all projects and therefore are located outside of them. Also note that we use ROS2 Galactic now.

To tell the truth, in a perfect world, all you need to do to switch your code from single robot to multi robot, is to add a namespace, preferably in one place. One liner! Wow!
Instead, I have to do a long and tedious research on the "why it fails again" subject. It is quite intimidating, and the only reason for that is a poor design of Nav2 libraries (personal opinion). This was your fair warning. Hold tight.

(C) snowcron.com, all rights reserved

Please read the disclaimer