diff --git a/localization/ndt_scan_matcher/include/ndt_scan_matcher/map_loader.hpp b/localization/ndt_scan_matcher/include/ndt_scan_matcher/map_loader.hpp index 6015616a34804..8cb3ec6987de3 100644 --- a/localization/ndt_scan_matcher/include/ndt_scan_matcher/map_loader.hpp +++ b/localization/ndt_scan_matcher/include/ndt_scan_matcher/map_loader.hpp @@ -87,14 +87,14 @@ class MapLoader } // Wait for all running threads to finish - inline void sync() { - if (load_manager_future_.valid()) - { + inline void sync() + { + if (load_manager_future_.valid()) { load_manager_future_.wait(); } - for(auto &tf : thread_futures_) { - if(tf.valid()) { + for (auto & tf : thread_futures_) { + if (tf.valid()) { tf.wait(); } } @@ -128,13 +128,13 @@ class MapLoader // Loop until an idle thread is found while (true) { // Return immediately if a thread that has not been given a job is found - if(!thread_futures_[tid].valid()) { + if (!thread_futures_[tid].valid()) { last_check_tid_ = tid; return tid; } // If no such thread is found, wait for the current thread to finish its job - if(thread_futures_[tid].wait_for(span) == std::future_status::ready) { + if (thread_futures_[tid].wait_for(span) == std::future_status::ready) { last_check_tid_ = tid; return tid; } diff --git a/localization/ndt_scan_matcher/src/map_loader.cpp b/localization/ndt_scan_matcher/src/map_loader.cpp index 4769c8e359943..62569ada7f175 100644 --- a/localization/ndt_scan_matcher/src/map_loader.cpp +++ b/localization/ndt_scan_matcher/src/map_loader.cpp @@ -115,7 +115,8 @@ void MapLoader::parallel_load_setup( query(x, y, radius, cached_ids, pcd_to_add_, pcd_to_remove_); // Start loading right now - load_manager_future_ = std::async(std::launch::async, &MapLoader::loadManagerThread, this); + load_manager_future_ = + std::async(std::launch::async, &MapLoader::loadManagerThread, this); } template diff --git a/localization/ndt_scan_matcher/src/utils.cpp b/localization/ndt_scan_matcher/src/utils.cpp index f8b0f9a04781c..0e71cb23c22e4 100644 --- a/localization/ndt_scan_matcher/src/utils.cpp +++ b/localization/ndt_scan_matcher/src/utils.cpp @@ -64,10 +64,8 @@ void queryContainedSegmentIdx( auto ub = m.coordinateToSegmentIndex(upper_x, upper_y); // Loop on the candidate boundaries - for (float min_x = lb.x; min_x <= ub.x; min_x += m.res_x_) - { - for (float min_y = lb.y; min_y <= ub.y; min_y += m.res_y_) - { + for (float min_x = lb.x; min_x <= ub.x; min_x += m.res_x_) { + for (float min_y = lb.y; min_y <= ub.y; min_y += m.res_y_) { pcl::PointXYZ lower_bound, upper_bound; lower_bound.x = min_x; @@ -75,8 +73,7 @@ void queryContainedSegmentIdx( upper_bound.x = min_x + m.res_x_; upper_bound.y = min_y + m.res_y_; - if (cylinderAndBoxOverlapExists(center_x, center_y, radius, lower_bound, upper_bound)) - { + if (cylinderAndBoxOverlapExists(center_x, center_y, radius, lower_bound, upper_bound)) { map_id.push_back(m.coordinateToSegmentIndex(lower_bound.x, lower_bound.y)); } }