Posted by
matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/misalignment-from-tango-multi-session-tp5046p5051.html
Hi,
Thank you for sharing the data, I could test more RTAB-Map and fix some issues. First, I would recommend to update RTAB-Map on your phone, the databases you recorded are from version 0.13.2. The current version of RTAB-Map on Tango is 0.16.3. This causes this
issue, which makes a lot of loop closures to be rejected. To run with RTAB-Map desktop >= 0.16.3, we should then update your databases like explained in the issue (updating covariance of odometry links from 0.000001 to 0.0001):
sqlite3 AxoneQRCODE001.db "update Link Set information_matrix=x'000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340' where type=0"
sqlite3 AxoneQRCODE002.db "update Link Set information_matrix=x'000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340' where type=0"
sqlite3 AxoneQRCODE003.db "update Link Set information_matrix=x'000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000088C340' where type=0"
On
step 5 of the Multi-session mapping tutorial, go to Preferences->Graph Optimization->"Reject loop closures if optimization error ratio..." and set the value to 1 (instead of 0.01).
Afterward, I changed other parameters more like the current default ones in latest RTAB-Map Tango version:
Kp/DetectorStrategy=6
Kp/MaxFeatures=200
Rtabmap/TimeThr=0
Vis/MaxFeatures=400
RGBD/OptimizeMaxError=1
RGBD/LoopCovLimited=true
"RGBD/LoopCovLimited" is a new parameter I added in this
commit. This reduces the problems of GTSAM not able to optimize the graph in some cases, and thus getting better optimizations. "RGBD/OptimizeMaxError=1" is the parameter we set to 1 previously with the GUI. Using "Kp/DetectorStrategy=6" (GFTT/BRIEF) helps to find more loop closures. Lowering "Kp/MaxFeatures" and "Vis/MaxFeatures" reduces a lot time to update the visual word vocabulary. "Rtabmap/TimeThr" to 0 to keep all frames in WM, in order to be able to detect better wrong graph deformations to reject wrong loop closures (see section below about QR Code generating a lot of bad loop closures).
With all those parameters, I can process the 3 databases, then do Tool->Post-processing to detect more loop closures and get what it seems to be a good optimized map:


Comments on QR Code usage
When I tried to process the first time with the parameters included in the database, here is what I got:

The problem was that RTAB-Map wrongly detected a loop closure between very similar QR codes, and since it was between 2 sessions, the loop closure could not be rejected by detecting a huge graph deformation:

I'll suggest to find "anchors" a lot more distinctive. Here are good anchors I've seen in the databases:

I would rather start/end sessions in front of those unique anchors.Bonne journée,
Mathieu