introlab / rtabmap

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

How to optimize existing coarse poses with rtabmap loop closure detection ? #844

Closed MemoryNode closed 2 years ago

MemoryNode commented 2 years ago

with other slam front-end( like vins-mono or orb-slam ...), i got the rgbd(keyframe)+poses ( synchronized ), but there are some loop closure errors, i want to optimize the existing coarse poses with rtabmap's loop closure detedtion for mapping, but i don't know how to do, is there a similar tutorial ?

Thank you very much in advance for your help.

rlabs-oss commented 2 years ago

Use stop if currently mapping, or load the .db and use Tools -> post processing / Detect more loop closures.

MemoryNode commented 2 years ago

Use stop if currently mapping, or load the .db and use Tools -> post processing / Detect more loop closures.

Thanks for your reply @rlabs-oss , what i have are some offline file (depth_imgs / rgb_imgs / camera_info.yaml / coarse_pose.txt(with format: timestamp x y z qx qy qz qw) ). image

i followed the noEventsExample code, change the CameraStereoImages to CameraRGBDImages, and change rtabmap.process(data, pose) to rtabmap.process(data,coarse_pose), but i only got a messy result. image

i have no db file, and how to feed the all offline data to rtabmap, and get the optimized map, i'm in trouble... -_- !!!

rlabs-oss commented 2 years ago

For the stand-alone app, In preferences set the driver to RGB-D, and choose images as the driver, set the path for RGB and Depth images to the correct folders, followed by the odometry file to coarse_pose_sync.txt - the pose needs to be in a format present in the drop down menu, e.g RGB-D-SLAM. Hover over the Odometry format to see the tool tip describing each format. Then new database and start.

MemoryNode commented 2 years ago

Hi, @rlabs-oss

I tried following the process you said, but I still got a messy map(as the left). Then, i tried to map with the coarse pose and depth, and from the result, it was correct(as the right). image

The coarse poses are in the right-hand coordinate with RGBD-SLAM pose format, i also tried to convert them to left-hand, didn't work...

rlabs-oss commented 2 years ago

Looks good, the pose you choose in RTAB-Map needs to match the format you used while capturing or the capturing app if external needs to write the pose in the format needed (or convert an existing one if that's not possible) -if you omit the pose file entirely and start mapping with the RGB-D files (image and depth) does the result look the same as the viewer image (on the right) ?

MemoryNode commented 2 years ago

hi, @rlabs-oss

a little good things. if i start without odometry file, RTAB-MAP will ues it's own odometry, and this will result in the loss of odometry(red background), then i tried set the (coarse pose)odometry file with RGBD-SLAM(motion capture) format, it looks good, the 3d map is the same as the 'mapping with coarse pose' . image

but what's the 'motion capture' mean ? and what 's the difference between RGBD-SALM and RGBD-SLAM(motion capture) format ?

MemoryNode commented 2 years ago

Thanks for your help @rlabs-oss , I can continue to do the follow-up test .

matlabbe commented 2 years ago

Hi,

motion capture format is the format used by TUM's RGB-D dataset for their ground truth (don't remember exactly which orientation it is, probably camera frame x->right, y->down, z->forward). The one without "motion capture" is ROS format (x->forward, y->left, z->up).

By curiosity, your depth image seems pretty dense in texture-less areas, which sensor are you using?

cheers, Mathieu

MemoryNode commented 2 years ago

Hi, @matlabbe

Thank you for your explanation of motion capture format, the rgb and depth are captured on an iPhone/iPad.

matlabbe commented 2 years ago

Note that you can download RTAB-Map on AppStore to create db directly on iPhone/iPad.