ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Even if both of them deal with maps, the function of them in ROS is to provide the map -> odom transform (see nav2 writeup for more information). Only one node should provide this transform, or you will have very jittery movement (in the map frame, which is typically the one you care about). It is likely that AMCL will provide disturbance for Gmapping as it tries to make a map. It is therefore not only unnecessary to use AMCL if you already use Gmapping, it is directly problematic.

The way you go about solving this can be done in a few ways, but the simplest is probably to have two different launch files. One for active mapping, and one for navigating in a previously mapped area. Personally, I don't think AMCL is very useful if you have another library doing SLAM, since it definitely needs to keep track of the map -> odom transform. Another, more involved, solution is to use a lifecycle manager to deactivate Gmapping once mapping is done, and instead activate AMCL for navigation.