Main MRPT website > C++ reference
MRPT logo
CLandmark.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-2014, 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 #ifndef CLandmark_H
10 #define CLandmark_H
11 
13 #include <mrpt/math/CMatrix.h>
14 //#include <mrpt/system/os.h>
15 #include <mrpt/system/datetime.h>
17 #include <mrpt/poses/CPoint3D.h>
18 #include <mrpt/vision/CFeature.h>
20 
21 
22 namespace mrpt
23 {
24  /** \ingroup mrpt_vision_grp */
25  namespace slam
26  {
27  using namespace mrpt::poses;
28  using namespace mrpt::vision;
29  using namespace mrpt::math;
30 
32 
33  /** The class for storing "landmarks" (visual or laser-scan-extracted features,...)
34  *
35  * The descriptors for each kind of descriptor are stored in the vector "features", which
36  * will typically consists of only 1 element, or 2 elements for landmarks obtained from stereo images.
37  *
38  * \sa CLandmarksMap
39  * \ingroup mrpt_vision_grp
40  */
41  class VISION_IMPEXP CLandmark : public mrpt::utils::CSerializable
42  {
43  // This must be added to any CSerializable derived class:
45 
46  public:
47  typedef int64_t TLandmarkID; //!< The type for the IDs of landmarks.
48 
49  std::vector<CFeaturePtr> features; //!< The set of features from which the landmark comes.
50 
51  TPoint3D pose_mean; //!< The mean of the landmark 3D position.
52  TPoint3D normal; //!< The "normal" to the landmark, i.e. a unitary 3D vector towards the viewing direction, or a null vector if not applicable
53  float pose_cov_11,pose_cov_22,pose_cov_33,pose_cov_12,pose_cov_13,pose_cov_23;
54 
55  /** An ID for the landmark (see details next...)
56  * This ID was introduced in the version 3 of this class (21/NOV/2006), and its aim is
57  * to provide a way for easily establishing correspondences between landmarks detected
58  * in sequential image frames. Thus, the management of this field should be:
59  * - In 'servers' (classes/modules/... that detect landmarks from images): A different ID must be assigned to every landmark (e.g. a sequential counter), BUT only in the case of being sure of the correspondence of one landmark with another one in the past (e.g. tracking).
60  * - In 'clients': This field can be ignored, but if it is used, the advantage is solving the correspondence between landmarks detected in consequentive instants of time: Two landmarks with the same ID <b>correspond</b> to the same physical feature, BUT it should not be expected the inverse to be always true.
61  *
62  * Note that this field is never fill out automatically, it must be set by the programmer if used.
63  */
64  TLandmarkID ID;
65  mrpt::system::TTimeStamp timestampLastSeen; //!< The last time that this landmark was observed.
66  uint32_t seenTimesCount; //!< The number of times that this landmark has been seen.
67 
68  /** Returns the pose as an object:
69  */
70  void getPose( CPointPDFGaussian &p ) const;
71 
72  void getPose( CPoint3D &p, CMatrixDouble &COV ) const {
74  getPose(pdf);
75  p = pdf.mean;
76  COV = CMatrixDouble(pdf.cov);
77  }
78 
79  /** Sets the pose from an object:
80  */
81  void setPose( const CPointPDFGaussian &p );
82 
83  /** Gets the type of the first feature in its feature vector. The vector must not be empty.
84  */
86  { ASSERT_( !features.empty() ); ASSERT_(features[0].present()) return features[0]->type; }
87 
88  /** Creates one feature in the vector "features", calling the appropriate constructor of the smart pointer, so after calling this method "features[0]" is a valid pointer to a CFeature object.
89  */
91  { features.assign(1, CFeaturePtr( new CFeature() ) ); }
92 
93  /** Default constructor
94  */
95  CLandmark();
96 
97  /** Virtual destructor
98  */
99  virtual ~CLandmark();
100 
101  protected:
102  /** Auxiliary variable
103  */
105 
106  }; // End of class definition
108 
109  } // End of namespace
110 } // End of namespace
111 
112 #endif
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:30
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:35
CPoint3D mean
The mean value.
STL namespace.
This base provides a set of functions for maths stuff.
Definition: CArray.h:18
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
int64_t TLandmarkID
The type for the IDs of landmarks.
Definition: CLandmark.h:47
Classes for computer vision, detectors, features, etc.
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
Definition: CFeature.h:57
TFeatureType getType() const
Gets the type of the first feature in its feature vector.
Definition: CLandmark.h:85
static TLandmarkID m_counterIDs
Auxiliary variable.
Definition: CLandmark.h:104
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
Definition: CLandmark.h:41
A class used to store a 3D point.
Definition: CPoint3D.h:32
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
Definition: CLandmark.h:90
TFeatureType
Types of features - This means that the point has been detected with this algorithm, which is independent of additional descriptors a feature may also have.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define ASSERT_(f)
Lightweight 3D point.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
A gaussian distribution for 3D points.



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014