10 static Methods* global;
29 const size_t n = this->a.size();
41 sum_squares += match.sq_dist;
43 return std::sqrt(sum_squares /
a.size());
51 || result.iteration_count < burn_in) {
67 result.iteration_count++;
79 static void ensure_methods_exists() {
86 std::function<std::unique_ptr<ICP>(
const ICP::Config&)> constructor) {
87 ensure_methods_exists();
94 ensure_methods_exists();
99 ensure_methods_exists();
Configuration for ICP instances.
static bool register_method(std::string name, std::function< std::unique_ptr< ICP >(const Config &)> constructor)
Registers a new ICP method that can be created with constructor, returning false if name has already ...
double previous_cost
Keeps track of the previous cost to ensure that progress is being made.
static std::unique_ptr< ICP > from_method(std::string name, const Config ¶ms=Config())
Factory constructor for the ICP method name with configuration config.
RBTransform transform
The current point cloud transformation that is being optimized.
ConvergenceReport converge(size_t burn_in, double convergence_threshold)
Perform ICP for the point clouds a and b provided with ICP::begin until the cost is below convergence...
double current_cost
The RMS (root mean square) cost of the current transformation.
std::vector< Vector > a
The source point cloud relative to its centroid.
static const std::vector< std::string > & registered_methods()
Returns a current list of the names of currently registered ICP methods.
std::vector< Vector > b
The destination point cloud relative to its centroid.
std::vector< Match > matches
The pairing of each point in a to its closest in b.
void begin(const std::vector< Vector > &a, const std::vector< Vector > &b, RBTransform t)
Begins the ICP process for point clouds a and b with an initial guess for the transform t.
const RBTransform & current_transform() const
The current transform.
virtual void iterate()=0
Perform one iteration of ICP for the point clouds a and b provided with ICP::begin.
double calculate_cost() const
Computes the cost of the current transformation.
static bool is_registered_method(std::string name)
Whether name is a registered ICP method.
The result of running ICP::converge.
std::vector< std::function< std::unique_ptr< ICP >(const ICP::Config &)> registered_method_constructors)
std::vector< std::string > registered_method_names