MRPT  2.0.1
CMetricMapsAlignmentAlgorithm.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/core/optional_ref.h>
12 #include <mrpt/maps/CPointsMap.h>
13 #include <mrpt/poses/CPose3DPDF.h>
14 #include <mrpt/poses/CPosePDF.h>
15 #include <mrpt/poses/poses_frwds.h>
16 
18 
19 namespace mrpt::slam
20 {
21 /** Used as base class for other result structures of each particular algorithm
22  * in CMetricMapsAlignmentAlgorithm derived classes.
23  *
24  * \ingroup mrpt_slam_grp
25  */
27 {
28  TMetricMapAlignmentResult() = default;
29  virtual ~TMetricMapAlignmentResult() = default;
30 
31  double executionTime = 0;
32 };
33 
34 /** A base class for any algorithm able of maps alignment. There are two methods
35  * depending on an PDF or a single 2D Pose value is available as initial guess
36  * for the methods.
37  *
38  * \sa CPointsMap
39  * \ingroup mrpt_slam_grp
40  */
42 {
43  public:
45  : mrpt::system::COutputLogger("CMetricMapsAlignmentAlgorithm")
46  {
47  }
48  /** Dtor */
49  ~CMetricMapsAlignmentAlgorithm() override = default;
50 
51  /** The method for aligning a pair of metric maps, for SE(2) relative poses.
52  * The meaning of some parameters and the kind of the maps to be aligned
53  * are implementation dependant, so look at the derived classes for
54  * instructions. The target is to find a PDF for the pose displacement
55  * between maps, **thus the pose of m2 relative to m1**. This pose is
56  * returned as a PDF rather than a single value.
57  *
58  * \param m1 [IN] The first map
59  * \param m2 [IN] The second map. The pose of this map respect to
60  * m1 is to be estimated.
61  * \param grossEst [IN] An initial gross estimation for the
62  * displacement. If a given algorithm doesn't need it, set to
63  * `CPose2D(0,0,0)` for example.
64  * \param runningTime [OUT] A pointer to a container for obtaining the
65  * algorithm running time in seconds, or nullptr if you don't need it.
66  * \param info [OUT] See derived classes for details, or nullptr if
67  * it
68  * isn't needed.
69  *
70  * \return A smart pointer to the output estimated pose PDF.
71  * \sa CICP
72  */
75  const mrpt::poses::CPose2D& grossEst,
76  mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt);
77 
78  /** \overload of Align() with a PDF for the initial pose.
79  *
80  * \return A smart pointer to the output estimated pose PDF.
81  * \sa CICP
82  */
85  const mrpt::poses::CPosePDFGaussian& initialEstimationPDF,
87  std::nullopt) = 0;
88 
89  /** \overload of Align() for SE(3) poses.
90  *
91  * \return A smart pointer to the output estimated pose PDF.
92  * \sa CICP
93  */
96  const mrpt::poses::CPose3D& grossEst,
97  mrpt::optional_ref<TMetricMapAlignmentResult> outInfo = std::nullopt);
98 
99  /** \overload of Align3D() for initial guess given as a pose PDF.
100  *
101  * \return A smart pointer to the output estimated pose PDF.
102  * \sa CICP
103  */
105  const mrpt::maps::CMetricMap* m1, const mrpt::maps::CMetricMap* m2,
106  const mrpt::poses::CPose3DPDFGaussian& initialEstimationPDF,
108  std::nullopt) = 0;
109 };
110 
111 } // namespace mrpt::slam
mrpt::poses::CPosePDF::Ptr Align(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose2D &grossEst, mrpt::optional_ref< TMetricMapAlignmentResult > outInfo=std::nullopt)
The method for aligning a pair of metric maps, for SE(2) relative poses.
virtual ~TMetricMapAlignmentResult()=default
std::optional< std::reference_wrapper< T > > optional_ref
Shorter name for std::optional<std::reference_wrapper<T>>
Definition: optional_ref.h:20
virtual mrpt::poses::CPose3DPDF::Ptr Align3DPDF(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose3DPDFGaussian &initialEstimationPDF, mrpt::optional_ref< TMetricMapAlignmentResult > outInfo=std::nullopt)=0
Used as base class for other result structures of each particular algorithm in CMetricMapsAlignmentAl...
Declares a class that represents a Probability Density function (PDF) of a 2D pose ...
Versatile class for consistent logging and management of output messages.
~CMetricMapsAlignmentAlgorithm() override=default
Dtor.
virtual mrpt::poses::CPosePDF::Ptr AlignPDF(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPosePDFGaussian &initialEstimationPDF, mrpt::optional_ref< TMetricMapAlignmentResult > outInfo=std::nullopt)=0
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Declares a virtual base class for all metric maps storage classes.
Definition: CMetricMap.h:52
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:39
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
A base class for any algorithm able of maps alignment.
mrpt::poses::CPose3DPDF::Ptr Align3D(const mrpt::maps::CMetricMap *m1, const mrpt::maps::CMetricMap *m2, const mrpt::poses::CPose3D &grossEst, mrpt::optional_ref< TMetricMapAlignmentResult > outInfo=std::nullopt)
COutputLogger()
Default class constructor.
Declares a class that represents a Probability Density function (PDF) of a 3D pose ...



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020