Checkpoint 3
Last Updated: Mar 30, 2026
Using the SLAM algorithm you implemented previously, you can now construct a map of an environment with the MBot. In this checkpoint, you will add path planning and autonomous exploration capabilities.
Contents
- Contents
- Task 3.1 Path Planning
- Task 3.2 Map Exploration
- Task 3.3 Localization with Estimated and Unknown Starting Position
- Checkpoint Submission
Task 3.1 Path Planning
Implement a path planner. Given start pose, end pose, and the map, output the path in waypoints.
TODO
- All work for this task is in the package
mbot_nav. Start withnavigation_node.cppas main. Underplannersfolder, we have A star and Theta star planning template, and an example skeleton. After finishing the A star, feel free to try any other planners.- You also need to complete
obstacle_distance_grid.cpp. We pre-compute the obstacle map in the file.
- You also need to complete
- When finished, compile your code:
cd ~/mbot_ros_labs colcon build --packages-select mbot_nav source install/setup.bash- Important: You must source the workspace in every relevant terminal after each build. If you don’t, ROS will keep using the old code, and your changes will not take effect.
Planning-only test
In this test, the navigation node listens to /initialpose and /goal_pose topics. Publishing both in Rviz or Foxglove triggers the A* planner, and the planned path will be displayed if successful. No real robot movement occurs, purely to test the path calculation.
- Run launch file to publish map and run nagivation node in VSCode Terminal:
cd ~/mbot_ros_labs source install/setup.bash ros2 launch mbot_nav path_planning.launch.py map_name:=maze1 - Open Rviz to set initial pose and goal pose in NoMachine Terminal:
cd ~/mbot_ros_labs/src/mbot_nav/rviz ros2 run rviz2 rviz2 -d path_planning.rvizor run Foxglove bridge
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
Video Demo: shows both rviz and foxglove usage
Real world test
After validating your planner, we can test the full stack in real world.
- Construct a map and save it in
mbot_ros_labs/src/mbot_nav/maps. You may use your own mbot_slam code or use slam_toolbox to map.- Good map quality is important, so we provide a guide on how to use slam_toolbox! If you’re not satisfied with your mapping performance, but still need a map to test your A* or exploration algorithms, feel free to take a look.
- Then compile the
mbot_navpackage:cd ~/mbot_ros_labs colcon build --packages-select mbot_nav source install/setup.bash - Launch the robot model, TF, LiDAR node in VSCode Terminal.
ros2 launch mbot_bringup mbot_bringup.launch.py - Run launch file to publish map and run nagivation node in VSCode Terminal:
cd ~/mbot_ros_labs source install/setup.bash ros2 launch mbot_nav path_planning.launch.py map_name:=your_map pose_source:=tf - Run localization node in VSCode Terminal:
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_slam localization_node --ros-args -p publish_tf:=true - Start RViz in the NoMachine Terminal and set the initial pose. This pose should be your best estimate of the robot’s location in the maze. Use the maze view to place it as close as possible to the robot’s actual position, see the demo video below for details. The localization node uses this pose to initialize its particles. In Task 2.2, you do not need to set it manually because the ROS bag already contains this information.
cd ~/mbot_ros_labs/src/mbot_nav/rviz ros2 run rviz2 rviz2 -d path_planning.rvizor use foxglove
ros2 launch foxglove_bridge foxglove_bridge_launch.xml - Run motion controller in VSCode Terminal:
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_nav controller_node --ros-args -p use_localization:=true - Then set the goal pose on rviz.
Video Demo
After testing all features, we also provide a launch file navigation.launch.py, it can start all nodes at once. This is not recommended during development; running each node manually exposes errors earlier and provides clearer diagnostics.
- Bring up the mbot:
ros2 launch mbot_bringup mbot_bringup.launch.py - Launch navigation (map server + localization + planner + controller):
cd ~/mbot_ros_labs source install/setup.bash ros2 launch mbot_nav navigation.launch.py map_name:=your_map - Open RViz, set 2D Pose Estimate (needed by the particle filter), then 2D Goal Pose:
cd ~/mbot_ros_labs/src/mbot_nav/rviz ros2 run rviz2 rviz2 -d path_planning.rvizor
ros2 launch foxglove_bridge foxglove_bridge_launch.xml
Provide a figure showing the planned path in the map.
Task 3.2 Map Exploration
Until now, the MBot has only moved using teleop commands or manually set goal poses. For this task, you will implement a frontier-based exploration algorithm that allows the MBot to autonomously select targets and explore the full environment.
This task is useful for competition but not required for Checkpoint 3 submission.
TODO
- All work is in
mbot_nav. Start withexploration_node.cpp. - When finished, compile your code:
cd ~/mbot_ros_labs colcon build --packages-select mbot_nav source install/setup.bash- Important: You must source the workspace in every relevant terminal after each build. If you don’t, ROS will keep using the old code, and your changes will not take effect.
How to test?
- Start rviz in NoMachine Terminal or Run foxglove bridge
cd ~/mbot_ros_labs/src/mbot_nav/rviz ros2 run rviz2 rviz2 -d path_planning.rvizor
ros2 launch foxglove_bridge foxglove_bridge_launch.xml - Launch the robot model, TF, LiDAR node in VSCode Terminal.
ros2 launch mbot_bringup mbot_bringup.launch.py - Run slam in VSCode Terminal.
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_slam slam_node - Run the navigation node (TF mode, SLAM provides the pose) in VSCode Terminal.
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_nav navigation_node --ros-args -p pose_source:=tf - Run the controller in VSCode Terminal.
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_nav controller_node --ros-args -p use_localization:=true - Run the exploration node:
cd ~/mbot_ros_labs source install/setup.bash ros2 run mbot_nav exploration_node
Video Demo:
After testing all features, we also provide a launch file exploration.launch.py, it can start all nodes at once. This is not recommended during development; running each node manually exposes errors earlier and provides clearer diagnostics.
- Bring up the mbot:
ros2 launch mbot_bringup mbot_bringup.launch.py - Launch exploration (SLAM + planner + controller + frontier explorer):
cd ~/mbot_ros_labs source install/setup.bash ros2 launch mbot_nav exploration.launch.py - Open RViz to watch the map grow:
cd ~/mbot_ros_labs/src/mbot_nav/rviz ros2 run rviz2 rviz2 -d path_planning.rviz# or use foxglove ros2 launch foxglove_bridge foxglove_bridge_launch.xml
Explain the strategy used for finding frontiers and any other details about your implementation that you found important for making your algorithm work.
Task 3.3 Localization with Estimated and Unknown Starting Position
For advanced competition levels, the MBot must localize itself in a known map without knowing its initial pose. This will require initializing your particles in some distribution in open space on the map, and converging on a pose. This is useful in the competition but does not required any submission in the Checkpoint 3.
Details please check competition event 2 - level 3.
Explain the methods used for initial localization.
Checkpoint Submission
Demonstrate your path planner (task 3.1) by showing your robot navigating a maze.
- Submit a video of your robot autonomously navigating in a maze environment.
- Your video should include the following:
- Set goal pose, then the robot driving in the real-world lab maze.
- Your visualization tool (RViz or Foxglove) displaying the map and planned path.
- Your video should include the following: