Main MRPT website > C++ reference for MRPT 1.5.6
maps/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-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 #ifndef CLandmark_H
10 #define CLandmark_H
11 
13 #include <mrpt/math/CMatrix.h>
14 #include <mrpt/system/datetime.h>
16 #include <mrpt/poses/CPoint3D.h>
17 #include <mrpt/vision/CFeature.h>
19 
20 namespace mrpt
21 {
22  namespace maps
23  {
25 
26  /** The class for storing "landmarks" (visual or laser-scan-extracted features,...)
27  *
28  * The descriptors for each kind of descriptor are stored in the vector "features", which
29  * will typically consists of only 1 element, or 2 elements for landmarks obtained from stereo images.
30  *
31  * \sa CLandmarksMap
32  * \ingroup mrpt_vision_grp
33  */
34  class VISION_IMPEXP CLandmark : public mrpt::utils::CSerializable
35  {
36  // This must be added to any CSerializable derived class:
38 
39  public:
40  typedef int64_t TLandmarkID; //!< The type for the IDs of landmarks.
41 
42  std::vector<mrpt::vision::CFeaturePtr> features; //!< The set of features from which the landmark comes.
43 
44  mrpt::math::TPoint3D pose_mean; //!< The mean of the landmark 3D position.
45  mrpt::math::TPoint3D normal; //!< The "normal" to the landmark, i.e. a unitary 3D vector towards the viewing direction, or a null vector if not applicable
46  float pose_cov_11,pose_cov_22,pose_cov_33,pose_cov_12,pose_cov_13,pose_cov_23;
47 
48  /** An ID for the landmark (see details next...)
49  * This ID was introduced in the version 3 of this class (21/NOV/2006), and its aim is
50  * to provide a way for easily establishing correspondences between landmarks detected
51  * in sequential image frames. Thus, the management of this field should be:
52  * - 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).
53  * - 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.
54  *
55  * Note that this field is never fill out automatically, it must be set by the programmer if used.
56  */
58  mrpt::system::TTimeStamp timestampLastSeen; //!< The last time that this landmark was observed.
59  uint32_t seenTimesCount; //!< The number of times that this landmark has been seen.
60 
61  /** Returns the pose as an object:
62  */
63  void getPose( mrpt::poses::CPointPDFGaussian &p ) const;
64 
67  getPose(pdf);
68  p = pdf.mean;
69  COV = mrpt::math::CMatrixDouble(pdf.cov);
70  }
71 
72  /** Sets the pose from an object:
73  */
74  void setPose( const mrpt::poses::CPointPDFGaussian &p );
75 
76  /** Gets the type of the first feature in its feature vector. The vector must not be empty.
77  */
79  { ASSERT_( !features.empty() ); ASSERT_(features[0].present()) return features[0]->type; }
80 
81  /** 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.
82  */
84  { features.assign(1, mrpt::vision::CFeaturePtr( new mrpt::vision::CFeature() ) ); }
85 
86  /** Default constructor
87  */
88  CLandmark();
89 
90  /** Virtual destructor
91  */
92  virtual ~CLandmark();
93 
94  protected:
95  /** Auxiliary variable
96  */
98 
99  }; // End of class definition
101 
102  } // End of namespace
103 } // End of namespace
104 
105 #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
static TLandmarkID m_counterIDs
Auxiliary variable.
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
mrpt::maps::CLandmark CLandmark
Backward compatible typedef.
CPoint3D mean
The mean value.
int64_t TLandmarkID
The type for the IDs of landmarks.
std::vector< mrpt::vision::CFeaturePtr > features
The set of features from which the landmark comes.
#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...
__int64 int64_t
Definition: rptypes.h:51
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
Definition: CFeature.h:53
A class used to store a 3D point.
Definition: CPoint3D.h:32
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
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.
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e. a unitary 3D vector towards the viewing direction, or a null vector if not applicable.
void getPose(mrpt::poses::CPoint3D &p, mrpt::math::CMatrixDouble &COV) const
mrpt::vision::TFeatureType getType() const
Gets the type of the first feature in its feature vector.
#define ASSERT_(f)
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
Lightweight 3D point.
unsigned __int32 uint32_t
Definition: rptypes.h:49
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
GLfloat GLfloat p
Definition: glext.h:5587
uint32_t seenTimesCount
The number of times that this landmark has been seen.
A gaussian distribution for 3D points.
TLandmarkID ID
An ID for the landmark (see details next...) This ID was introduced in the version 3 of this class (2...



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019