Manual

Navigate through a set of poses
Follow Waypoints
This example demonstrates how to follow waypoints. The Nav2 stack is given a set of waypoints
on the map and creates a path that goes through each waypoint in order until the last waypoint
is reached. The robot then attempts to drive along the path. The difference between this
example and Navigating Through Poses is that when following waypoints the robot will plan to
reach each waypoint individually, rather than planning to reach the last pose by driving through
the other poses. This example is demonstrated in the depot world of the TurtleBot 4 simulation.
To run this example, start the Ignition simulation:
ros2 launch turtlebot4_ignition_bringup ignition.launch.py nav:=true slam:=off localization:=true
Once the simulation has started, open another terminal and run:
ros2 run turtlebot4_python_tutorials follow_waypoints
Code breakdown
The source code for this example is available here.
Lets take a look at the main function.