Loop closure detection tuning

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

Loop closure detection tuning

cpsarras
This post was updated on .
Hello Mathieu,

I have been experimenting with loop closures in RTAB-Map and I think do not fully understand the meaning of some of the parameters involved. Also, i have been trying to detect loop closures, while walking in parallel to a previous trajectory 70+cm apart with no luck so far (see image below).

Red odometry is ground truth, no loop closures detected by mapGraph. Grid is default 1x1m
Red odometry is ground truth, no loop closures detected by mapGraph. Grid is default 1x1m

It is my understanding that the following parameters:

RGBD/ProximityByTime
RGBD/ProximityBySpace
RGBD/ProximityMaxGraphDepth
RGBD/ProximityMaxPaths
RGBD/ProximityPathFilteringRadius
RGBD/ProximityPathMaxNeighbors
RGBD/ProximityPathRawPosesUsed
RGBD/ProximityAngle

have an effect on nodes stored in the STM, and determine which ones are going to be compared with the current node when searching for loop closures, based on their proximity.

Then by tuning the Mem/STMSize parameter, I determine the number of nodes that are going to be available for the above parameters.

With the above assumptions, I set the
Mem/STMSize                                  2000  (default 10)
RGBD/ProximityByTime                   false  (default false)
RGBD/ProximityBySpace                  true   (default true)
RGBD/ProximityPathFilteringRadius  2       (default 0.5)

and expect to be able to detect loop closures when walking in parallel to a previous trajectory, in a distance of up to 2m. However RTAB-Map detects loop closures with a distance <0.5m, with the above setup.

The overall trajectory is 30m long, I am walking with a constant speed of 0.2 m/s and the stereo image feed is 1920x1080. All other parameters are kept to their default values in stereo_mapping.

Any insight on how loop closure parameters work in RTAB-Map is much appreciated.

Thank you in advance,
Chris

Reply | Threaded
Open this post in threaded view
|

Re: Loop closure detection tuning

matlabbe
Administrator
Hi Chris,

Keep Mem/STMSize small (e.g., 10-20), it is only used avoid linking with just seen images.

Some descriptions of the proximity parameters:
$ rosrun rtabmap_ros rtabmap --params | grep Proximity
Param: RGBD/ProximityAngle = "45"                          [Maximum angle (degrees) for visual proximity detection.]
Param: RGBD/ProximityBySpace = "true"                      [Detection over locations (in Working Memory or STM) near in space.]
Param: RGBD/ProximityByTime = "false"                      [Detection over all locations in STM.]
Param: RGBD/ProximityMaxGraphDepth = "50"                  [Maximum depth from the current/last loop closure location and the local loop closure hypotheses. Set 0 to ignore.]
Param: RGBD/ProximityMaxPaths = "3"                        [Maximum paths compared (from the most recent) for proximity detection by space. 0 means no limit.]
Param: RGBD/ProximityPathFilteringRadius = "0.5"           [Path filtering radius to reduce the number of nodes to compare in a path. A path should also be inside that radius to be considered for proximity detection.]
Param: RGBD/ProximityPathMaxNeighbors = "0"                [Maximum neighbor nodes compared on each path. Set to 0 to disable merging the laser scans.]
Param: RGBD/ProximityPathRawPosesUsed = "true"             [When comparing to a local path, merge the scan using the odometry poses (with neighbor link optimizations) instead of the ones in the optimized local graph.]

Actually, RGBD/ProximityBySpace is done only with localizations in WM, I'll fix the doc. In your case, you may set "RGBD/ProximityMaxGraphDepth" = "0" and "RGBD/ProximityPathFilteringRadius" = "1". For 30 m long, there is about 150 nodes, so the "50" default is too small. Note that for such long trajectory (unless odometry is very precise) doing proximity detection is not reliable, so it is why by default it is max 50 nodes. At that point, it would be global loop closure detection that will find the loop closures instead of the proximity detection. Global loop closure detection is not done with nodes in STM, so setting large STM disables capacity to find loop closures. To find a loop closures, the environment should have discriminative visual features.

cheers,
Mathieu