diff --git a/recipes/small_gicp/all/conandata.yml b/recipes/small_gicp/all/conandata.yml index fe5bc78a8602a..a3609c36dc635 100644 --- a/recipes/small_gicp/all/conandata.yml +++ b/recipes/small_gicp/all/conandata.yml @@ -1,4 +1,4 @@ sources: - "cci.20240421": - url: "https://github.com/koide3/small_gicp/archive/b6b57e03269ca3adb020b23cdf1bc44b40fb968a.zip" - sha256: "f27a3f1e36ff6f3d1151dc4400efbb26190f3010be9850699a85c9ffb5adb81b" + "cci.20240518": + url: "https://github.com/koide3/small_gicp/archive/5c6f13cfc94c1ab129d32b8554c8bd712dc76346.zip" + sha256: "c1c1ebebf7181f1db3130d24cc56314bf5b7b3669ab7e92a58017889e21de448" diff --git a/recipes/small_gicp/all/conanfile.py b/recipes/small_gicp/all/conanfile.py index 4cbf361fa3a42..e619cd89c75a2 100644 --- a/recipes/small_gicp/all/conanfile.py +++ b/recipes/small_gicp/all/conanfile.py @@ -14,7 +14,7 @@ class IridescenceConan(ConanFile): name = "small_gicp" description = "Efficient and parallelized algorithms for point cloud registration" - license = "MIT AND BSD" # BSD is from nanoflann + license = "MIT AND BSD" # BSD is from nanoflann and Sophus url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/koide3/small_gicp" topics = ("point-cloud", "icp", "registration", "scan-matching", "pcl") @@ -64,8 +64,6 @@ def requirements(self): self.requires("llvm-openmp/17.0.6", transitive_headers=True, transitive_libs=True) if self.options.with_tbb: self.requires("onetbb/2021.12.0", transitive_headers=True, transitive_libs=True) - # The project vendors nanoflann, but it has been heavily extended and should be kept intact - # Also uses some fragments from Sophus def validate(self): if self.settings.compiler.cppstd: @@ -106,6 +104,7 @@ def build(self): def package(self): copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + # The source code contains fragments from nanoflann and Sophus copy(self, "LICENSE.nanoflann", self.source_folder, os.path.join(self.package_folder, "licenses")) copy(self, "LICENSE.sophus", self.source_folder, os.path.join(self.package_folder, "licenses")) cmake = CMake(self) diff --git a/recipes/small_gicp/all/test_package/test_package.cpp b/recipes/small_gicp/all/test_package/test_package.cpp index ec5506ec27e29..d16b1226a96f0 100644 --- a/recipes/small_gicp/all/test_package/test_package.cpp +++ b/recipes/small_gicp/all/test_package/test_package.cpp @@ -1,12 +1,4 @@ -// https://github.com/koide3/small_gicp/blob/ff8269ec09c9ddccff8358a4b7cc5e4c5fda134f/src/example/03_registration_template.cpp -// SPDX-FileCopyrightText: Copyright 2024 Kenji Koide -// SPDX-License-Identifier: MIT - -/// @brief Basic point cloud registration example with small_gicp::align() -#include -#include -#include - +#include #include #ifdef WITH_TBB #include @@ -14,54 +6,19 @@ using namespace small_gicp; -/// @brief Most basic registration example. -void example1(const std::vector& target_points, const std::vector& source_points) { - RegistrationSetting setting; - setting.num_threads = 4; // Number of threads to be used - setting.downsampling_resolution = 0.25; // Downsampling resolution - setting.max_correspondence_distance = 1.0; // Maximum correspondence distance between points (e.g., trimming threshold) - - Eigen::Isometry3d init_T_target_source = Eigen::Isometry3d::Identity(); - RegistrationResult result = align(target_points, source_points, init_T_target_source, setting); - - std::cout << "--- T_target_source ---" << std::endl << result.T_target_source.matrix() << std::endl; - std::cout << "converged:" << result.converged << std::endl; - std::cout << "error:" << result.error << std::endl; - std::cout << "iterations:" << result.iterations << std::endl; - std::cout << "num_inliers:" << result.num_inliers << std::endl; - std::cout << "--- H ---" << std::endl << result.H << std::endl; - std::cout << "--- b ---" << std::endl << result.b.transpose() << std::endl; -} - -int main(int argc, char** argv) { +int main() { std::vector target_points = { {1.0f, 2.0f, 3.0f, 1.0f}, {4.0f, 5.0f, 6.0f, 1.0f}, {7.0f, 8.0f, 9.0f, 1.0f}, - {10.0f, 11.0f, 12.0f, 1.0f}, - {13.0f, 14.0f, 15.0f, 1.0f}, - {16.0f, 17.0f, 18.0f, 1.0f}, - {19.0f, 20.0f, 21.0f, 1.0f}, - {22.0f, 23.0f, 24.0f, 1.0f} - }; - std::vector source_points = { - {1.1f, 2.1f, 3.2f, 1.0f}, - {4.2f, 4.9f, 6.1f, 1.0f}, - {6.9f, 8.2f, 9.1f, 1.0f}, - {10.2f, 10.8f, 12.2f, 1.0f}, - {13.1f, 14.0f, 15.2f, 1.0f}, - {15.9f, 17.2f, 18.1f, 1.0f}, - {19.2f, 20.1f, 21.2f, 1.0f}, - {22.1f, 23.1f, 24.2f, 1.0f} }; + auto target = std::make_shared(target_points); - example1(target_points, source_points); + const int num_threads = 1; + std::make_shared>(target, KdTreeBuilderOMP(num_threads)); - // test that these compile and link - KdTreeOMP::Ptr kdtree_omp; #ifdef WITH_TBB - KdTreeTBB::Ptr kdtree_tbb; + std::make_shared>(target, KdTreeBuilderTBB()); #endif - return 0; } diff --git a/recipes/small_gicp/config.yml b/recipes/small_gicp/config.yml index d0500a5ed984f..40503097dff10 100644 --- a/recipes/small_gicp/config.yml +++ b/recipes/small_gicp/config.yml @@ -1,3 +1,3 @@ versions: - "cci.20240421": + "cci.20240518": folder: all