MRPT  1.9.9
ConsistencyTest.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /* Plane-based Map (PbMap) library
11  * Construction of plane-based maps and localization in it from RGBD Images.
12  * Writen by Eduardo Fernandez-Moral. See docs for <a
13  * href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
14  */
15 
16 #ifndef __CONSISTENCYTEST_H
17 #define __CONSISTENCYTEST_H
18 
19 #include <mrpt/config.h>
20 #if MRPT_HAS_PCL
21 
22 #include <mrpt/math/types_math.h> // Eigen
23 #include <mrpt/pbmap/PbMap.h>
24 
25 namespace mrpt::pbmap
26 {
27 /*! This class computes the rigid transformation between two sets of matched
28  * planes,
29  * and provides a measure of their rigid adjustment
30  *
31  * \ingroup mrpt_pbmap_grp
32  */
34 {
35  public:
36  /*!Constructor */
37  ConsistencyTest(PbMap& PBM_source, PbMap& PBM_target);
38 
39  // /**! Get diamond of points around the center. This is used to calculate
40  // the adjustment error with a model plane */
41  // void calcDiamondPlane(Plane& plane);
42 
43  /*!Calculate the alignment error between two sets of matched planes.
44  The input rigid transformation "se3rigidTransfInv" is used to project the
45  centroids of one set of planes into their
46  matched planes and returns the sum of cuadratic distances */
47  double calcAlignmentError(
48  std::map<unsigned, unsigned>& matched_planes,
49  Eigen::Matrix4f& rigidTransf);
50 
51  /*!Return an initial guess for the rigid transformation which aligns two
52  matched places.
53  The translation is calculated from the planes centroids and the rotation
54  from the alignment of the plane's normals.*/
55  Eigen::Matrix4f initPose(std::map<unsigned, unsigned>& matched_planes);
56  Eigen::Matrix4f estimatePose(
57  std::map<unsigned, unsigned>&
58  matched_planes); // Weighted with the area
60  std::map<unsigned, unsigned>& matched_planes,
61  Eigen::Matrix4f& rigidTransf, Eigen::Matrix<float, 6, 6>& covarianceM);
62 
63  /*!Return an initial guess for the rigid transformation which aligns two
64  matched places.
65  The translation is calculated from the planes centroids and the rotation
66  from the alignment of the plane's normals.
67  A planar movement is assumed (wheeled robot)*/
68  Eigen::Matrix4f initPose2D(std::map<unsigned, unsigned>& matched_planes);
69 
70  /*!Return the estimated rigid transformation which aligns two matched
71  subgraphs (i.e. neighborhoods of planes).
72  This function iteratively minimizes the alignment error of the matched
73  planes wrt the rigid transformation.*/
74  Eigen::Matrix4f getRTwithModel(
75  std::map<unsigned, unsigned>& matched_planes);
76 
77  // Eigen::Matrix4f getAlignment( const
78  // mrpt::math::CMatrixFixedNumeric<float,3,8> &matched_planes );
79 
80  Eigen::Matrix4f estimatePoseRANSAC(
81  std::map<unsigned, unsigned>& matched_planes);
82 
83  private:
84  /*!One of the subgraphs matched by SubgraphMatcher.*/
86 
87  /*!The other subgraph matched by SubgraphMatcher.*/
89 
90  /*!List of pairs of matched planes from the PbMaps PBMSource with those from
91  * PBMTarget*/
92  std::map<unsigned, unsigned> matched_planes;
93 
94  //// Ransac functions to detect outliers in the plane matching
95  // void ransacPlaneAlignment_fit( const mrpt::math::CMatrixFloat
96  // &planeCorresp,
97  // const std::vector<size_t> &useIndices,
98  //// vector< Eigen::Matrix4f > &fitModels );
99  // vector< mrpt::math::CMatrixFloat44 >
100  // &fitModels );
101  //
102  // void ransac3Dplane_distance( const mrpt::math::CMatrixFloat
103  // &planeCorresp,
104  // const vector< Eigen::Matrix4f > &
105  // testModels,
106  // const double distanceThreshold,
107  // unsigned int & out_bestModelIndex,
108  // std::vector<size_t> & out_inlierIndices );
109  //
110  // bool ransac3Dplane_degenerate( const mrpt::math::CMatrixFloat
111  // &planeCorresp,
112  // const std::vector<size_t> &useIndices );
113  //
114  // void TestRANSAC();
115 };
116 }
117 #endif
118 #endif
119 
120 
Eigen::Matrix4f estimatePose(std::map< unsigned, unsigned > &matched_planes)
Eigen::Matrix4f estimatePoseRANSAC(std::map< unsigned, unsigned > &matched_planes)
Eigen::Matrix4f initPose2D(std::map< unsigned, unsigned > &matched_planes)
ConsistencyTest(PbMap &PBM_source, PbMap &PBM_target)
double calcAlignmentError(std::map< unsigned, unsigned > &matched_planes, Eigen::Matrix4f &rigidTransf)
! Get diamond of points around the center.
Eigen::Matrix4f initPose(std::map< unsigned, unsigned > &matched_planes)
std::map< unsigned, unsigned > matched_planes
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:45
bool estimatePoseWithCovariance(std::map< unsigned, unsigned > &matched_planes, Eigen::Matrix4f &rigidTransf, Eigen::Matrix< float, 6, 6 > &covarianceM)
Eigen::Matrix4f getRTwithModel(std::map< unsigned, unsigned > &matched_planes)



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020