This page provides installation instructions for the NAV2 stack, as well as an example of how to navigate using the stack. The NAV2 stack is installed by installing the ROS 2 NAV2 packages through the command line and is designed to be used with the turtlebot packages. The page includes step-by-step instructions for running the turtlebot nav2 simulation node and visualizing the working NAV2 simulation.

Table of Contents

Installing the NAV2 stack is as easy as installing the ROS 2 NAV2 packages through the command line. Install the NAV2 packages using your systems package manager:

sudo apt install ros-humble-navigation2
sudo apt install ros-humble-nav2-bringup

Untitled

To understand the NAV2 concepts, its a good idea to install the turtlebot packages and run the examples.

sudo apt install ros-humble-turtlebot3-gazebo

Untitled

Running the example

The NAV2 stack can seem complicated and overwhelming, so its a good idea to run some turtlebot examples first to visualize what a working NAV2 simulation would look like.

Start by setting the key environment variables:

humble
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/humble/share/turtlebot3_gazebo/models

Untitled

Next, run the turtlebot3 nav2 simulation node:

ros2 launch nav2_bringup tb3_simulation_launch.py headless:=False

Untitled

The launch file will launch NAV2 with the AMCL localizer in the turtlebot3_world world. It will also launch the robot state publisher to provide transform, a Gazebo instance with the Turtlebot3 URDF, and RVIZ.

If everything has started correctly, you will see the RViz and Gazebo GUIs like this:

rviz-not-started.png

gazebo_turtlebot1.png

rviz_initial.png

Navigating