← Back to Modules

Start localization using AMCL

Launch the localization stack to estimate the robot’s pose in a known map.

After creating a map, you can localize the robot within it using AMCL. The following commands launch the localization stack, verify that key topics are active, and set the initial pose.

bash
ros2 launch common_platform localization_launch.py
bash
ros2 topic list | grep -E '(scan|odom|map|amcl)'
bash
ros2 topic pub /initialpose geometry_msgs/msg/PoseWithCovarianceStamped '{ pose: { position: { x: 0.0, y: 0.0, z: 0.0 }, orientation: { w: 1.0, x: 0.0, y: 0.0, z: 0.0 } } }'
bash
ros2 topic echo /${ROS_NAME}/amcl_pose
bash
ros2 topic echo /${ROS_NAME}/localization_status

Subscribe to our newsletter

The latest educational robotics news and articles, sent to your inbox weekly.