RoboRacer - Learn
latest

Getting Started

  • Start Here!

Overview

  • Introduction
  • Syllabus

Setup

  • VESC setup
  • Lidar Setup
  • RoboRacer Driver Stack
  • Calibrate Odom
  • NoMachine
  • INSTALL - Realsense D435i
  • SETUP - OpenCV
  • SETUP - Realsense ROS
  • SETUP - SLAM
  • SETUP - Nav2

Modules

  • Module A: Introduction to ROS, RoboRacer & the Simulator
  • Module B: Reactive Methods
  • Module C: Mapping & Localization
  • Module D: Planning & Control
  • Module E: Vision
  • Module F: Special Topics
  • Module G: RoboRacer Grand Prix!!
  • Material Downloads

Module A - Introduction

  • Tutorial 1 - ROS 2 Intro and Turtlesim
  • Tutorial 2 - Automatic Emergency Braking

Module B - Reactive Methods

  • Tutorial 3 - Wall Following
  • Tutorial 4 - Follow the Gap

Module C - Mapping & Localization

  • Tutorial 5 - SLAM
  • Tutorial 6 - Nav2 Navigation
    • Nav2 Setup
    • Setup — Particle Filter (Updating Other Robots)
    • 2D Goal Pose Navigation
    • Navigate Through Poses
      • Steps
      • Topics
    • Programmatic Waypoint Navigation

Module D - Planning & Control

  • Tutorial 7 - Particle Filter Localization
  • Tutorial 8 - Pure Pursuit

Weber Assignments

  • Labs

Assignments

  • Labs
  • Races
  • Final Project
  • Grading Rubrics

Support

  • Contact
  • Acknowledgements
RoboRacer - Learn
  • »
  • Tutorial 6 - Nav2 Navigation »
  • Navigate Through Poses
  • Edit on GitHub

Navigate Through Poses¶

Send the car through multiple waypoints in sequence using the Nav2 panel in RViz2.

In the previous tutorial you sent a single 2D Goal Pose. Here you will queue up several waypoints on the map and have Nav2 drive the car through all of them in order.

Before starting, make sure all previous terminals are closed. This tutorial launches everything fresh.

Steps¶

1️⃣ Start Bringup (Terminal 1)¶

Make sure the PlayStation controller is connected to the car, then open a terminal on the robot and launch the car’s sensors and drivers:

cd ~/f1tenth_ws
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 launch f1tenth_stack bringup_launch.py

Or, if you have the alias configured: bringup

Note

If Nav2 later reports Timed out waiting for transform from base_link to odom, the PlayStation controller is likely not connected. The VESC driver requires the joystick to fully initialize, and without it the odom frame is never published.

Warning

Hold R1 for autonomous mode. By default the joystick continuously publishes zero-speed commands at high priority, blocking Nav2. Hold R1 (button 5) on the PlayStation controller to enable autonomous mode — this lets Nav2’s drive commands through. Releasing R1 returns to manual joystick control.

Leave this terminal running.

2️⃣ Launch Nav2 (Terminal 2)¶

Open a new terminal and source the workspace:

cd ~/f1tenth_ws
source /opt/ros/humble/setup.bash
source install/setup.bash

Launch the full Nav2 stack:

ros2 launch f1tenth_stack nav2_launch.py map_name:=hallway_map

Leave this terminal running.

3️⃣ Open RViz2¶

Open a new terminal on the RoboRacer and launch RViz2:

source /opt/ros/humble/setup.bash
rviz2

Add a Map display (Topic: /map, Durability Policy: Transient Local) to confirm the map is visible.

4️⃣ Set Initial Pose¶

Before Nav2 can navigate, AMCL needs to know where the car is on the map.

  • In the RViz2 toolbar, click 2D Pose Estimate

  • Click on the map at the car’s approximate location

  • Drag to set the car’s heading, then release

You should see the robot’s position update on the map. AMCL will refine the estimate as the car moves.

5️⃣ Add Path Visualization¶

In RViz2, add the following displays:

  • Click Add → select Path → set Topic to /plan

  • Click Add → select Path → set Topic to /local_plan

  • Click Add → select MarkerArray → set Topic to /waypoints

6️⃣ Add the Nav2 Panel¶

In RViz2, open Panels → Add New Panel → select Nav2 (from nav2_rviz_plugins).

A new panel will appear at the bottom of RViz2 with navigation controls.

Nav2 panel in RViz2 showing Navigation active, Localization active, and Waypoint / Nav Through Poses Mode button

7️⃣ Add the Nav2 Goal Tool¶

The default 2D Goal Pose button sends goals immediately. To queue waypoints, you need the Nav2 Goal tool instead.

In the RViz2 toolbar, click the + button (next to the 2D Goal Pose button) to add a new tool. Select GoalTool under nav2_rviz_plugins, then click OK.

RViz2 tool type dialog showing nav2_rviz_plugins GoalTool

A new Nav2 Goal button will appear in the toolbar.

RViz2 toolbar showing the Nav2 Goal button added next to 2D Goal Pose

8️⃣ Enable Waypoint Mode¶

In the Nav2 panel at the bottom of RViz2, click the Waypoint / Nav Through Poses Mode button.

Waypoint / Nav Through Poses Mode button in the Nav2 panel

This changes the behavior of the Nav2 Goal tool — instead of sending each goal immediately, it will queue waypoints for batch navigation.

9️⃣ Set Waypoints¶

Use the Nav2 Goal tool in the RViz2 toolbar to place multiple waypoints on the map:

  • Click on the map at the first waypoint location, drag to set heading, release

  • Repeat for each additional waypoint

  • Each waypoint appears as a numbered marker on the map

Place 3–5 waypoints around the track to start. Each waypoint is labeled (wp_1, wp_2, etc.) on the map.

Numbered waypoints (wp_1, wp_2) placed on the map in RViz2

🔟 Start Navigation¶

In the Nav2 panel, click Start Nav Through Poses.

Nav2 panel showing Start Nav Through Poses, Cancel Accumulation, and Start Waypoint Following buttons

The car will begin driving through each waypoint in the order you placed them. The global planner computes a path to each waypoint in sequence, and the controller follows each path segment.

1️⃣1️⃣ Watch the Car Navigate¶

  • The car drives to the first waypoint, then replans to the next

  • Watch the /plan and /local_plan displays update as the car progresses

  • The car stops after reaching the final waypoint

Note

If the car does not move after clicking Start Nav Through Poses, confirm that:

  • You set the initial pose with 2D Pose Estimate (step 4️⃣)

  • You are holding R1 (button 5) on the PlayStation controller to enable autonomous mode

  • Nav2 lifecycle nodes are all active (check ros2 node list)

  • You placed at least one waypoint before clicking start

  • The map is visible in RViz2 (set Durability Policy to Transient Local)

To clear all waypoints and start over, click Cancel in the Nav2 panel, then place new waypoints. You can also cancel from the command line:

ros2 action send_goal /follow_waypoints nav2_msgs/action/FollowWaypoints "{}" --cancel

Topics¶

Topic

Type

Description

/plan

nav_msgs/Path

Global path planned by Nav2 (updates for each waypoint segment)

/local_plan

nav_msgs/Path

Local path the controller is currently following

/waypoints

visualization_msgs/MarkerArray

Waypoint markers shown on the map

/cmd_vel

geometry_msgs/Twist

Velocity commands sent to the car by the controller

Next Previous

© Copyright 2025, Weber State University. Based on RoboRacer (CC-BY-NC-SA 4.0) Last updated on Apr 02, 2026.

Built with Sphinx using a theme provided by Read the Docs.