Week 11 • CMPSC 304 Robotic Agents
Press Space or → to advance
| Cost | Meaning | Visual |
|---|---|---|
| 0 | Free space — safe to traverse | No color |
| 1–252 | Increasing cost (near obstacles) | Blue → red |
| 253 | Inscribed — robot center would hit obstacle | Cyan ring |
| 254 | Lethal — occupied cell | Purple/pink |
| 255 | Unknown | No data |
inflation_radius. The closer to an obstacle, the higher the cost. The planner treats the robot as a point and avoids high-cost cells.
=======
inflation_radius; nearby cells get higher cost, so paths stay farther from walls.
>>>>>>> 75af8b3a9148c651a7452130fe37a5b854aa9b86
resolution: 0.05 m/cell | inflation_radius: 0.15 m → buffer = 3 cells
# = wall) 0 1 2 3 4 5
=======
Config: resolution: 0.05 m/cell | inflation_radius: 0.15 m
Buffer width: 0.15 ÷ 0.05 = 3 cells
Start with a 6×6 map with a wall on the left:
Raw map (# = wall)
0 1 2 3 4 5
>>>>>>> 75af8b3a9148c651a7452130fe37a5b854aa9b86
0 # . . . . .
1 # . . . . .
2 # . . . . .
3 # . . . . .
<<<<<<< HEAD
After inflation (I = inflated)
0 1 2 3 4 5
0 # I I I . .
1 # I I I . .
2 # I I I . .
3 # I I I . .
Key rule: Measure straight-line distance (in cells) from each free cell to the nearest #. If distance ≤ buffer width, the cell is inflated. Diagonal neighbors are √2 ≈ 1.4 cells away.
=======
After inflation (I = inflated)
0 1 2 3 4 5
0 # I I I . .
1 # I I I . .
2 # I I I . .
3 # I I I . .
4 # I I I . .
5 # I I I . .
Cols 1–3 are within 3 cells of col 0; cols 4–5 remain cost 0.
0 1 2 3 4 5
0 . . . . . G
1 . I I . . .
2 . I # . . .
3 . I # . . .
4 . . . . . .
5 S . . . . .
I cells): high costrobot_radius tells the costmap how close the robot center can get to a wall. Wrong value → bad plans.
robot_radius = inscribed zone; inflation_radius = how far beyond that the planner prefers to stay away.
=======
robot_radius to set how close the robot center can approach walls. If it mismatches hardware, planning fails.
robot_radius sets the inscribed collision zone; inflation_radius adds extra clearance.
>>>>>>> 75af8b3a9148c651a7452130fe37a5b854aa9b86
tolerance = how close robot must get before Nav2 declares succeeded.
| Component | Role | Node |
|---|---|---|
| Map Server | Loads/serves static map | map_server |
| AMCL | Localizes robot on map | amcl |
| Global Costmap | Full-map cost grid | global_costmap |
| Local Costmap | Real-time local cost grid | local_costmap |
| Planner Server | Global path planning | planner_server |
| Controller Server | Local path following | controller_server |
| BT Navigator | Coordinates everything | bt_navigator |
| Parameter | Controls | If Increased |
|---|---|---|
min/max_particles | AMCL confidence vs compute | More robust, slower |
odom_alpha1/2 | Assumed odom noise | AMCL trusts odom less |
pf_err | Target localization error | Fewer particles needed |
use_astar | A* vs Dijkstra | Often faster planning |
tolerance | Goal reached distance | Easier completion, less precise |
desired_linear_vel | Speed cap | Faster, less control margin |
lookahead_dist | Controller look-ahead | Smoother, may overshoot turns |
max_angular_vel | Turn-rate cap | Quicker turns, oscillation risk |
Great for testing
NavigateToPose actionRequired for P4 Part 3
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py # Terminal 1
ros2 launch turtlebot3_navigation2 navigation2.launch.py map:=$HOME/map.yaml # Terminal 2
| Concept | What It Does |
|---|---|
| AMCL | Particle filter — localizes robot on a known map |
| Costmap | Grid with obstacle costs + inflation for safe planning |
| Global Planner | Optimal path on full map (Dijkstra/A*) |
| Local Planner | Follows path reactively, avoids dynamic obstacles |
| Nav2 | Framework combining all navigation components |
| Recovery | Built-in behaviors when robot gets stuck |