ROS2 Tutorial: Waypoint Follower

Theory

Waypoint Follower uses NavigateToPose action server to move the robot through a set of waypoints, in order they are provided. Additionally, nav2_waypoint_follower has a plugin interface for specific task executors. Waypoint Task Executor allows to perform custom behaviour when a waypoint is reached (like waiting, taking a picture or doing some complex work). Finally, it has stop_on_failure parameter, that specifies if we should move to a next waypoint if the current one is not reachable.

stop_on_failure (True/False): If false, will continue to next waypoint.

loop_rate (Default: 20): Rate to check for results from current navigation task.

waypoint_task_executor_plugin (string: "wait_at_waypoint"): define tasks the robot should perform upon arriving to a waypoint.

Example (fragment of nav2_params.yaml):

                        waypoint_follower:
                        ros__parameters:
                            waypoint_task_executor_plugin: "wait_at_waypoint"
                            wait_at_waypoint:
                                plugin: "nav2_waypoint_follower::WaitAtWaypoint"
                                enabled: True
                                waypoint_pause_duration: 0
                

The nav2_waypoint_follower namespace includes the following plugins:
WaitAtWaypoint
PhotoAtWaypoint
InputAtWaypoint
which corresponds to a standard (ROS2 provided) action that the bot should perform when it reaches a waypoint.

State Estimation

Generally, we need to provide two transformations for Nav2 to work. First is map to odom transform, it is provided by a positioning system (localizetion, mapping, SLAM). Second in odom to base_link, it is provided by an odometry system.

The REP 105 standard defines the required frames and conventions for Nav2 to work. Generally, it states that we should at least have a map to odom to base_link to [sensor_frames] transformations for the robot. To represent time synchronized transformations we use TF2: the time-variant transformations library.

(C) snowcron.com, all rights reserved

Please read the disclaimer