Main MRPT website > C++ reference for 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-2017, 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/utils/types_math.h> // Eigen
23 #include <mrpt/pbmap/PbMap.h>
24 
25 namespace mrpt
26 {
27 namespace pbmap
28 {
29 /*! This class computes the rigid transformation between two sets of matched
30  * planes,
31  * and provides a measure of their rigid adjustment
32  *
33  * \ingroup mrpt_pbmap_grp
34  */
36 {
37  public:
38  /*!Constructor */
39  ConsistencyTest(PbMap& PBM_source, PbMap& PBM_target);
40 
41  // /**! Get diamond of points around the center. This is used to calculate
42  // the adjustment error with a model plane */
43  // void calcDiamondPlane(Plane& plane);
44 
45  /*!Calculate the alignment error between two sets of matched planes.
46  The input rigid transformation "se3rigidTransfInv" is used to project the
47  centroids of one set of planes into their
48  matched planes and returns the sum of cuadratic distances */
49  double calcAlignmentError(
50  std::map<unsigned, unsigned>& matched_planes,
51  Eigen::Matrix4f& rigidTransf);
52 
53  /*!Return an initial guess for the rigid transformation which aligns two
54  matched places.
55  The translation is calculated from the planes centroids and the rotation
56  from the alignment of the plane's normals.*/
57  Eigen::Matrix4f initPose(std::map<unsigned, unsigned>& matched_planes);
58  Eigen::Matrix4f estimatePose(
59  std::map<unsigned, unsigned>&
60  matched_planes); // Weighted with the area
62  std::map<unsigned, unsigned>& matched_planes,
63  Eigen::Matrix4f& rigidTransf, Eigen::Matrix<float, 6, 6>& covarianceM);
64 
65  /*!Return an initial guess for the rigid transformation which aligns two
66  matched places.
67  The translation is calculated from the planes centroids and the rotation
68  from the alignment of the plane's normals.
69  A planar movement is assumed (wheeled robot)*/
70  Eigen::Matrix4f initPose2D(std::map<unsigned, unsigned>& matched_planes);
71 
72  /*!Return the estimated rigid transformation which aligns two matched
73  subgraphs (i.e. neighborhoods of planes).
74  This function iteratively minimizes the alignment error of the matched
75  planes wrt the rigid transformation.*/
76  Eigen::Matrix4f getRTwithModel(
77  std::map<unsigned, unsigned>& matched_planes);
78 
79  // Eigen::Matrix4f getAlignment( const
80  // mrpt::math::CMatrixFixedNumeric<float,3,8> &matched_planes );
81 
82  Eigen::Matrix4f estimatePoseRANSAC(
83  std::map<unsigned, unsigned>& matched_planes);
84 
85  private:
86  /*!One of the subgraphs matched by SubgraphMatcher.*/
88 
89  /*!The other subgraph matched by SubgraphMatcher.*/
91 
92  /*!List of pairs of matched planes from the PbMaps PBMSource with those from
93  * PBMTarget*/
94  std::map<unsigned, unsigned> matched_planes;
95 
96  //// Ransac functions to detect outliers in the plane matching
97  // void ransacPlaneAlignment_fit( const mrpt::math::CMatrixFloat
98  // &planeCorresp,
99  // const vector_size_t &useIndices,
100  //// vector< Eigen::Matrix4f > &fitModels );
101  // vector< mrpt::math::CMatrixFloat44 >
102  // &fitModels );
103  //
104  // void ransac3Dplane_distance( const mrpt::math::CMatrixFloat
105  // &planeCorresp,
106  // const vector< Eigen::Matrix4f > &
107  // testModels,
108  // const double distanceThreshold,
109  // unsigned int & out_bestModelIndex,
110  // vector_size_t & out_inlierIndices );
111  //
112  // bool ransac3Dplane_degenerate( const mrpt::math::CMatrixFloat
113  // &planeCorresp,
114  // const mrpt::vector_size_t &useIndices );
115  //
116  // void TestRANSAC();
117 };
118 }
119 } // End of namespaces
120 
121 #endif
122 #endif
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)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
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:49
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: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019