gisbi-kim / SC-A-LOAM

Robust LiDAR SLAM with a versatile plug-and-play loop closing and pose-graph optimization.
438 stars 95 forks source link

Bug in laserPosegraphOptimization.cpp? #12

Open PaulKemppi opened 2 years ago

PaulKemppi commented 2 years ago

In the function loopFindNearKeyframesCloud (line 412), key frames are being combined into a single point cloud to be used as the target in the ICP registration (doICPVirtualRelative).

This is how it is:

nearKeyframes += local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[root_idx]);

This is how it should be (I guess):

nearKeyframes += local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[keyNear]);

This way, the correct pose for each key frame cloud is used when converting them to the global coordinate frame. The original line results a cluttered point cloud, and thus the ICP registration results often a poor fitness score. Because the best matching key frame with index 'key' (predicted by the scan context matching) is still included in the cluttered cloud, the registration may still result a correct transform. But not always. At least not with my LiDAR data collected with Ouster OS1-32.

mingloo commented 2 years ago

@PaulKemppi I've same doubt with you.

One same issue mentioned in https://github.com/gisbi-kim/SC-A-LOAM/issues/11 as well. Also, it relates to https://github.com/gisbi-kim/SC-A-LOAM/issues/7.

@gisbi-kim Could you please help double confirm this issue.

huawei-sai commented 1 year ago

Yes, I confirm this - I faced the same issue and changing the root_idx to keyNear solved the issue! @mingloo @PaulKemppi @gisbi-kim

YZH-bot commented 6 months ago

Yes, I also think it should be like this one:

*nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[keyNear]);