Am I correct in assuming that localization mode works the same as amcl? What I want to do now is to do navigation in rtabmap for a map that I have created.
However, when I try to navigate in localization mode, the initial positions on gazebo and rviz are not the same, and I can't fix it using "2Dposeestimate" on rviz. Why is this? Please let me know the solution. I hope you can solve this problem.
localization mode in rtabmap is not the same than AMCL. It doesn't modify the map like AMCL, but it is not a MonteCarlo localization.
AMCL uses many particles (many possible localizations) spread in the static occupancy grid, then updates its particles depending on the current laser scan. Current localization is where there are the most particles with most probability to be there. In theory, the robot could start anywhere in the environment, with particles spread everywhere in the map, could eventually converge to a single location while moving. In practice, it is still better to give a initial pose to AMCL to converge faster and to avoid aliasing problems. In RVIZ, the 2D pose estimate button can publish over /initialpose topic that would be connected to AMCL node.
RTAB-Map can also use 2D pose estimate button when it is in localization mode, just make sure to update the topic name in Tool Properties to match the one rtabmap is using ("rosnode info rtabmap | grep initialpose"). For example, if rtabmap node is started in rtabmap namespace, set topic for 2D pose estimate button to /rtabmap/initialpose. For the localization approach used by rtabmap, 1) it assumes it is restarted in the map where it shut down previously, 2) global visual relocalization is done using its loop closure detection approach (bag-of-words), 3) can do proximity detection (e.g., scan matching) to refine its current position with closes nodes in the map. If you send an initialpose with RVIZ, step 3 will be able to work properly. If initialpose is not used, the robot could eventually relocalize globally with the step 2 (it the robot is using a camera).
Thanks for the reply. I did as you told me and was able to send it successfully.However, I had a problem. When I press the Initial pose button, it doesn't go where I expect it to. However, I had a problem. When I press the button, it doesn't go where I expect it to. It goes to a strange place. Is there a solution to this problem, because it doesn't move to the place I dragged it to like it did with amcl.