I was wondering what the meaning of Local match is in RTAB-Map (yellow background).
I'm referring especially to localization mode, but I guess there's not much difference, if any.
From what I'm understanding a local match is another name for the "proximity detection in space" feature.
This would mean that a visual loop closure was not found, but RTAB-Map is using laser scans to perform a 2D ICP alignment on groups of neighboring nodes nearby the current robot pose.
In RTAB-Map preferences I read "If the laser scans are used, local locations are merged together and the current laser scan is compared to them."
Maybe I'm being picky, but this pharsing confused me.
Does "If laser scans are used" mean if they are present in the database (and in the incoming data)?
Or is there another way of disabling the usage of scans?
And if they do are disabled/not present, could I be getting local matches without using scans?
local matches (yellow background) are proximity detections. Proximity detections (enabled with RGBD/ProximityBySpace parameter) are done in two steps, first using strategy defined by Reg/Strategy (so either visual or lidar or both) on the closest node in the graph. The second step (now called "one-to-many", or referred as merged scans approach or icp multi) detection refers to the "If laser scans are used...", it means if scan data is present in the database. We can disable the second step by setting this parameter to 0:
Param: RGBD/ProximityPathMaxNeighbors = "0" [Maximum neighbor nodes compared on each path for one-to-many proximity detection. Set to 0 to disable one-to-many proximity detection (by merging the laser scans).]
Note that the default is updated depending if you are subscribing to a 2D or 3D lidar (and if Reg/Strategy >= 1).
In rtabmapviz under Statistics->Proximity panel, you can know how many of each type (visual / icp) proximity detections were done (icp refers to lidar-only). The "local match" only shows the last detection (if many happened in same update).
Mathieu, thank you for your quick and clear answer.
I now understand how the local matches work (I also re-read your paper with more attention, and it does indeed make sense).
I have one last doubt about this, though.
Assume I disable scan data usage using the parameters that you mentioned, so I disable the second step.
What is the difference between a local match and a loop closure in this case?
Does RTAB-Map look for matches in the neighborhood of the current position first (with the proximity detection) and then, if it doesn't find any, look for matches in the whole WM?
I remember turning off proximity detection once, and most of the local matches became loop closures.
It does proximity detection first, then global loop closure. It won't compute the global loop closure transform if the proximity detection has been already done with a node close to global loop closure.
Proximity detection is done with nodes in the graph close to current position. It will sort the closest nodes by their likelihood computed during loop closure detection, and compute the proximity detection on the one with most likelihood (which is often the global loop closure).
If you disable proximity deteciton, global loop closure transformation estimation will be done on the top loop closure hypotheses (from all WM independently of the current pose).
Just one final doubt in case I enable the one-to-many step.
The operations flow would be something like this:
(1) Proximity detection in space: one-to-one. The node with the highest loop closure probability is evaluated.
If it is a valid loop closure (over the threshold) the pose is registered with the selected method. In this case we finish: no one-to-many and no global loop closures are performed.
If it is not a valid loop closure we proceed to step 2.
(2) Proximity detection in space: one-to-many. We group nearby nodes scans and perform ICP, etc etc.
If a valid ICP transform is found, we add the link. What next? Do we look for global loop closures anyway? If no valid ICP transform is found we go to step 3.
(3) Look for global loop closures.
So in short the question is: how are one-to-many and global loop closure related?
Actually steps 1 and 2 and 3 can be all done in same update. Step 3 will be ignored only if in step 1 a proximity detection has been found on same node or a linked node to highest global loop closure hypothesis (e.g., no need to recompute the transform if it is already done on the same node by the local one-to-one proximity detection).
one-to-many is independent of steps 1 and 3, and will be done only if there are scans and RGBD/ProximityPathMaxNeighbors>0.