introlab / rtabmap

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

Can I load a map and localize the camera and pose within the map? #1170

Closed kenhuang1964 closed 10 months ago

kenhuang1964 commented 10 months ago

Hey guys, I was wondering if you could help me with something. I'm curious to know if it's possible to load a map, then localize the camera and its pose within that map, and finally, update the map accordingly. Do you think this is something that can be done? Furthermore, is it possible to extract and store the user position path (keyframes)? My ultimate goal is to store the keyframes as nodes (storing coordinates) with edges between them. Also, is april tag available for localization?

matlabbe commented 10 months ago

Breaking down your message:

cheers, Mathieu

kenhuang1964 commented 10 months ago

Thank you so much @matlabbe!

kenhuang1964 commented 9 months ago

Hey @matlabbe, thank you for your help earlier. I have a few more questions if you don't mind: 1) Do you have any recommendations for how to extract the poses computed by rtabmap without having to use the GUI? Also, when are optimized poses saved?
2) How can I load a map and localize the device within that map?

Thanks in advance!

matlabbe commented 9 months ago

Do you use ROS? It will be easier to do what you want with the ROS package.

  1. See https://github.com/introlab/rtabmap/issues/1178 for the first question. The optimized poses are saved when rtabmap is closed: https://github.com/introlab/rtabmap/blob/f56875db4ada45ce9e8564c6a3911ebd809b83bd/corelib/src/Rtabmap.cpp#L518

  2. See localization mode in ROS. In c++, if you look at the RGBD example, add your database path in Rtabmap's constructor and add parameter Mem/IncrementalMemory=false to the params map. https://github.com/introlab/rtabmap/blob/f56875db4ada45ce9e8564c6a3911ebd809b83bd/examples/RGBDMapping/main.cpp#L200-L205