From 5c528c493b426399e300d40f6e2148e9c01b67a6 Mon Sep 17 00:00:00 2001 From: vsainz <vsainz@iri.upc.edu> Date: Thu, 11 Aug 2022 12:54:55 +0200 Subject: [PATCH] relocated function loadData() --- include/laser/utils/laser3d_tools.h | 8 ++++++++ test/gtest_laser3d_tools.cpp | 7 ------- test/gtest_processor_odom_icp_3d.cpp | 7 ------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/include/laser/utils/laser3d_tools.h b/include/laser/utils/laser3d_tools.h index bb8d56fd1..b96b709c2 100644 --- a/include/laser/utils/laser3d_tools.h +++ b/include/laser/utils/laser3d_tools.h @@ -40,6 +40,14 @@ typedef pcl::Registration<pcl::PointXYZ, pcl::PointXYZ>::Ptr RegistrationPtr; namespace wolf { +void loadData(std::string fname, pcl::PointCloud<pcl::PointXYZ>& cloud) +{ + pcl::io::loadPCDFile(fname, cloud); + // remove NAN points from the cloud + pcl::Indices indices; + pcl::removeNaNFromPointCloud(cloud, cloud, indices); +}; + // _cloud_ref: first PointCloud // _cloud_other: second PointCloud inline void pairAlign(const pcl::PointCloud<pcl::PointXYZ>::Ptr _cloud_ref, diff --git a/test/gtest_laser3d_tools.cpp b/test/gtest_laser3d_tools.cpp index 19fd82e5f..416fb0a20 100644 --- a/test/gtest_laser3d_tools.cpp +++ b/test/gtest_laser3d_tools.cpp @@ -51,13 +51,6 @@ using namespace Eigen; std::string laser_root_dir = _WOLF_LASER_ROOT_DIR; -void loadData(std::string fname, pcl::PointCloud<pcl::PointXYZ>& cloud) -{ - pcl::io::loadPCDFile(fname, cloud); - // remove NAN points from the cloud - pcl::Indices indices; - pcl::removeNaNFromPointCloud(cloud, cloud, indices); -}; TEST(pairAlign, identity) { diff --git a/test/gtest_processor_odom_icp_3d.cpp b/test/gtest_processor_odom_icp_3d.cpp index a372ecb11..a33b3c2e0 100644 --- a/test/gtest_processor_odom_icp_3d.cpp +++ b/test/gtest_processor_odom_icp_3d.cpp @@ -48,13 +48,6 @@ using namespace wolf; std::string laser_root_dir = _WOLF_LASER_ROOT_DIR; -void loadData(std::string fname, pcl::PointCloud<pcl::PointXYZ>& cloud) -{ - pcl::io::loadPCDFile(fname, cloud); - // remove NAN points from the cloud - pcl::Indices indices; - pcl::removeNaNFromPointCloud(cloud, cloud, indices); -}; class Test_ProcessorOdomIcp3D_yaml : public testing::Test { -- GitLab