AUTONOMOUS NAVIGATION
With a saved map, turns a click in RViz into a drive. It localizes the car on the map with , plans a path to your goal, and follows it while avoiding obstacles.
YOU NEED A MAP
Navigation runs in the foreground on the same footing as mapping: on top of the driver, which stays running, and the autonomy base.
- A saved map from Mapping. You drive it by the name you saved it under.
- The driver up, as usual, for
/scanand/odom. - The autonomy base running in its own terminal (see File system). It also carries the twist bridge, which is how Nav2 reaches the motors.
- RC ready as your override: keep the transmitter in reach and flip
SWBup (manual) the instant you need to take over.
START NAV2
One command brings up the whole stack: map server, AMCL, planner and controller. The first argument picks the local planner and the second names the map. Both have defaults, so the bare command runs TEB on a map called map.
bashracecar navigation # teb, on the map named "map" racecar navigation lab # teb, on the map named "lab" racecar navigation dwb lab # dwb, on the map named "lab"
Name a map that does not exist and it stops before launching anything, then lists the maps you do have.
| Planner | How it drives |
|---|---|
| teb | Timed Elastic Band. The default. Smoother curves, better in tight, cluttered space. |
| dwb | Dynamic Window. Steady and predictable; worth trying if TEB is fighting the car. |
SET A GOAL
The launch itself has no window. Open the goal-setting view in a second terminal, from the car's desktop rather than over SSH. First tell it roughly where the car is, then tell it where to go.
bashracecar navigation rviz
Use 2D Pose Estimate and drag an arrow where the car actually sits, pointing the way it faces. The AMCL particle cloud tightens around the car as the scan matches the map.
Use Nav2 Goal and drag an arrow at the destination, with the arrow giving the heading to arrive on. Nav2 plans a path and the car starts driving.
The Navigation 2 panel reports Localization, Distance remaining, Time taken, and Recoveries. Feedback reads reached when it arrives.

