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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ endif ()

# Options
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTS "Build tests" ON)
option(BUILD_TEASER_FPFH "Build TEASER++ wrappers for PCL FPFH estimation." OFF)
option(BUILD_MATLAB_BINDINGS "Build MATLAB bindings" OFF)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
Expand Down Expand Up @@ -78,7 +77,8 @@ endif ()
set(TEASERPP_ROOT ${CMAKE_CURRENT_LIST_DIR})
add_subdirectory(teaser)

if (BUILD_TESTS)
include(CTest)
if (BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif ()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ wheel.install-dir = "teaserpp_python.libs"

[tool.scikit-build.cmake.define]
BUILD_PYTHON_BINDINGS = "ON"
BUILD_TESTS = "OFF"
BUILD_TESTING = "OFF"
BUILD_SHARED_LIBS = "OFF"

[tool.cibuildwheel]
Expand Down
125 changes: 51 additions & 74 deletions teaser/include/teaser/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ class FastGlobalRegistrationSolver : public GNCRotationSolver {
* H. Lim et al., "A Single Correspondence Is Enough: Robust Global Registration
* to Avoid Degeneracy in Urban Environments," in Robotics - ICRA 2022,
* Accepted. To appear. arXiv:2203.06612 [cs], Mar. 2022.
* Quatro and TEASER++ differ in the estimation of rotation. Quatro forgoes roll and pitch estimation,
* yet it is empirically found that it makes the algorithm more robust against degeneracy.
* Quatro and TEASER++ differ in the estimation of rotation. Quatro forgoes roll and pitch
* estimation, yet it is empirically found that it makes the algorithm more robust against
* degeneracy.
*/
class QuatroSolver : public GNCRotationSolver {
public:
Expand Down Expand Up @@ -515,28 +516,21 @@ class RobustRegistrationSolver {

RobustRegistrationSolver() = default;


/**
* A constructor that takes in parameters and initialize the estimators
* accordingly. If the parameters need to be reused consider instantiating
* a Params struct.
*/
RobustRegistrationSolver(
double noise_bound,
double cbar2,
bool estimate_scaling,
ROTATION_ESTIMATION_ALGORITHM rotation_estimation_algorithm,
double rotation_gnc_factor,
size_t rotation_max_iterations,
double rotation_cost_threshold,
INLIER_GRAPH_FORMULATION rotation_tim_graph,
INLIER_SELECTION_MODE inlier_selection_mode,
double kcore_heuristic_threshold,
bool use_max_clique, // deprecated
bool max_clique_exact_solution, // deprecated
double max_clique_time_limit,
int max_clique_num_threads = 0
);
RobustRegistrationSolver(double noise_bound, double cbar2, bool estimate_scaling,
ROTATION_ESTIMATION_ALGORITHM rotation_estimation_algorithm,
double rotation_gnc_factor, size_t rotation_max_iterations,
double rotation_cost_threshold,
INLIER_GRAPH_FORMULATION rotation_tim_graph,
INLIER_SELECTION_MODE inlier_selection_mode,
double kcore_heuristic_threshold,
bool use_max_clique, // deprecated
bool max_clique_exact_solution, // deprecated
double max_clique_time_limit, int max_clique_num_threads = 0);

/**
* A constructor that takes in parameters and initialize the estimators accordingly.
Expand Down Expand Up @@ -827,55 +821,40 @@ class RobustRegistrationSolver {
* Reset the solver using the provided params
* @param params a Params struct
*/
void reset(
const double noise_bound,
const double cbar2,
const bool estimate_scaling,
const ROTATION_ESTIMATION_ALGORITHM rotation_estimation_algorithm,
const double rotation_gnc_factor,
const size_t rotation_max_iterations,
const double rotation_cost_threshold,
const INLIER_GRAPH_FORMULATION rotation_tim_graph,
const INLIER_SELECTION_MODE inlier_selection_mode,
const double kcore_heuristic_threshold,
const bool use_max_clique , // deprecated
const bool max_clique_exact_solution, // deprecated
const double max_clique_time_limit,
const int max_clique_num_threads
) {
void reset(const Params& params) {
params_ = params;
// Initialize the scale estimator
if (estimate_scaling) {
if (params_.estimate_scaling) {
setScaleEstimator(
std::make_unique<teaser::TLSScaleSolver>(noise_bound, cbar2));
std::make_unique<teaser::TLSScaleSolver>(params_.noise_bound, params_.cbar2));
} else {
setScaleEstimator(
std::make_unique<teaser::ScaleInliersSelector>(noise_bound, cbar2));
std::make_unique<teaser::ScaleInliersSelector>(params_.noise_bound, params_.cbar2));
}

// Initialize the rotation estimator
teaser::GNCRotationSolver::Params rotation_params {
rotation_max_iterations, rotation_cost_threshold,
rotation_gnc_factor, noise_bound
};

switch (rotation_estimation_algorithm) {
case ROTATION_ESTIMATION_ALGORITHM::GNC_TLS: { // GNC-TLS method
setRotationEstimator(std::make_unique<teaser::GNCTLSRotationSolver>(rotation_params));
break;
}
case ROTATION_ESTIMATION_ALGORITHM::FGR: { // FGR method
setRotationEstimator(std::make_unique<teaser::FastGlobalRegistrationSolver>(rotation_params));
break;
}
case ROTATION_ESTIMATION_ALGORITHM::QUATRO: { // Quatro method
setRotationEstimator(std::make_unique<teaser::QuatroSolver>(rotation_params));
break;
}
teaser::GNCRotationSolver::Params rotation_params{
params_.rotation_max_iterations, params_.rotation_cost_threshold,
params_.rotation_gnc_factor, params_.noise_bound};

switch (params_.rotation_estimation_algorithm) {
case ROTATION_ESTIMATION_ALGORITHM::GNC_TLS: { // GNC-TLS method
setRotationEstimator(std::make_unique<teaser::GNCTLSRotationSolver>(rotation_params));
break;
}
case ROTATION_ESTIMATION_ALGORITHM::FGR: { // FGR method
setRotationEstimator(std::make_unique<teaser::FastGlobalRegistrationSolver>(rotation_params));
break;
}
case ROTATION_ESTIMATION_ALGORITHM::QUATRO: { // Quatro method
setRotationEstimator(std::make_unique<teaser::QuatroSolver>(rotation_params));
break;
}
}

// Initialize the translation estimator
setTranslationEstimator(
std::make_unique<teaser::TLSTranslationSolver>(noise_bound, cbar2));
std::make_unique<teaser::TLSTranslationSolver>(params_.noise_bound, params_.cbar2));

// Clear member variables
max_clique_.clear();
Expand All @@ -888,23 +867,21 @@ class RobustRegistrationSolver {
* Reset the solver using the provided params
* @param params a Params struct
*/
void reset(const Params& params) {
reset(
params.noise_bound,
params.cbar2,
params.estimate_scaling,
params.rotation_estimation_algorithm,
params.rotation_gnc_factor,
params.rotation_max_iterations,
params.rotation_cost_threshold,
params.rotation_tim_graph,
params.inlier_selection_mode,
params.kcore_heuristic_threshold,
params.use_max_clique,
params.max_clique_exact_solution,
params.max_clique_time_limit,
params.max_clique_num_threads
);
void reset(const double noise_bound, const double cbar2, const bool estimate_scaling,
const ROTATION_ESTIMATION_ALGORITHM rotation_estimation_algorithm,
const double rotation_gnc_factor, const size_t rotation_max_iterations,
const double rotation_cost_threshold,
const INLIER_GRAPH_FORMULATION rotation_tim_graph,
const INLIER_SELECTION_MODE inlier_selection_mode,
const double kcore_heuristic_threshold,
const bool use_max_clique, // deprecated
const bool max_clique_exact_solution, // deprecated
const double max_clique_time_limit, const int max_clique_num_threads) {
reset(Params{noise_bound, cbar2, estimate_scaling, rotation_estimation_algorithm,
rotation_gnc_factor, rotation_max_iterations, rotation_cost_threshold,
rotation_tim_graph, inlier_selection_mode, kcore_heuristic_threshold,
use_max_clique, max_clique_exact_solution, max_clique_time_limit,
max_clique_num_threads});
}

/**
Expand Down