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.
- The driver running on the car (
teleop). - RC ready as your override: keep the transmitter in reach and flip
SWBup (manual) the instant you need to take over.
DWB OR TEB.
One launch brings up the whole stack: map server, AMCL, planner, and controller. Pick the local planner with the planner argument.
| Planner | How it drives |
|---|---|
| dwb | Dynamic Window. Steady and predictable, a good default. |
| teb | Timed Elastic Band. Smoother curves, better in tight, cluttered space. |
bashracecar ws osracer # switch this shell to the vendor workspace ros2 launch osracer_navigation nav2.launch.py planner:=dwb
bashracecar ws osracer # switch this shell to the vendor workspace ros2 launch osracer_navigation nav2.launch.py planner:=teb
SET A GOAL.
Nav2 opens RViz with the map loaded and a Navigation 2 panel. First tell it roughly where the car is, then tell it where to go.
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.
