Solver_GaussNewton.cpp
Go to the documentation of this file.
1 /* -------------------------------------------------------------------------
2  * A repertory of multi primitive-to-primitive (MP2P) ICP algorithms in C++
3  * Copyright (C) 2018-2024 Jose Luis Blanco, University of Almeria
4  * See LICENSE for license information.
5  * ------------------------------------------------------------------------- */
15 #include <mrpt/core/exceptions.h>
16 
18 
19 using namespace mp2p_icp;
20 
21 void Solver_GaussNewton::initialize(const mrpt::containers::yaml& params)
22 {
23  Solver::initialize(params);
24 
25  MCP_LOAD_REQ(params, maxIterations);
26  MCP_LOAD_OPT(params, innerLoopVerbose);
27  MCP_LOAD_OPT(params, robustKernel);
28 
30 
31  if (params.has("pair_weights"))
32  pairWeights.load_from(params["pair_weights"]);
33 }
34 
36  const Pairings& pairings, OptimalTF_Result& out,
37  [[maybe_unused]] const SolverContext& sc) const
38 {
39  MRPT_START
40 
42 
44 
45  OptimalTF_GN_Parameters gnParams;
47  gnParams.pairWeights = pairWeights;
48  gnParams.kernel = robustKernel;
49  gnParams.kernelParam = robustKernelParam;
50  gnParams.prior = sc.prior;
51 
52  ASSERT_(sc.guessRelativePose.has_value());
53  gnParams.linearizationPoint =
54  mrpt::poses::CPose3D(sc.guessRelativePose.value());
55 
56  gnParams.verbose = innerLoopVerbose;
57 
58  // Compute the optimal pose, and return its validity:
59  return optimal_tf_gauss_newton(pairings, out, gnParams);
60 
61  MRPT_END
62 }
mp2p_icp::OptimalTF_GN_Parameters
Definition: optimal_tf_gauss_newton.h:24
mp2p_icp::optimal_tf_gauss_newton
bool optimal_tf_gauss_newton(const Pairings &in, OptimalTF_Result &result, const OptimalTF_GN_Parameters &gnParams=OptimalTF_GN_Parameters())
Definition: optimal_tf_gauss_newton.cpp:28
mp2p_icp::Parameterizable::checkAllParametersAreRealized
void checkAllParametersAreRealized() const
Definition: Parameterizable.cpp:138
mp2p_icp::OptimalTF_GN_Parameters::kernelParam
double kernelParam
Definition: optimal_tf_gauss_newton.h:50
mp2p_icp
Definition: covariance.h:17
DECLARE_PARAMETER_OPT
#define DECLARE_PARAMETER_OPT(__yaml, __variable)
Definition: Parameterizable.h:164
mp2p_icp::Solver_GaussNewton
Definition: Solver_GaussNewton.h:25
mp2p_icp::Pairings
Definition: Pairings.h:78
mp2p_icp::Solver_GaussNewton::robustKernelParam
double robustKernelParam
Definition: Solver_GaussNewton.h:34
mp2p_icp::Solver_GaussNewton::pairWeights
PairWeights pairWeights
Definition: Solver_GaussNewton.h:31
mp2p_icp::Solver_GaussNewton::maxIterations
uint32_t maxIterations
Definition: Solver_GaussNewton.h:30
mp2p_icp::OptimalTF_GN_Parameters::verbose
bool verbose
Definition: optimal_tf_gauss_newton.h:52
mp2p_icp::OptimalTF_GN_Parameters::kernel
RobustKernel kernel
Definition: optimal_tf_gauss_newton.h:49
mp2p_icp::SolverContext
Definition: Solver.h:36
mp2p_icp::OptimalTF_Result
Definition: OptimalTF_Result.h:24
mp2p_icp::Solver_GaussNewton::robustKernel
RobustKernel robustKernel
Definition: Solver_GaussNewton.h:33
optimal_tf_gauss_newton.h
Simple non-linear optimizer to find the SE(3) optimal transformation.
mp2p_icp::Solver_GaussNewton::innerLoopVerbose
bool innerLoopVerbose
Prints GN inner loop details.
Definition: Solver_GaussNewton.h:35
kitti-batch-convert.out
string out
Definition: kitti-batch-convert.py:7
mp2p_icp::Solver
Definition: Solver.h:66
mp2p_icp::PairWeights::load_from
void load_from(const mrpt::containers::yaml &p)
Definition: PairWeights.cpp:18
mp2p_icp::OptimalTF_GN_Parameters::prior
std::optional< mrpt::poses::CPose3DPDFGaussianInf > prior
Definition: optimal_tf_gauss_newton.h:36
mp2p_icp::OptimalTF_GN_Parameters::maxInnerLoopIterations
uint32_t maxInnerLoopIterations
Definition: optimal_tf_gauss_newton.h:47
mp2p_icp::OptimalTF_GN_Parameters::pairWeights
PairWeights pairWeights
Definition: optimal_tf_gauss_newton.h:44
mp2p_icp::OptimalTF_GN_Parameters::linearizationPoint
std::optional< mrpt::poses::CPose3D > linearizationPoint
Definition: optimal_tf_gauss_newton.h:29
IMPLEMENTS_MRPT_OBJECT
IMPLEMENTS_MRPT_OBJECT(QualityEvaluator_RangeImageSimilarity, QualityEvaluator, mp2p_icp) using namespace mp2p_icp
Solver_GaussNewton.h
ICP registration for points and planes.
mp2p_icp::Solver::initialize
virtual void initialize(const mrpt::containers::yaml &params)
Definition: Solver.cpp:20
mp2p_icp::Solver_GaussNewton::impl_optimal_pose
bool impl_optimal_pose(const Pairings &pairings, OptimalTF_Result &out, const SolverContext &sc) const override
Definition: Solver_GaussNewton.cpp:35
mp2p_icp::Solver_GaussNewton::initialize
void initialize(const mrpt::containers::yaml &params) override
Definition: Solver_GaussNewton.cpp:21


mp2p_icp
Author(s):
autogenerated on Wed Oct 23 2024 02:45:41