Main MRPT website > C++ reference for MRPT 1.5.7
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 href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
13  */
14 
15 #ifndef __CONSISTENCYTEST_H
16 #define __CONSISTENCYTEST_H
17 
18 #include <mrpt/config.h>
19 #if MRPT_HAS_PCL
20 
21 #include <mrpt/utils/types_math.h> // Eigen
23 #include <mrpt/pbmap/PbMap.h>
24 
25 namespace mrpt {
26 namespace pbmap {
27 
28  /*! This class computes the rigid transformation between two sets of matched planes,
29  * and provides a measure of their rigid adjustment
30  *
31  * \ingroup mrpt_pbmap_grp
32  */
34  {
35  public:
36 
37  /*!Constructor */
38  ConsistencyTest(PbMap &PBM_source, PbMap &PBM_target);
39 
40  // /**! Get diamond of points around the center. This is used to calculate 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 centroids of one set of planes into their
45  matched planes and returns the sum of cuadratic distances */
46  double calcAlignmentError( std::map<unsigned, unsigned> &matched_planes, Eigen::Matrix4f &rigidTransf );
47 
48  /*!Return an initial guess for the rigid transformation which aligns two matched places.
49  The translation is calculated from the planes centroids and the rotation from the alignment of the plane's normals.*/
50  Eigen::Matrix4f initPose( std::map<unsigned, unsigned> &matched_planes);
51  Eigen::Matrix4f estimatePose( std::map<unsigned, unsigned> &matched_planes ); // Weighted with the area
52  bool estimatePoseWithCovariance(std::map<unsigned, unsigned> &matched_planes, Eigen::Matrix4f &rigidTransf, Eigen::Matrix<float,6,6> &covarianceM);
53 
54  /*!Return an initial guess for the rigid transformation which aligns two matched places.
55  The translation is calculated from the planes centroids and the rotation from the alignment of the plane's normals.
56  A planar movement is assumed (wheeled robot)*/
57  Eigen::Matrix4f initPose2D( std::map<unsigned, unsigned> &matched_planes);
58 
59  /*!Return the estimated rigid transformation which aligns two matched subgraphs (i.e. neighborhoods of planes).
60  This function iteratively minimizes the alignment error of the matched planes wrt the rigid transformation.*/
61  Eigen::Matrix4f getRTwithModel( std::map<unsigned, unsigned> &matched_planes );
62 
63 
64 //Eigen::Matrix4f getAlignment( const mrpt::math::CMatrixFixedNumeric<float,3,8> &matched_planes );
65 
66 Eigen::Matrix4f estimatePoseRANSAC( std::map<unsigned, unsigned> &matched_planes );
67 
68  private:
69 
70  /*!One of the subgraphs matched by SubgraphMatcher.*/
72 
73  /*!The other subgraph matched by SubgraphMatcher.*/
75 
76  /*!List of pairs of matched planes from the PbMaps PBMSource with those from PBMTarget*/
77  std::map<unsigned, unsigned> matched_planes;
78 
79 //// Ransac functions to detect outliers in the plane matching
80 //void ransacPlaneAlignment_fit( const mrpt::math::CMatrixFloat &planeCorresp,
81 // const vector_size_t &useIndices,
82 //// vector< Eigen::Matrix4f > &fitModels );
83 // vector< mrpt::math::CMatrixFloat44 > &fitModels );
84 //
85 //void ransac3Dplane_distance( const mrpt::math::CMatrixFloat &planeCorresp,
86 // const vector< Eigen::Matrix4f > & testModels,
87 // const double distanceThreshold,
88 // unsigned int & out_bestModelIndex,
89 // vector_size_t & out_inlierIndices );
90 //
91 //bool ransac3Dplane_degenerate( const mrpt::math::CMatrixFloat &planeCorresp,
92 // const mrpt::vector_size_t &useIndices );
93 //
94 //void TestRANSAC();
95 
96  };
97 
98 } } // End of namespaces
99 
100 #endif
101 #endif
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::map< unsigned, unsigned > matched_planes
A class used to store a Plane-based Map (PbMap).
Definition: pbmap/PbMap.h:45



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019