Goals

The goals for this lab are to:

Resources

NOTE: If the command line tools below are not working correctly, try restarting the ROS 2 daemon:

Deliverables

By the end of this Lab you will need to:

Launch Robot

Follow the instructions from the ROS 2 CLI lab to bring up either the simulated or actual turtlebot.

You won’t need to launch rviz at this point. The navigation package will launch an rviz with a navigation-specific configuration.

Launch Navigation

In Simulation

For The Real Robot

(This assumes you are running from the folder where you downloaded the map files. Otherwise, provide the full path to the map yaml file.)

Try it Out

Experiment with localizing the robot and sending navigation goals using Rviz2.

Command Line Action Interface

The navigation system uses the ROS 2 action interface to send and monitor navigation requests. “Actions” are the ROS mechanism for making long-running requests.

Type the following in the terminal:

You should see this output:

#goal definition
geometry_msgs/PoseStamped pose
string behavior_tree
---
#result definition
std_msgs/Empty result
---
geometry_msgs/PoseStamped current_pose
builtin_interfaces/Duration navigation_time
int16 number_of_recoveries
float32 distance_remaining

The three areas represent the request format, the result format, and the format for feedback.

Sending an action request

It is possible to send action requests through the ROS 2 CLI. First, we’ll need an example of the required format for navigation goals:

Next, we use ros2 action to send a goal location:

Where the GOAL field uses the format we discovered above. The only fields you should need to change from the prototype are the x and y positions of the goal.

Try adding the -f flag to see the feedback messages that are available during navigation:

COPY/PASTE a sample feedback message into nav.txt

Open the file

in a text editor and examine its contents.

Answer the following questions in nav.txt: * Does the global planner use A* by default? * What is the default maximum velocity allowed by the navigation controller?

The value of these navigation parameters can be accessed and modified at run time using the ros2 param command line tool. For example, we can check the goal tolerance for the global planner as follows:

Use the command line tool to set the maximum velocity for the /controller_server node to .05. Try navigating to a new goal location. If it worked correctly, the robot should move significantly more slowly after the parameter change.

Submitting

Submit nav.txt through Canvas.