Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ endif()

if(MSVC)
add_compile_definitions(_USE_MATH_DEFINES)
# add_compile_options(/openmp:llvm)
add_compile_options(/bigobj)
if(BUILD_WITH_OPENMP)
add_compile_options(/openmp:llvm)
endif()
endif()

##############
Expand Down Expand Up @@ -247,6 +250,12 @@ if(BUILD_EXAMPLES)
TBB::tbbmalloc
PCL::PCL
)
if(MSVC)
set_target_properties(${EXAMPLE_NAME}
PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
)
endif()
endforeach()
endif()

Expand All @@ -273,6 +282,13 @@ if(BUILD_TESTS)
)

gtest_discover_tests(${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

if(MSVC)
set_target_properties(${TEST_NAME}
PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
)
endif()
endforeach()
endif()

Expand Down
4 changes: 2 additions & 2 deletions include/small_gicp/pcl/pcl_registration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class RegistrationPCL : public pcl::Registration<PointSource, PointTarget, float
std::string registration_type_; ///< Registration type ("GICP" or "VGICP").
bool verbose_; ///< Verbosity flag.

std::shared_ptr<KdTree<pcl::PointCloud<PointSource>>> target_tree_; ///< KdTree for target point cloud.
std::shared_ptr<KdTree<pcl::PointCloud<PointSource>>> source_tree_; ///< KdTree for source point cloud.
std::shared_ptr<small_gicp::KdTree<pcl::PointCloud<PointSource>>> target_tree_; ///< KdTree for target point cloud.
std::shared_ptr<small_gicp::KdTree<pcl::PointCloud<PointSource>>> source_tree_; ///< KdTree for source point cloud.

std::shared_ptr<GaussianVoxelMap> target_voxelmap_; ///< VoxelMap for target point cloud.
std::shared_ptr<GaussianVoxelMap> source_voxelmap_; ///< VoxelMap for source point cloud.
Expand Down
6 changes: 3 additions & 3 deletions include/small_gicp/pcl/pcl_registration_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void RegistrationPCL<PointSource, PointTarget>::setInputSource(const PointCloudS
}

pcl::Registration<PointSource, PointTarget, Scalar>::setInputSource(cloud);
source_tree_ = std::make_shared<KdTree<pcl::PointCloud<PointSource>>>(input_, KdTreeBuilderOMP(num_threads_));
source_tree_ = std::make_shared<small_gicp::KdTree<pcl::PointCloud<PointSource>>>(input_, KdTreeBuilderOMP(num_threads_));
source_covs_.clear();
source_voxelmap_.reset();
}
Expand All @@ -56,7 +56,7 @@ void RegistrationPCL<PointSource, PointTarget>::setInputTarget(const PointCloudT
}

pcl::Registration<PointSource, PointTarget, Scalar>::setInputTarget(cloud);
target_tree_ = std::make_shared<KdTree<pcl::PointCloud<PointTarget>>>(target_, KdTreeBuilderOMP(num_threads_));
target_tree_ = std::make_shared<small_gicp::KdTree<pcl::PointCloud<PointTarget>>>(target_, KdTreeBuilderOMP(num_threads_));
target_covs_.clear();
target_voxelmap_.reset();
}
Expand Down Expand Up @@ -214,7 +214,7 @@ void RegistrationPCL<PointSource, PointTarget>::computeTransformation(PointCloud
estimate_covariances_omp(target_proxy, *target_tree_, k_correspondences_, num_threads_);
}

Registration<GICPFactor, ParallelReductionOMP> registration;
small_gicp::Registration<GICPFactor, ParallelReductionOMP> registration;
registration.criteria.rotation_eps = rotation_epsilon_;
registration.criteria.translation_eps = transformation_epsilon_;
registration.reduction.num_threads = num_threads_;
Expand Down
4 changes: 4 additions & 0 deletions include/small_gicp/registration/reduction_omp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
namespace small_gicp {

#ifndef _OPENMP
#ifdef _WIN32
#pragma message(__FILE__, " OpenMP is not available.Parallel reduction will be disabled.")
#else
#warning "OpenMP is not available. Parallel reduction will be disabled."
#endif
inline int omp_get_thread_num() {
return 0;
}
Expand Down
Loading