Quickstart
This document will take you through the process of installing the Nav2 binaries and navigating a simulated Turtlebot 3 in the Gazebo simulator.
Note
See the Build and Install for other situations such as building from source or working with other types of robots.
Warning
This is a simplified version of the Turtlebot 3 instructions. We highly recommend you follow the official Turtlebot 3 manual if you intend to continue working with this robot beyond the minimal example provided here.
Installation
-
Install the ROS 2 binary packages as described in the official docs
-
Source your ROS 2 installation to set up the environment:
source /opt/ros/<ros2-distro>/setup.bash -
Install the Nav2 packages using your operating system's package manager:
Warning
Nav2 does not currently release binaries on rolling, so it must be build from source.
sudo apt update sudo apt install \ ros-$ROS_DISTRO-navigation2 \ ros-$ROS_DISTRO-nav2-bringup -
(Optional) Install the Turtlebot 3 & 4 packages for Gazebo. It should be automatically installed with
nav2_bringup:sudo apt install ros-$ROS_DISTRO-nav2-minimal-tb\*
Running the Example
-
Start a terminal in your GUI
-
In the same terminal, run:
source /opt/ros/<ros2-distro>/setup.bash ros2 launch nav2_bringup tb3_simulation_launch.py headless:=FalseNote
headlessdefaults to true; if not set to false, gzclient (the 3d view) is not started.This launch file will launch Nav2 with the AMCL localizer in the simulation world. It will also launch the robot state publisher to provide transforms, a Gazebo instance with the Turtlebot3 URDF, and RVIZ.
If everything has started correctly, you will see the RViz and Gazebo GUIs like this (this is Gazebo Classic, but what you see with modern Gazebo is virtually identical):
-
If not autostarting, click the "Startup" button in the bottom left corner of RViz. This will cause Nav2 to change to the Active state. It should change appearance to show the map.
Navigating
After starting, the robot initially has no idea where it is. By default, Nav2 waits for you to give it an approximate starting position. Take a look at where the robot is in the Gazebo world, and find that spot on the map. Set the initial pose by clicking the "2D Pose Estimate" button in RViz, and then down clicking on the map in that location. You set the orientation by dragging forward from the down click.
If you are using the defaults so far, the robot should look roughly like this.
If you don't get the location exactly right, that's fine. Nav2 will refine the position as it navigates. You can also, click the "2D Pose Estimate" button and try again, if you prefer.
Once you've set the initial pose, the transform tree will be complete and Nav2 will be fully active and ready to go. You should see the robot and particle cloud now.
Next, click the "Navigaton2 Goal" button and choose a destination. This will call the BT navigator to go to that goal through an action server. You can pause (cancel) or reset the action through the Nav2 rviz plugin shown.
Now watch the robot go!

