Rosanswers logo


I have a very large indoor area with multiple large rooms that are dynamic in the sense that objects may change position and I want to create its map periodically in order to localize multiple robots. Probably I’m describing the most complex scenario possible. LiDAR measurements and odometry are available and multiple robots can be used for mapping. My strategy to capture the aforementioned dynamicity is the use of multiple robots that will create separate maps frequently and then merge them.

Solution and "hiccup:"

I would like to use slam_toolbox for ROS1 Noetic for mapping since it seems to be more robust than its "competitors". Once a SLAM session has been finished, slam_toolbox serializes and saves poses and graph data into a file.

This great toolbox includes offline map merging functionality that does not fulfill my needs. More specifically, it creates an occupancy grid of all the maps combined, but it does not update appropriately the Karto::Mapper object i.e. the internal graph used to perform localization. According to the code and the README file, it seems that the merged occupancy grid can be used to generate an ordinary image (pgm) map that can be then used for localization e.g. with AMCL.


Based on your experience with slam_toolbox:

  • Do you think that the localization performance of AMCL is comparable to the performance of slam_toolbox (given a relatively accurate initial pose) when the map is created by slam_toolbox?
  • In some posts it is argued that slam_toolbox can be used for localization while being in mapping mode. Does this perform well?
  • slam_toolbox argues that it can perform lifelong mapping and prioritize newer nodes, but it is still experimental and has many bugs, judging from related issues. Instead of that, mapping and restarting the whole localization process is obviously the dirtiest solution, but I can guess it performs well. Does this make sense?

Based on your answers and your experience I am thinking of different solutions and possible developments.

Originally posted by kokko on ROS Answers with karma: 21 on 2022-01-24

Post score: 2


1 Answer 1


Rosanswers logo

  1. SLAM Toolbox, while I did add in a pure localization setting, is probably not what you want to use unless you have very good odometry and want to work with previous serialized sessions rather than straight occupancy maps. I wouldn't tell you not to try, but the pure localization mode of SLAM Toolbox was built for a specific niche that isn't the general case for most people. The localization quality during a SLAM session though is quite good as long as your robot isn't slipping on ice or being pushed around. You should probably use AMCL, of the open-source options, unless you know specifically what you're doing.

  2. I'm not sure what you mean by this. SLAM Toolbox does SLAM. There is localization during SLAM (the "L") and mapping (the "M"). This is quite good.

  3. It depends on what you're looking for. Do you care about global correctness? Are you just looking for essentially sliding window positioning without long-term loop closures? How long as these sessions you're thinking of? All of these questions would lead me down different directions depending on the answers.

Originally posted by stevemacenski with karma: 8272 on 2022-01-24

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by kokko on 2022-01-25:
Questions 1 and 2: Answered

Question 3:

Since some objects on the map may change location from time to time (not while the robot moves), I am looking ideally for long-term mapping to keep up with the changes.

From what I understand sliding window positioning without long-term loop closures is something that can be provided by slam_toolbox in localization mode.

The sessions should be 2-3 hours long (in the future probably more).

(I am not sure I understand the term global correctness in this context)

Comment by stevemacenski on 2022-01-25:
I'm not sure I can give you much more specific advice without getting into the weeds of your application, how your autonomy system is structured, and alignment needs. This is something you may have to answer for yourself with some testing / reading the documentation based on your requirements.

Comment by kokko on 2022-01-26:
That's fine. The point of the post was to get a very general idea about localization based on users' experience and I think I got it. For specifics I will have to experiment with the actual setup. Truly grateful for your advice and your work on the package

Comment by stevemacenski on 2022-01-27:
Thanks! If I've answered the question sufficiently ,can you make this as correct with the check box so it enters the "answered" list?


Your Answer

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