introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.72k stars 775 forks source link

Multi-session mapping database size #493

Open adityarasam opened 4 years ago

adityarasam commented 4 years ago

Hi, I am trying to perform multi-session mapping. Within this in the first case I am mapping the same environment multiple times in different sessions and then merging the database into one database (to make it rich in features). Second case I am creating multiple maps in different spaces while having few common locations in them and then merging to have one merged (global map) database. I wanted to know how would the size of the database scales in both cases, for instance in first case, if I have 'n' databases each of size 'm' MB for 'n' different sessions, will the merged database have a size of n x m MB or is it less than that where it avoids storing repeated data? Also how would it scale in the second case?

matlabbe commented 4 years ago

Hi Aditya,

In both cases, the final database will scale n x m. By default, rtabmap saves every nodes when the robot moves, even if we revisit again the same area. Those locations will be duplicates in the database. In the paper titled "Long-Term Online Multi-Session Graph-Based SPLAM withMemory Management", we can read at section 4.3 an approach to reduce the graph size when revisiting areas. This can be enabled with Mem/ReduceGraph parameter. This feature is not used/tested often, so I recommend creating your merged database with all data, then reprocess that database with Mem/ReduceGraph enabled to see the difference.

$ rtabmap-reprocess --Mem/ReduceGraph true all_data.db reduced_output.db

In the graph reduction case, the database will still grow as fast than without graph reduction when exploring new environments, but when revisiting old areas and if loop closures can be detected, theoretically the growth will stop until we exit those areas. In practice, it is unlikely the case, as it would be difficult to get a loop closure for every frame. It is why in the paper, the blue line in Figure 19 is still growing over time (but less faster than without graph reduction shown in red) even if we revisit always the same environment. See last paragraph of Discussion section for long-term continuous SLAM issues.

cheers, Mathieu