Developing Nav2-based applications using ROS 2 and C++
This section will discuss the ROS 2 C++ application designed to deliver medicine to a specific room.
Figure 8.13 shows how our application communicates with Nav2.

Figure 8.13: Communication between navigation application and Nav2
The application we are developing is a Nav2 action client. We know Nav2 has a BT Navigator Server node, which serves as an action server with an action name called /navigate_to_pose and an action type of nav2_msgs/action/NavigateToPose [22], as well as /navigate_through_poses with an action type of nav2_msgs/action/NavigateThroughPoses [23]. When we call the action /navigate_to_pose with a goal position on the map, the BT Navigator can begin planning the path and move the robot to that location. The request will fail if the pose is invalid or obstructed.
The action /navigate_through_poses allows the robot to move through several waypoints. These actions can also be called from the...