When using ROS2 with Nav2, what function does AMCL and robot_localization serve?

Do both of them estimate the robot position and publish the odom -> base_link transform? If yes, don't they conflict each other?


1 Answer 1


robot_localization is somewhat poorly named - at this point it is mostly an Extended Kalman Filter (EKF), usually it is used to merge multiple sources of odometry information (most commonly, IMU and wheel odometry, although it also provides some tools for GPS). Thus, robot_localization is used to create the odom->base_link transform.

AMCL is actually localization software - it provides the map->odom transform using a particle filter to determine where the robot is in within a map (usually using a planar laser scanner and the odometry information).

Therefore, these two can actually work together - by combining multiple sources of odometry information you can minimize the odometry drift that occurs in your odom->base_link estimation. Then AMCL can be used to correct for that drift by keeping the robot properly localized within the map.

  • $\begingroup$ So AMCL publishes the map -> odom frame? $\endgroup$ Feb 26, 2023 at 12:20
  • $\begingroup$ Yes - AMCL publishes map->odom - which is really only changed in two ways: 1) when you do initial localization (using a tool like RVIZ), it sets the initial transform 2) at each update, AMCL slowly corrects for drift in the underlying odometer, by aligning the laser scanner with the map $\endgroup$ Feb 26, 2023 at 16:33
  • $\begingroup$ robot_localization can be used to publish map->odom and odom->base_link, depending on the sensor that you are using, if you are fusing only odometry and imu then you will publish to odom->base_link, but if you are using GPS you can publish map->odom, both can work together $\endgroup$ Jul 6, 2023 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.