This document will take you through the process of installing the Nav2 binaries and navigating a simulated Turtlebot 3 in the Gazebo simulator.
See the Build and Install for other situations such as building from source or working with other types of robots.
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.
Install the ROS 2 binary packages as described in the official docs
Install the Nav2 packages using your operating system’s package manager:
sudo apt install ros-<ros2-distro>-navigation2 sudo apt install ros-<ros2-distro>-nav2-bringup
Install the Turtlebot 3 packages:
sudo apt install ros-<ros2-distro>-turtlebot3*
Running the Example¶
Start a terminal in your GUI
Set key environment variables:
source /opt/ros/<ros2-distro>/setup.bash export TURTLEBOT3_MODEL=waffle export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/<ros2-distro>/share/turtlebot3_gazebo/models
In the same terminal, run
ros2 launch nav2_bringup tb3_simulation_launch.py
ROS 2 Dashing Diademataor earlier, use
nav2_simulation_launch.py. However, it is recommended to use the most recent ROS 2 LTS distribution for improved stablity and feature completeness.
This launch file will launch Nav2 with the AMCL localizer in the
turtlebot3_worldworld. It will also launch a 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:
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.