Issue merging multiple maps

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue merging multiple maps

dschnabel
I have difficulties merging multiple maps. My office layout looks as such and I've recorded in 4 sessions:



I tried merging by following this tutorial and also tried on the command line:
rtabmap-reprocess "section1.db;section2.db;section3.db;section4.db" out.db

The problem is that section 4 doesn't appear in the merged map (only sections 1-3 appear) although there should be enough overlap between the sessions. Interestingly, if I merge sections 1,2, and 4 then all three sections do appear in the merged map. However, if I then try to add section 3 to the merged map, it won't appear. When I say "appear" I mean the section being displayed in the graph view of the database viewer.

To summarize what I'm saying above:
merge 1,2,3,4 --> results in 1,2,3
merge 1,2,4 --> results in 1,2,4
merge 1,2,4,3 --> results 1,2,4

The four recorded maps can be found here (369MB). Ideas what could be going on?
Reply | Threaded
Open this post in threaded view
|

Re: Issue merging multiple maps

matlabbe
Administrator
Hi,

The problem is that Rtabmap/MemoryThr is 150, and the first map is forgotten before the last map is created, thus no loop closures can be found with the first map. Try with Rtabmap/MemoryThr disabled:
rtabmap-reprocess --Rtabmap/MemoryThr 0 "section1.db;section2.db;section3.db;section4.db" output.db


Note that I also fixed a small bug (devel branch) that after creating a new map when Rtabmap/StartNewMapOnLoopClosure is true, new nodes were automatically deleted if the loop closure was rejected (even is a landmark was detected).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Issue merging multiple maps

dschnabel
Ah that's what it was! I had used '--Rtabmap/MemoryThr' for the first two maps but disabled it for the other maps. Didn't think it would mess up the merge, that's good to know! Thank you Mathieu.

Today I noticed when playing around with the '-start' option that it's not working:
$ rtabmap-reprocess -start 300 "section1.db;section2.db" out.db
Start at node ID = 300.
Set working directory to ".".
Reprocessing data of "section1.db;section2.db"...
High variance detected, triggering a new map...
Processed 1/650 nodes [id=1 map=0]... 135ms
Processed 2/650 nodes [id=2 map=0]... 102ms
Processed 3/650 nodes [id=3 map=0]... 106ms
...
It says 'Start at node ID = 300' but it actually starts at node ID 1. Is this another bug?
Reply | Threaded
Open this post in threaded view
|

Re: Issue merging multiple maps

matlabbe
Administrator
Hi,

The number 650 is wrong, you will see that it will finish before reaching it, meaning it really skipped 300 first frames. IDs always restart to 1. If you want to re-use same IDs from input database, you should set Mem/GenerateIds to false. However, If your second database restarts IDs from 1, there will be errors if new IDs are smaller. Note also that -start won't work well with multi-database inputs, it will skip 300 frames for each database. It would be better to do this:
rtabmap-reprocess -start 300 section1.db section1_subset.db
rtabmap-reprocess "section1_subset.db;section2.db" out.db

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Issue merging multiple maps

dschnabel
Got it! Thanks for the clarification, Mathieu.