diff --git a/src/laserPosegraphOptimization.cpp b/src/laserPosegraphOptimization.cpp index ce1a896..c02a7a8 100644 --- a/src/laserPosegraphOptimization.cpp +++ b/src/laserPosegraphOptimization.cpp @@ -468,7 +468,7 @@ pcl::PointCloud::Ptr transformPointCloud(pcl::PointCloud:: return cloudOut; } // transformPointCloud -void loopFindNearKeyframesCloud( pcl::PointCloud::Ptr& nearKeyframes, const int& key, const int& submap_size, const int& root_idx) +void loopFindNearKeyframesCloud( pcl::PointCloud::Ptr& nearKeyframes, const int& key, const int& submap_size) { // extract and stacking near keyframes (in global coord) nearKeyframes->clear(); @@ -478,7 +478,7 @@ void loopFindNearKeyframesCloud( pcl::PointCloud::Ptr& nearKeyframes, continue; mKF.lock(); - *nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[root_idx]); + *nearKeyframes += * local2global(keyframeLaserClouds[keyNear], keyframePosesUpdated[keyNear]); mKF.unlock(); } @@ -499,8 +499,8 @@ std::optional doICPVirtualRelative( int _loop_kf_idx, int _curr_kf int historyKeyframeSearchNum = 25; // enough. ex. [-25, 25] covers submap length of 50x1 = 50m if every kf gap is 1m pcl::PointCloud::Ptr cureKeyframeCloud(new pcl::PointCloud()); pcl::PointCloud::Ptr targetKeyframeCloud(new pcl::PointCloud()); - loopFindNearKeyframesCloud(cureKeyframeCloud, _curr_kf_idx, 0, _loop_kf_idx); // use same root of loop kf idx - loopFindNearKeyframesCloud(targetKeyframeCloud, _loop_kf_idx, historyKeyframeSearchNum, _loop_kf_idx); + loopFindNearKeyframesCloud(cureKeyframeCloud, _curr_kf_idx, 0); // use same root of loop kf idx + loopFindNearKeyframesCloud(targetKeyframeCloud, _loop_kf_idx, historyKeyframeSearchNum); // loop verification sensor_msgs::PointCloud2 cureKeyframeCloudMsg;