Bird
Raised Fist0
ROSframework~10 mins

ROS Navigation stack architecture - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - ROS Navigation stack architecture
Start: Robot receives goal
↓
Global Planner creates path
↓
Local Planner generates velocity commands
↓
Robot moves and sensors update
↓
Costmaps update obstacles
↓
Feedback loop: Adjust path or commands
↓
Goal reached
The robot receives a goal, plans a global path, then uses local planning and sensor data to move safely, updating maps and commands until the goal is reached.
Execution Sample
ROS
# Pseudocode for navigation flow
receive_goal()
global_path = global_planner(goal)
while not at_goal():
  local_cmd = local_planner(global_path)
  send_velocity(local_cmd)
  update_costmaps()
  adjust_path_if_needed()
This code shows how the robot plans a path and moves step-by-step, updating commands and maps until it reaches the goal.
Execution Table
StepActionInputOutputRobot State
1Receive goalGoal coordinatesGoal storedIdle, waiting
2Global planningGoal, mapGlobal pathReady to move
3Local planningGlobal path, sensor dataVelocity commandsMoving
4Send velocityVelocity commandsRobot movesPosition updated
5Update costmapsSensor dataObstacle map updatedAware of obstacles
6Adjust pathCostmaps, positionNew local commandsAvoiding obstacles
7Check goalPosition, goalGoal reached?If no, loop to step 3
8Goal reachedPosition == goalStop commandsIdle, goal reached
💡 Robot stops when position matches goal coordinates.
Variable Tracker
VariableStartAfter Step 2After Step 4After Step 6Final
goalNoneSet to targetSetSetSet
global_pathNoneComputed pathSameSameSame
local_cmdNoneNoneVelocity commandsUpdated commandsNone (stopped)
robot_positionStart posStart posMoved forwardAdjusted positionGoal pos
costmapEmptyInitial mapUpdated with obstaclesUpdatedFinal obstacle map
Key Moments - 3 Insights
Why does the robot need both a global and a local planner?
The global planner creates a full path to the goal (see step 2 in execution_table), but the local planner adjusts commands in real-time to avoid obstacles and react to changes (steps 3 and 6).
How does the robot know when to stop moving?
At step 7, the robot checks if its current position matches the goal. When true, it stops sending velocity commands (step 8).
What role do costmaps play in navigation?
Costmaps update obstacle information from sensors (step 5), helping the local planner avoid collisions by adjusting velocity commands (step 6).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the robot state after step 4?
APosition updated
BIdle, waiting
CMoving
DGoal reached
💡 Hint
Check the 'Robot State' column for step 4 in the execution_table.
At which step does the robot update its obstacle map?
AStep 3
BStep 5
CStep 6
DStep 7
💡 Hint
Look for 'Update costmaps' action in the execution_table.
If sensor data detects a new obstacle, which step will most likely change?
AStep 2: Global planning
BStep 4: Send velocity
CStep 6: Adjust path
DStep 8: Goal reached
💡 Hint
Refer to how local commands adjust based on updated costmaps in step 6.
Concept Snapshot
ROS Navigation stack:
- Receive goal → Global planner creates path
- Local planner generates velocity commands
- Robot moves, sensors update costmaps
- Feedback loop adjusts commands
- Stops when goal reached
Full Transcript
The ROS Navigation stack works by first receiving a goal position for the robot. Then, the global planner calculates a path from the robot's current position to the goal using the map. The local planner takes this path and sensor data to create velocity commands that safely move the robot. As the robot moves, sensors update costmaps to reflect obstacles. The system loops, adjusting commands to avoid obstacles and stay on path. When the robot reaches the goal, it stops moving. This flow ensures safe and efficient navigation.

Practice

(1/5)
1. Which component in the ROS Navigation stack is responsible for localizing the robot on a known map?
easy
A. amcl
B. move_base
C. map_server
D. costmap_2d

Solution

  1. Step 1: Understand the role of amcl

    amcl stands for Adaptive Monte Carlo Localization and it helps the robot find its position on a known map.
  2. Step 2: Differentiate from other components

    map_server provides the map, move_base plans and executes paths, and costmap_2d manages obstacle data.
  3. Final Answer:

    amcl -> Option A
  4. Quick Check:

    Localization = amcl [OK]
Hint: Localization uses amcl in ROS Navigation stack [OK]
Common Mistakes:
  • Confusing map_server as localization
  • Thinking move_base localizes robot
  • Mixing costmap_2d with localization
2. Which of the following is the correct way to launch the ROS Navigation stack using move_base?
easy
A. rosrun map_server map_server
B. rosrun move_base move_base
C. roslaunch amcl amcl.launch
D. roslaunch move_base move_base.launch

Solution

  1. Step 1: Identify the launch command for move_base

    The Navigation stack uses launch files to start nodes with configurations. The correct launch file for move_base is move_base.launch.
  2. Step 2: Differentiate from other commands

    rosrun runs single nodes without launch files. amcl.launch and map_server are for other components.
  3. Final Answer:

    roslaunch move_base move_base.launch -> Option D
  4. Quick Check:

    Launch move_base with roslaunch [OK]
Hint: Use roslaunch move_base move_base.launch to start navigation [OK]
Common Mistakes:
  • Using rosrun instead of roslaunch for move_base
  • Launching wrong component like amcl for navigation
  • Missing launch file name in command
3. Given the following ROS Navigation stack setup, what will happen if the costmap_2d detects an obstacle in front of the robot?
1. Robot receives sensor data.
2. costmap_2d updates obstacle position.
3. move_base plans path.
medium
A. Robot ignores obstacle and moves forward.
B. Robot stops and replans path to avoid obstacle.
C. Robot shuts down navigation stack.
D. Robot moves backward without replanning.

Solution

  1. Step 1: Understand costmap_2d role in obstacle detection

    costmap_2d creates a map of obstacles around the robot using sensor data.
  2. Step 2: Analyze move_base behavior on obstacle detection

    move_base uses the costmap to plan safe paths. When an obstacle is detected, it replans to avoid collision.
  3. Final Answer:

    Robot stops and replans path to avoid obstacle. -> Option B
  4. Quick Check:

    Obstacle detected = path replanned [OK]
Hint: Obstacle detected triggers path replanning in move_base [OK]
Common Mistakes:
  • Assuming robot ignores obstacles
  • Thinking navigation stack shuts down on obstacles
  • Believing robot moves backward automatically
4. You launched the ROS Navigation stack but the robot does not move even though the goal is set. Which of the following is the most likely cause?
medium
A. The robot's battery is fully charged.
B. map_server is publishing the map correctly.
C. amcl is not publishing the robot's pose.
D. move_base is receiving goals and planning paths.

Solution

  1. Step 1: Check localization status

    If amcl is not publishing the robot's pose, move_base cannot know where the robot is to plan a path.
  2. Step 2: Evaluate other components

    map_server publishing map and move_base receiving goals are good signs. Battery charged is unrelated to navigation stack software.
  3. Final Answer:

    amcl is not publishing the robot's pose. -> Option C
  4. Quick Check:

    Localization failure = no movement [OK]
Hint: No movement? Check if amcl publishes pose [OK]
Common Mistakes:
  • Ignoring localization as cause
  • Assuming battery status affects navigation stack
  • Thinking map_server alone controls movement
5. You want your robot to navigate in a dynamic environment where obstacles can appear suddenly. Which combination of ROS Navigation stack components should you configure to ensure safe and smooth navigation?
hard
A. Use map_server for static map, amcl for localization, move_base with local_costmap for obstacle avoidance.
B. Use only map_server and move_base without costmaps.
C. Use amcl and disable move_base to avoid replanning.
D. Use costmap_2d only without localization or map.

Solution

  1. Step 1: Identify components for dynamic obstacle handling

    local_costmap updates obstacles in real-time for move_base to avoid them.
  2. Step 2: Combine with localization and static map

    amcl localizes robot on the static map from map_server. Together they enable safe navigation.
  3. Step 3: Evaluate other options

    Options without costmaps or localization will fail in dynamic environments.
  4. Final Answer:

    Use map_server, amcl, move_base with local_costmap -> Option A
  5. Quick Check:

    Static map + localization + local costmap = safe navigation [OK]
Hint: Combine static map, localization, and local costmap for dynamic obstacles [OK]
Common Mistakes:
  • Ignoring local costmap for dynamic obstacles
  • Disabling move_base disables path planning
  • Using costmap without localization or map
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard