Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about "loopFindNearKeyframesCloud(cureKeyframeCloud, _curr_kf_idx, 0, _loop_kf_idx) ? #11

Closed
Tina1994 opened this issue Mar 9, 2022 · 4 comments

Comments

@Tina1994
Copy link

Tina1994 commented Mar 9, 2022

Hi, thanks for your contribution.
I have same question same as the question https://github.com/gisbi-kim/SC-A-LOAM/issues/7
However, I think the code still have something wrong, the code in the repo is as:

 void loopFindNearKeyframesCloud( pcl::PointCloud<PointType>::Ptr& nearKeyframes, const int& key, const int& submap_size, const int& root_idx)
{
    // extract and stacking near keyframes (in global coord)
    nearKeyframes->clear();
    for (int i = -submap_size; i <= submap_size; ++i) {
        int keyNear = key + i; 
        if (keyNear < 0 || keyNear >= int(keyframeLaserClouds.size()) )
            continue;

        mKF.lock(); 
        *nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[root_idx]);
        mKF.unlock(); 
    }
    if (nearKeyframes->empty())
        return;
    pcl::PointCloud<PointType>::Ptr cloud_temp(new pcl::PointCloud<PointType>());
    downSizeFilterICP.setInputCloud(nearKeyframes);
    downSizeFilterICP.filter(*cloud_temp);
    *nearKeyframes = *cloud_temp;
} // loopFindNearKeyframesCloud

where *nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[root_idx]) should be:

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

The target of the function “loopFindNearKeyframesCloud ” is transforming the nearby keyframe point cloud stored in keyframeLaserClouds from thr Lidar coordinate to the world coordinate, to form a submap in _loop_kf_idx, so I think local2global should be the tranformation stored in keyframePosesUpdated[keyNear].

微信图片_20220309111635

@harveybia
Copy link

Can confirm this is correct.

@Tina1994
Copy link
Author

Can confirm this is correct.

Thanks for you reply, are you mean my explain is correct? I am a beginner, so if you mean the source code is correct, please explain the reason. Thanks again.

@harveybia
Copy link

harveybia commented Mar 18, 2022

Sorry for not being clear, you are correct. The keyframes need to be transformed into the same global frame.
*nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[keyNear]);

Thanks for you reply, are you mean my explain is correct? I am a beginner, so if you mean the source code is correct, please explain the reason. Thanks again.

@Tina1994
Copy link
Author

Sorry for not being clear, you are correct. The keyframes need to be transformed into the same global frame. *nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[keyNear]);

Thanks for you reply, are you mean my explain is correct? I am a beginner, so if you mean the source code is correct, please explain the reason. Thanks again.

Thanks you very much! I 'll modify the error in downloaded source code and close this question.

huawei-sai added a commit to huawei-sai/SC-A-LOAM that referenced this issue Jan 30, 2023
This bug has been already highlighted and well explained in these two links.
gisbi-kim#11
gisbi-kim#12
To check this - one can visualize the loop submap in RVIZ and can see the cluttered point cloud as it does not have correct registration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants