The code for this section is located in multi_bot_nav_01 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.
In this section I am going to set proper localization for the robot. The idea is to know at each moment, where robot is and which way it faces.
To use the location information, I am going to implement a simple
"straight line" path planner and a simple "pure pursuite lite"
path follower. In future, this same approach can be used to create
path planning/following in 2.5D or 3D space, which is not yet part
of ROS2 stack.
Also, even in "plain" 2D case, custom path planning and following can
be beneficial, as it is often easier to write a code of your own than
to figure out why Nav2 code misbehaves.
As before, both single robot and multiple robots cases are used.
As the robot moves around along the "straight line" path, it will gather coordinates from different sources, and at the end will plot the accuracy chart.