Matcher.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-2021 Jose Luis Blanco, University of Almeria
4  * See LICENSE for license information.
5  * ------------------------------------------------------------------------- */
12 #pragma once
13 
14 #include <mp2p_icp/Pairings.h>
15 #include <mp2p_icp/metricmap.h>
16 #include <mrpt/containers/yaml.h>
17 #include <mrpt/rtti/CObject.h>
18 #include <mrpt/system/COutputLogger.h>
19 
20 namespace mp2p_icp
21 {
27 {
28  MatchContext() = default;
29 
31  uint32_t icpIteration = 0;
32 };
33 
34 struct MatchState
35 {
36  MatchState(const metric_map_t& pcGlobal, const metric_map_t& pcLocal)
37  : pcGlobal_(pcGlobal), pcLocal_(pcLocal)
38  {
39  initialize();
40  }
41 
45 
48 
51  void initialize()
52  {
53  localPairedBitField.initialize_from(pcLocal_);
54  globalPairedBitField.initialize_from(pcGlobal_);
55  }
56 
57  private:
60 };
61 
70 class Matcher : public mrpt::system::COutputLogger, public mrpt::rtti::CObject
71 {
72  DEFINE_VIRTUAL_MRPT_OBJECT(Matcher)
73 
74  public:
76  virtual void initialize(const mrpt::containers::yaml& params);
77 
82  virtual bool match(
83  const metric_map_t& pcGlobal, const metric_map_t& pcLocal,
84  const mrpt::poses::CPose3D& localPose, const MatchContext& mc,
85  MatchState& ms, Pairings& out) const;
86 
87  uint32_t runFromIteration = 0;
88  uint32_t runUpToIteration = 0;
89 
90  protected:
92  virtual bool impl_match(
93  const metric_map_t& pcGlobal, const metric_map_t& pcLocal,
94  const mrpt::poses::CPose3D& localPose, const MatchContext& mc,
95  MatchState& ms, Pairings& out) const = 0;
96 };
97 
98 using matcher_list_t = std::vector<mp2p_icp::Matcher::Ptr>;
99 
108  const matcher_list_t& matchers, const metric_map_t& pcGlobal,
109  const metric_map_t& pcLocal, const mrpt::poses::CPose3D& local_wrt_global,
110  const MatchContext& mc,
111  const mrpt::optional_ref<MatchState>& userProvidedMS = std::nullopt);
112 
113 } // namespace mp2p_icp
MatchState(const metric_map_t &pcGlobal, const metric_map_t &pcLocal)
Definition: Matcher.h:36
void initialize_from(const metric_map_t &pc, bool initBoolValue=false)
Definition: metricmap.h:228
std::vector< mp2p_icp::Matcher::Ptr > matcher_list_t
Definition: Matcher.h:98
Generic container of pointcloud(s), extracted features and other maps.
Definition: metricmap.h:47
ROSCONSOLE_DECL void initialize()
Common types for all SE(3) optimal transformation methods.
const metric_map_t & pcLocal_
Definition: Matcher.h:59
const metric_map_t & pcGlobal_
Definition: Matcher.h:58
uint32_t icpIteration
The ICP iteration number we are in:
Definition: Matcher.h:31
Generic representation of pointcloud(s) and/or extracted features.
pointcloud_bitfield_t globalPairedBitField
Like localPairedBitField for the global map.
Definition: Matcher.h:47
pointcloud_bitfield_t localPairedBitField
Definition: Matcher.h:44
Pairings run_matchers(const matcher_list_t &matchers, const metric_map_t &pcGlobal, const metric_map_t &pcLocal, const mrpt::poses::CPose3D &local_wrt_global, const MatchContext &mc, const mrpt::optional_ref< MatchState > &userProvidedMS=std::nullopt)


mrpt_local_obstacles
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Thu Jun 1 2023 03:06:43