From a6bad4d2313c9004d7fe1681db28d7558221bfaf Mon Sep 17 00:00:00 2001 From: Markus Vieth Date: Fri, 4 Sep 2020 13:58:12 +0200 Subject: [PATCH] Make changes towards index_t in sac_model_registration --- .../pcl/sample_consensus/sac_model_registration.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_registration.h b/sample_consensus/include/pcl/sample_consensus/sac_model_registration.h index b592dfa8849..51b9b13ea5c 100644 --- a/sample_consensus/include/pcl/sample_consensus/sac_model_registration.h +++ b/sample_consensus/include/pcl/sample_consensus/sac_model_registration.h @@ -49,6 +49,7 @@ #include #include #include +#include // for std::iota namespace pcl { @@ -130,13 +131,10 @@ namespace pcl setInputTarget (const PointCloudConstPtr &target) { target_ = target; - indices_tgt_.reset (new Indices); // Cache the size and fill the target indices - int target_size = static_cast (target->size ()); - indices_tgt_->resize (target_size); - - for (int i = 0; i < target_size; ++i) - (*indices_tgt_)[i] = i; + const index_t target_size = static_cast (target->size ()); + indices_tgt_.reset (new Indices (target_size)); + std::iota (indices_tgt_->begin (), indices_tgt_->end (), 0); computeOriginalIndexMapping (); } @@ -340,7 +338,7 @@ namespace pcl IndicesPtr indices_tgt_; /** \brief Given the index in the original point cloud, give the matching original index in the target cloud */ - std::map correspondences_; + std::map correspondences_; /** \brief Internal distance threshold used for the sample selection step. */ double sample_dist_thresh_;