introlab / rtabmap

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

How to output VO and loop closure at the same time #258

Open forthealllight opened 6 years ago

forthealllight commented 6 years ago

Hi, In my experiment ,I want to use my own graph optimization method。But I want to use your VO and Loop closure in KITTI database 。 So is there a method in your code ,to ouput the VO and Loop closure in a ".g2o" file when I give the KITTI database as a input。

one more question , Can I use RTAB-MAP to get the track when I use the KITTI database thank you~

matlabbe commented 6 years ago

To get all poses of odometry recorded in the database, you should set "Rtabmap/CreateIntermediateNodes" to true (in GUI, it is in Preferences->RTAB-Map (advanced)). Then, after mapping, we can do File->Export Poses... in g2o format (it will contain odometry poses + loop closure constraints).

While still under construction, there are some infos on this page about configuring RTAB-Map for KITTI dataset. However, these parameters are not optimal, I will update this in next months.

cheers, Mathieu

forthealllight commented 6 years ago

thank you ,but when I use KITTI_00 dataset as the input , to run RTAB-MAP。KITTI_00 has 4540 frames,but loop closure detection is only handled in the first 107 frames。Furthermore when I export the poses .. in g2o format 。There is not 4540 poses,but only 12 poses,I don not know why? I want to use your code ,to gei the full 4540 poses and all loop closure。

at first ,I think that I should change the "input rate" and "detection rate " ,so I change "input rate" to "1HZ" and "detection rate" to "0HZ" 。It seems work better ,and I get some poses one by one, but it seems something wrong and printf :

computeTransformationImpl() Optical flow correspondences requires images in data!

futhermore, I find that when the error happens,there is a tip :" Loop hyp is reject " for etc。

What should I do,if I want to output all poses and all loop closure

cheers

matlabbe commented 6 years ago

It depends on the version of RTAB-Map you are using, there was a bug when optical flow is used (Vis/CorType=1) on visual odometry and rtabmap at the same time, causing the warning you are seeing and rejecting all loop closures. In latest version, this has been fixed.

To make sure to process all frames, you can set the buffer size of rtabmap and odometry to 0 (infinite). Note that you may keep detection rate at 1 Hz, to compute loop closure detection only each 10 frames. Depending on your computer power, setting input rate to 10 or 5 can be good too show results live without lagging. Adjusting Preferences->3D Rendering to show less data (e.g., increasing decimation) can also help for fast rendering.

If you don't care about online visualization, there is now a tool called rtabmap-kitti_dataset to process KITTI sequences in an offline manner for convenience.

cheers, Mathieu