introlab / rtabmap

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

OdometryMono: localize in a pre-loaded local map created by RGB-D mapping #27

Closed matlabbe closed 9 years ago

matlabbe commented 9 years ago

The goal is the create a 3D map with a Kinect, then use it with only a webcam to track the camera. Idea from this post: http://official-rtab-map-forum.206.s1.nabble.com/RGBD-SLAM-and-then-RGB-Localization-td489.html

matlabbe commented 9 years ago

New features added in the past weeks make it possible to do that. Finding the good parameters is still needed but it works. From the default RTAB-Map's parameters:

  1. Create a database for the odometry. We first map an area with the Kinect as usual. However, Odometry and Vocabulary must have the same type of words. See "Preferences (Advanced) -> RTAB-Map Settings -> Visual Word -> Visual word type" for the vocabulary and "Preferences (Advanced) -> RTAB-Map Settings -> Odometry -> Feature detector" for odometry. Here we used ORB for both. Under Odometry panel in "Motion estimation" box, select "3D to 2D PnP" for the motion estimation and set 1 pixel reprojection error for PnP. Start mapping a small area. When finished, close the database to save it on the hard drive.
  2. Setup the database for odometry. Under Preferences->Odometry->BOW panel, set the path of the saved database in the "Path to a fixed map" field.
  3. Select an RGB-only camera. Go to Source panel in Preferences and select an RGB camera (default usb webcam). Calibrate the camera by clicking "Calibrate" button. Save the calibration files with a discriminative name like "my_webcam". Then back to Preferences->Source panel, set the calibration name to "my_webcam". You are now ready for "mapping" (only features will be shown).
  4. Start mapping. The camera should be looking the same stuff than the mapped area to be able to compute odometry. You will then be tracking the RGB-only camera position.

Parameters tuning:

Another thing you can do is to use Localization mode with a copy of the database used for odometry, so the 3D map will be shown as the camera is tracked. Don't forget to set PnP for loop closure constraint estimation. Then open the database, download all clouds and start mapping. On loop closure, the 3D map should re-appear.

matlabbe commented 7 years ago

New approach for recent versions >= 0.11.12: http://official-rtab-map-forum.206.s1.nabble.com/Localize-in-a-pre-loaded-local-map-created-by-RGB-D-mapping-tp2383p2399.html