Tutorial Overview
π― Learning Objectives
By the end of this tutorial, you will:
β
Understand Nav2 navigation stack architecture
β
Launch full autonomous navigation system
β
Send navigation goals to robot
β
Monitor navigation status and progress
β
Understand costmaps (global and local)
β
Configure path planning and obstacle avoidance
β
Tune navigation parameters for your environment
β
Handle navigation failures gracefully
β
Create autonomous navigation missions
β±οΈ Time Required
Reading & Architecture: 30 minutes
First Navigation: 35 minutes
Costmap Understanding: 30 minutes
Parameter Tuning: 40 minutes
Advanced Navigation: 45 minutes
Mission Planning: 30 minutes
Total: ~210 minutes (3.5 hours)
π Prerequisites
β
Completed ALL previous tutorials (especially SLAM and Localization)
β
Can localize robot on maps
β
Understanding of coordinate frames
π οΈ What You'll Need
β
Beetlebot (fully charged, all sensors working)
β
Laptop with ROS2 Jazzy
β
Wireless controller (for emergency stop)
β
Previously created map
β
Mapped environment (unchanged)
β
Large clear space (recommended 5m Γ 5m+)
β
Patience and readiness to iterate!
Part 1: Navigation Architecture
Nav2 Stack Overview
Nav2 (Navigation2) = ROS2 navigation framework
Complete autonomous navigation system:
Key Components Explained
1. BT Navigator (Behavior Tree Navigator)
Coordinates all other servers
Handles retries, cancellations, timeouts
Implements complex behaviors (navigate, follow path, etc.)
2. Planner Server
Global planner: Long-term path from start β goal
Algorithms: NavFn (Dijkstra), Smac (State Lattice), Theta* (any-angle)
Uses: Global costmap (entire map)
Output: Sequence of waypoints (path)
Runs: Infrequently (on new goal, or replanning needed)
3. Controller Server
Local controller: Follow global path, avoid dynamic obstacles
Algorithms: DWB (Dynamic Window), TEB (Timed Elastic Band), MPPI
Uses: Local costmap (nearby area only)
Output: Velocity commands (/cmd_vel)
Runs: High frequency (~10-20 Hz)
4. Smoother Server (Optional)
Smooths jagged paths from planner
Makes motion more natural
5. Recovery Server
Behaviors: Spin in place, back up, wait, clear costmap
6. Costmap 2D
Represents obstacles and free space
Two instances: Global (entire map) and Local (around robot)
Multiple layers: Static map, obstacle, inflation, voxel, etc.
Coordinate Frames in Navigation
Critical frames:
Why two (map and odom)?
Map accurate but can jump (localization corrections)
Controllers use odom (need continuity)
Planners use map (need global accuracy)
Part 2: Launching Navigation
Prerequisites Check
Before launching navigation:
Launch Nav2 Stack
Your robot likely has navigation pre-configured:
What launches:
Configured with Beetlebot parameters
Ready to receive navigation goals
Full navigation visualization:
[PLACEHOLDER: Screenshot of fully configured RViz for navigation]
Part 3: Your First Autonomous Navigation
Setting a Navigation Goal
Method 1: Nav2 Goal (RViz) - Recommended
Method 2: Action Client (Command Line)
Method 3: Python Script
[!WARNING] TODO: Exercise Script Not Included in Core Repository The send_nav_goal.py script below is an educational exercise. It is not pre-installed. You are encouraged to create it yourself!
Usage:
Exercise 11.1: First Navigation
Task: Navigate to a simple goal
Setup:
Procedure:
Typical time: 30-60 seconds for 3-5m navigation
Monitoring Navigation Status
Check navigation state:
View current cmd_vel:
Part 4: Understanding Costmaps
What are Costmaps?
Costmap = 2D grid representing traversability
Cell values (0-255):
Purpose:
Planners: Find paths through low-cost areas
Controllers: Avoid high-cost areas
Safety: Prevent collisions
Global Costmap:
Static (from saved map) + dynamic (recent scans)
Update rate: Slow (~1 Hz)
Purpose: Long-term planning
Local Costmap:
Rolling window around robot (e.g., 5m Γ 5m)
Dynamic obstacles only (from recent LiDAR)
Used by: Local controller
Update rate: Fast (~5-10 Hz)
Purpose: Short-term obstacle avoidance
Typical layer stack:
[PLACEHOLDER: Diagram showing costmap layers combining]
Visualizing Costmaps
In RViz (already configured):
Exercise 11.2: Costmap Observation
Task: Understand how costmaps work
Test 1: Static obstacles
Test 2: Dynamic obstacles
Test 3: Inflation
Part 5: Path Planning
Finds path from current position β goal
Algorithm (NavFn / Dijkstra by default):
Alternative planners:
Smac Planner: State lattice, considers robot kinematics
Theta:* Any-angle paths (not grid-aligned)
Smac Hybrid-A:* Car-like kinematics
Beetlebot default: NavFn (simple, fast, proven)
Path Characteristics
Good path properties:
β
Smooth curves (not zigzag)
β
Wide clearance from obstacles
β
Reasonable length (not excessively long)
β
Feasible for differential drive
Poor path properties:
β Cuts corners too tight
β Requires in-place rotations where not needed
β Unnecessarily long detours
When does global planner replan?
Exercise 11.3: Path Planning Scenarios
Scenario 1: Direct path
Scenario 2: Around obstacle
Scenario 3: Through doorway
Scenario 4: Complex environment
Part 6: Local Control
Controller's Job
Follow global plan while:
Avoiding dynamic obstacles
Respecting velocity limits
Algorithm (DWB - Dynamic Window Approach):
DWB Scoring Components
Typical scoring:
Velocity Limits
Controller respects these limits:
Note: These are controller limits. Robot's Lyra controller also has hardware ramping (8 RPM/cycle)!
Exercise 11.4: Controller Behavior
Task: Observe controller adapting to situations
Test 1: Following straight path
Test 2: Avoiding obstacle
Test 3: Tight passage
Test 4: Final approach
Part 7: Parameter Tuning
Default parameters work reasonably for most cases!
Tune when:
Robot too cautious (won't go through doorways)
Robot too aggressive (cuts corners)
Motion not smooth (jerky, oscillating)
Specific environment needs (narrow hallways, open warehouse)
Key Parameters to Tune
Global Costmap:
Local Costmap:
Controller (DWB):
Common Tuning Scenarios
Scenario 1: Robot won't go through doorway
Problem: Too cautious, inflation too large
Solution:
Scenario 2: Robot cuts corners too close
Problem: Not enough safety margin
Solution:
Scenario 3: Motion too jerky
Problem: Controller changing commands too rapidly
Solution:
Scenario 4: Robot too slow
Problem: Conservative velocity limits
Solution:
Exercise 11.5: Parameter Tuning
Task: Optimize for your environment
Baseline test:
Tuning iteration:
Document your findings!
Part 8: Recovery Behaviors
What Happens When Stuck?
Robot gets stuck when:
Can't find feasible trajectory
Nav2 Recovery Behaviors:
Recovery Sequence
Configurable behavior tree:
After 6 retries: Goal aborted
Manual Recovery
If robot stuck, you can trigger manually:
Exercise 11.6: Recovery Testing
Task: Observe recovery behaviors
Test 1: Blocked path
Test 2: Trap robot
Expected: Robot should try ~6 recovery attempts over 1-2 minutes before aborting
Part 9: Advanced Navigation
Waypoint Following
Navigate through sequence of waypoints:
Usage:
Robot will visit each waypoint in sequence!
Dynamic Goal Updates
Change goal mid-navigation:
Use case:
Pause and Resume
Pause navigation:
Resume:
Robot stops but remembers goal, can continue later
Part 10: Creating Autonomous Missions
Mission Planning
Complex autonomous behavior:
Run mission:
Exercise 11.7: Create Custom Mission
Task: Design and execute multi-step mission
Requirements:
Include different goal orientations
Pause at each waypoint (simulate task)
Handle navigation failures gracefully
Example missions:
Security patrol: Visit 4 corners, check each area
Delivery: Pick up at point A, deliver to point B, return
Inspection: Navigate to specific equipment locations
Cleaning: Cover entire floor systematically
Part 11: Troubleshooting Navigation
Problem: Robot Won't Start Navigation
Checklist:
Problem: Robot Stuck Oscillating
Symptoms: Robot wiggles back and forth, makes no progress
Causes:
Problem: Path Goes Through Walls
Cause: Costmap not reflecting actual obstacles
Debug:
Problem: Navigation Very Slow
Causes:
Too conservative parameters
Too many trajectory samples
General Debugging
Most navigation issues fixed by:
β‘ Power cycle robot (clears stuck states)
Clear costmaps (remove stale obstacles)
Re-localize (set 2D Pose Estimate again)
Check RViz alignment (scans should match map)
Verify goal validity (in free space, reachable)
Part 12: Knowledge Check
What's the difference between global and local costmaps?
Why does robot need both a planner and controller?
What triggers recovery behaviors?
Why inflate obstacles in costmap?
Can navigation work without localization?
Final Challenge
Task: Complete autonomous navigation system
Mission: Autonomous Office Patrol
Requirements:
Create map of test environment (or use existing)
Configure navigation stack
Create patrol route with 6+ waypoints
Robot must:
Localize automatically (global localization)
Execute patrol route autonomously
Handle dynamic obstacles (person walks through)
Complete 3 full patrol loops
Log all waypoint arrivals with timestamps
Tune parameters for optimal performance
Handle failures gracefully (retry, skip unreachable waypoints)
Deliverable:
Complete launch file for autonomous operation
Mission script with error handling
Performance report:
Success rate per waypoint
Number of recovery behaviors triggered
Video recording of full mission
Estimated time: 3-4 hours for complete implementation and testing
Part 13: What You've Learned
β
CONGRATULATIONS! YOU'VE COMPLETED THE ENTIRE COURSE!
You now have mastered:
Foundation (Tutorials 1-3):
β
Robot hardware and architecture
β
ROS2 communication fundamentals
β
Simulation for safe testing
Perception (Tutorials 4-5):
β
Sensor data visualization and interpretation
β
IMU signal processing and filtering
Control (Tutorials 6-7):
β
Teleoperation techniques
β
Multi-sensor fusion with EKF
Mapping & Localization (Tutorials 8-10):
β
SLAM mapping of environments
β
Camera-based perception
β
Localization on known maps
Autonomous Navigation (Tutorial 11):
β
Nav2 stack architecture
β
Path planning algorithms
β
Local trajectory control
β
Complex mission planning
Beyond This Course
π― You're Now Ready For:
Advanced Topics:
Outdoor navigation (GPS fusion)
3D navigation (stairs, ramps)
Semantic mapping (recognize object types)
Machine learning perception (object detection, recognition)
Visual SLAM (camera-based)
Advanced planners (RRT, RRT*, etc.)
Real Applications:
Competitions:
Research:
Learning-based navigation
Robust navigation in dynamic environments
Quick Reference
Complete Navigation Launch
Essential Navigation Commands
Configuration File Locations
Typical Navigation Stack Flowchart
π YOU DID IT!
You've completed all 11 tutorials of the Beetlebot wiki!
What you've accomplished:
Built maps of your environment
Localized robot on those maps
Commanded autonomous navigation
Tuned parameters for optimal performance
Created complex autonomous missions
This is REAL robotics! π€
The skills you've learned here are used in:
And countless other applications
Resources:
ROS2 Documentation: https://docs.ros.org
Nav2 Documentation: https://navigation.ros.org
Community forums, GitHub, research papers
Practice:
Create more complex environments
Test in different conditions
Experiment with parameters
Contribute to open source
Share Your Work!
We'd love to see what you build:
Post videos of your robot navigating
Share parameter configurations
You're now part of the robotics community! π
Tutorial Series Complete! π
β Return to Tutorial Index
β Visit Support & Resources
β Start your own robotics project
β Goto next section for optimization!
Last Updated: January 2026
Tutorial 11 of 11 - Advanced Level
Estimated completion time: 210 minutes (3.5 hours)
οΏ½οΏ½ COURSE COMPLETE! π