Solver.h
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  * ------------------------------------------------------------------------- */
12 #pragma once
13 
15 #include <mp2p_icp/Pairings.h>
18 #include <mrpt/containers/yaml.h>
19 #include <mrpt/poses/CPose3D.h>
20 #include <mrpt/poses/CPose3DPDFGaussianInf.h>
21 #include <mrpt/rtti/CObject.h>
22 #include <mrpt/system/COutputLogger.h>
23 #include <mrpt/version.h>
24 
25 #include <any>
26 #include <optional>
27 
28 namespace mp2p_icp
29 {
30 class Solver;
31 
37 {
38  SolverContext() = default;
39 
40  std::optional<mrpt::poses::CPose3D> guessRelativePose;
41  std::optional<mrpt::poses::CPose3D> currentCorrectionFromInitialGuess;
42  std::optional<mrpt::poses::CPose3D> lastIcpStepIncrement;
43 
49  std::optional<mrpt::poses::CPose3DPDFGaussianInf> prior;
50 
51  // room for optional solver-specific context:
52  mutable std::map<const Solver*, std::map<std::string, std::any>>
54 
55  std::optional<uint32_t> icpIteration;
56 };
57 
66 class Solver : public mrpt::system::COutputLogger,
67  public mrpt::rtti::CObject,
69 {
70 #if MRPT_VERSION < 0x020e00
71  DEFINE_VIRTUAL_MRPT_OBJECT(Solver)
72 #else
73  DEFINE_VIRTUAL_MRPT_OBJECT(Solver, mp2p_icp)
74 #endif
75 
76  public:
78  virtual void initialize(const mrpt::containers::yaml& params);
79 
86  virtual bool optimal_pose(
87  const Pairings& pairings, OptimalTF_Result& out,
88  const SolverContext& sc) const;
89 
90  uint32_t runFromIteration = 0;
91  uint32_t runUpToIteration = 0;
92 
94 
96  bool enabled = true;
97 
98  protected:
99  virtual bool impl_optimal_pose(
100  const Pairings& pairings, OptimalTF_Result& out,
101  const SolverContext& sc) const = 0;
102 };
103 
104 } // namespace mp2p_icp
mp2p_icp::Solver::runFromIteration
uint32_t runFromIteration
Definition: Solver.h:90
mp2p_icp::Solver::optimal_pose
virtual bool optimal_pose(const Pairings &pairings, OptimalTF_Result &out, const SolverContext &sc) const
Definition: Solver.cpp:28
mp2p_icp
Definition: covariance.h:17
mp2p_icp::SolverContext::perSolverPersistentData
std::map< const Solver *, std::map< std::string, std::any > > perSolverPersistentData
Definition: Solver.h:53
mp2p_icp::Pairings
Definition: Pairings.h:78
mp2p_icp::SolverContext
Definition: Solver.h:36
OptimalTF_Result.h
Common types for all SE(3) optimal transformation methods.
mp2p_icp::OptimalTF_Result
Definition: OptimalTF_Result.h:24
mp2p_icp::SolverContext::guessRelativePose
std::optional< mrpt::poses::CPose3D > guessRelativePose
Definition: Solver.h:40
mp2p_icp::SolverContext::icpIteration
std::optional< uint32_t > icpIteration
Definition: Solver.h:55
kitti-batch-convert.out
string out
Definition: kitti-batch-convert.py:7
mp2p_icp::SolverContext::lastIcpStepIncrement
std::optional< mrpt::poses::CPose3D > lastIcpStepIncrement
Definition: Solver.h:42
mp2p_icp::Solver
Definition: Solver.h:66
mp2p_icp::Solver::runUntilTranslationCorrectionSmallerThan
double runUntilTranslationCorrectionSmallerThan
Definition: Solver.h:93
mp2p_icp::Parameterizable
Definition: Parameterizable.h:85
mp2p_icp::Solver::impl_optimal_pose
virtual bool impl_optimal_pose(const Pairings &pairings, OptimalTF_Result &out, const SolverContext &sc) const =0
mp2p_icp::SolverContext::prior
std::optional< mrpt::poses::CPose3DPDFGaussianInf > prior
Definition: Solver.h:49
mp2p_icp::SolverContext::SolverContext
SolverContext()=default
Pairings.h
Common types for all SE(3) optimal transformation methods.
WeightParameters.h
Common types for all SE(3) optimal transformation methods.
Parameterizable.h
mp2p_icp::Solver::initialize
virtual void initialize(const mrpt::containers::yaml &params)
Definition: Solver.cpp:20
mp2p_icp::Solver::runUpToIteration
uint32_t runUpToIteration
0: no limit
Definition: Solver.h:91
mp2p_icp::SolverContext::currentCorrectionFromInitialGuess
std::optional< mrpt::poses::CPose3D > currentCorrectionFromInitialGuess
Definition: Solver.h:41
mp2p_icp::Solver::enabled
bool enabled
Definition: Solver.h:96


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