-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
12 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sources: | ||
"cci.20240421": | ||
url: "https://github.com/koide3/small_gicp/archive/b6b57e03269ca3adb020b23cdf1bc44b40fb968a.zip" | ||
sha256: "f27a3f1e36ff6f3d1151dc4400efbb26190f3010be9850699a85c9ffb5adb81b" | ||
"cci.20240508": | ||
url: "https://github.com/koide3/small_gicp/archive/eec9c4af60635b069c4d58433a8197b118ca0756.zip" | ||
sha256: "160c18e52921eaacae08e9aa06d618b268ec593a227e75da8836097dcfa43ab2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,24 @@ | ||
// 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 <iostream> | ||
#include <small_gicp/benchmark/read_points.hpp> | ||
#include <small_gicp/registration/registration_helper.hpp> | ||
|
||
#include <small_gicp/points/point_cloud.hpp> | ||
#include <small_gicp/ann/kdtree_omp.hpp> | ||
#ifdef WITH_TBB | ||
#include <small_gicp/ann/kdtree_tbb.hpp> | ||
#endif | ||
|
||
using namespace small_gicp; | ||
|
||
/// @brief Most basic registration example. | ||
void example1(const std::vector<Eigen::Vector4f>& target_points, const std::vector<Eigen::Vector4f>& 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<Eigen::Vector4f> 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<Eigen::Vector4f> 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<PointCloud>(target_points); | ||
|
||
example1(target_points, source_points); | ||
const int num_threads = 1; | ||
std::make_shared<KdTree<PointCloud>>(target, KdTreeBuilderOMP(num_threads)); | ||
|
||
// test that these compile and link | ||
KdTreeOMP<PointCloud>::Ptr kdtree_omp; | ||
#ifdef WITH_TBB | ||
KdTreeTBB<PointCloud>::Ptr kdtree_tbb; | ||
std::make_shared<KdTree<PointCloud>>(target, KdTreeBuilderTBB()); | ||
#endif | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
versions: | ||
"cci.20240421": | ||
"cci.20240508": | ||
folder: all |