Skip to content

Commit

Permalink
configurable registration parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Oct 15, 2019
1 parent f4229d6 commit b54d11b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/hdl_graph_slam/registration_methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class RegistrationMethods {
private:
int registration_method;
float registration_resolution;

float transformation_epsilon;
int max_iterations;

std::vector<const char*> registration_methods;
};
} // namespace hdl_graph_slam
Expand Down
7 changes: 6 additions & 1 deletion src/hdl_graph_slam/registration_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace hdl_graph_slam {

RegistrationMethods::RegistrationMethods() : registration_method(1), registration_resolution(2.0f), registration_methods({"ICP", "GICP", "NDT", "GICP_OMP", "NDT_OMP"}) {}
RegistrationMethods::RegistrationMethods() : registration_method(1), registration_resolution(2.0f), transformation_epsilon(1e-4), max_iterations(64), registration_methods({"ICP", "GICP", "NDT", "GICP_OMP", "NDT_OMP"}) {}

RegistrationMethods::~RegistrationMethods() {}

Expand All @@ -20,6 +20,8 @@ void RegistrationMethods::draw_ui() {
if(std::string(registration_methods[registration_method]).find("NDT") != std::string::npos) {
ImGui::DragFloat("Resolution", &registration_resolution, 0.1f, 0.1f, 20.0f);
}
ImGui::DragFloat("Transformation epsilon", &transformation_epsilon, 1e-5f, 1e-5f, 1e-2f, "%.6f");
ImGui::DragInt("Max iterations", &max_iterations, 1, 1, 256);
}

pcl::Registration<pcl::PointXYZI, pcl::PointXYZI>::Ptr RegistrationMethods::method() const {
Expand Down Expand Up @@ -57,6 +59,9 @@ pcl::Registration<pcl::PointXYZI, pcl::PointXYZI>::Ptr RegistrationMethods::meth
} break;
}

registration->setTransformationEpsilon(transformation_epsilon);
registration->setMaximumIterations(max_iterations);

return registration;
}
} // namespace hdl_graph_slam

0 comments on commit b54d11b

Please sign in to comment.