introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.85k stars 787 forks source link

Nanoflann support #906

Open jsseng opened 2 years ago

jsseng commented 2 years ago

I was wondering if there were plans to update the flann library to nanoflann (https://github.com/jlblancoc/nanoflann). They list some performance and memory optimizations. When I run rtabmap with a large set of nodes and vocabulary, the load time is longer and I wonder if this update would help.

matlabbe commented 2 years ago

If there "were" plans, no. However, this could eventually be updated. I added label "enhancement" if someone wants to try it.

matlabbe commented 9 months ago

Integration idea: There is currently a directory called rtflann ("rtabmap flann"), which is a modified version of the flann library with some patches for rtabmap. We could add a new one "nanoflann" containing the nanoflann header file. Flann is used primarily in VWDictionary and RegistrationVis classes. We either

  1. replace all rtflann related functions by nanoflann, or
  2. make an abstract class for NN and implement common functions using the two approaches. We could add a parameter to select if we want to use rtflann or nanoflann.

Solution 2 would be the safest transition, as this change can affect the whole loop closure detection performance. Someone could make 1 in a fork or temporary branch (to better see the similarities with original flann), which could be also useful step towards doing 2 in this repo.

jsseng commented 9 months ago

I haven't looked at this in a while (and I don't have the time to implement it), but I'm all for adding nanoflann support. I would be very excited about the save/load functionality and how it would reduce startup times.