Separate mapping, localization, and navigation
Start a TurtleBot3/Nav2 simulator, initialize its pose, and inspect one navigation goal.
Opening the Python editor…
Requirements and learning goals
Before you start
- Ubuntu 24.04 desktop or a graphics-capable Ubuntu VM
- ROS 2 Jazzy desktop installed using the linked installation guide
You will be able to
- Distinguish a supplied map from a pose estimate
- Send and cancel a simulated navigation goal
The browser exercise above works without extra setup. The project brief below assumes the listed prerequisites and gives you a task and checks to perform. Need a guided first project?
Mapping builds a representation of the surroundings. estimates where the robot is in that map. A planner finds a route; a controller follows it.
This lesson switches from the Go2 VM to the official TurtleBot3/ example. The Go2 runtime used earlier does not include Nav2. Run the commands below in an Ubuntu desktop terminal, not through wendy device ros2. A Mac or Windows host needs an Ubuntu desktop environment with graphics support for this exercise.
Install and launch the named starter
Install ROS 2 Jazzy desktop for Ubuntu 24.04 first. Then install the navigation and simulation packages:
source /opt/ros/jazzy/setup.bash
sudo apt update
sudo apt install ros-jazzy-navigation2 ros-jazzy-nav2-bringup ros-jazzy-nav2-minimal-tb3-sim
ros2 launch nav2_bringup tb3_simulation_launch.py headless:=FalseKeep the launch terminal open. Expect Gazebo and RViz windows. This starter includes the robot, map, transforms, AMCL localizer, and navigation servers. It loads an existing map; it does not teach the robot to build one.
In RViz, use Startup if navigation has not activated. Select 2D Pose Estimate, click the robot's position on the map, and drag along its heading, using Gazebo as your reference. Expect the robot and localization particle cloud to appear. These steps follow the Nav2 Jazzy quickstart.
Check readiness
In a second Ubuntu terminal:
source /opt/ros/jazzy/setup.bash
ros2 lifecycle get /planner_server
ros2 lifecycle get /controller_server
ros2 action info /navigate_to_pose
ros2 run tf2_ros tf2_echo map base_linkExpect both lifecycle to be active, an action server, and a map-to-robot transform. Stop the transform monitor with Ctrl+C. If the transform is missing, repeat the initial-pose step. If the windows do not open, resolve desktop/graphics setup before continuing.
Send and cancel a goal
Use RViz's Navigation2 Goal tool to select a nearby free point and heading. The tool sends a NavigateToPose action. Compare the planned route and reported result with the robot in Gazebo. An accepted goal means the attempt started; arrival needs observed movement to the target.
Send a second, longer goal and use the Nav2 panel's cancel/pause control before arrival. Check that simulated motion stops. Closing a command terminal is not cancellation.
Repeat with a goal inside an occupied region and inspect the rejection or failure. Unknown cells are not automatically free, and the route needs room for the robot's .
To build a map from live scans instead of loading this supplied map, continue with Map a room and navigate to a goal. That lesson runs Toolbox and saves the resulting occupancy map.
Finish and extend
Record the start pose, requested goal, final pose, and cancellation result. Stop the launch terminal with Ctrl+C when finished.
Optional extension: deploy your own configured ROS stack using Wendy's ROS integration. The earlier remote inspection commands apply once that stack is running on a Wendy target. Preserve its distribution, middleware, domain, and message packages when making that separate deployment.
Before you move on
Can you do each of these?
- Distinguish a supplied map from a pose estimate
- Send and cancel a simulated navigation goal
0 of 2 checkpoints solved. Try checkpoint 1