I am working on the mapping in a large indoor facility. I planned to segment the large area to be mapped into multiple small areas while ensuring the fact that any two consecutive areas will have significant overlap. Also, my plan is to record bags from each region and then merge them while mapping. I observed that instead of using rtabmap-reprocess, while loading an existing map and playing the bags from the consecutive overlapped area also does the merging. But, I have not been successful using rtabmap-reprocess with my .db files. Additionally, I also want to edit the merged map at times, meaning that if I need to remap in some portion of the environment, I would like to record the bags from that region and merge that map with the existing one. I went through thispost and other similar ones on this topic. However, I have specifically three queries.
1. How to remove the portion of the merged map where I want to update?
2. When the bag files from two consecutive overlapping areas are recorded with large time gaps, the merging cannot be done while loading the previous database and playing the bags from the next overlapping region. TF jumps back in time or too much in the future is causing trouble. As the data for different regions could be recorded at different times (ideally), I want to merge the maps as mentioned above. Can you please suggest some ideas on this issue?
3. Is there any way to downsample the laser scans from an already created map (.db file)? It will be helpful.
To remove a session from a merged map, see this post.
To remove specific nodes of the map, see this post.
2. Normally using rtabmap-reprocess to merge databases, it won't care if one database has been taken before or after the other. I would have expected this to work though:
the merging cannot be done while loading the previous database and playing the bags from the next overlapping region
A workaround would be to create a database from the bag, then use rtabmap-reprocess to combine them.
3. There are some parameters inside rtabmap to downsample laser scan before creating grid or saving them:
./rtabmap --params | grep Mem/LaserScan
Param: Mem/LaserScanDownsampleStepSize = "1" [If > 1, downsample the laser scans when creating a signature.]
Param: Mem/LaserScanNormalK = "0" [If > 0 and laser scans don't have normals, normals will be computed with K search neighbors when creating a signature.]
Param: Mem/LaserScanNormalRadius = "0.0" [If > 0 m and laser scans don't have normals, normals will be computed with radius search neighbors when creating a signature.]
Param: Mem/LaserScanVoxelSize = "0.0" [If > 0 m, voxel filtering is done on laser scans when creating a signature. If the laser scan had normals, they will be removed. To recompute the normals, make sure to use "Mem/LaserScanNormalK" or "Mem/LaserScanNormalRadius" parameters.]
So to voxelize laser scans at 10 cm of a database:
I have not been successful using rtabmap-reprocess for merging two maps. I tried two maps as inputs. The first one contains a loop closure within the overlapping area with the second one. However, the second map did not find a loop closure in the overlapping area. When I executed this process, I observed "High variance detected, triggering a new map...", showing in the console somewhere in the middle of the total number of nodes counted considering both the maps. To be specific, map1 contains 1661 nodes and map2 contains 767 nodes. But, the new map triggering is shown when the reprocess has processed 1348 nodes. I would still understand if it would that line would have printed after all the nodes of the first map are processed. Once the process is completed, only the second map is loaded with only its own nodes, that were created while generating the same. Any suggestions?
Thanks for your response. it works fine. Now I have a different problem. Imagine that I have a large map. Then, I choose a set of nodes to remove from that map. When I follow the instructions in your previous reply, I get the desired map but the size of the map in MB remains the same. Am I missing something? This is important for me to reduce the map size too while removing information from the map.
Does rtabmap-reprocess work while using maps built with the help of LIDAR data only in association with cmr_lidarloop? I found that individual maps have global loop closures within them. But, the map still does not merge. It did not happen with rtabmap with rgbd_images in the same environment.
rtabmap-reprocess doesn't use cmr_lidarloop, so global loop closures won't be detected with lidar-only. Note that if input databases contain cmr_lidarloop's constraints and would want to re-add them in rtabmap-reprocess, we would have to republish internally those loop closures when reprocessing the data. That would have to be implemented...