Main MRPT website > C++ reference for MRPT 1.9.9
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 {
24 /** The class for storing "landmarks" (visual or laser-scan-extracted
25  * features,...)
26  *
27  * The descriptors for each kind of descriptor are stored in the vector
28  * "features", which
29  * will typically consists of only 1 element, or 2 elements for landmarks
30  * obtained from stereo images.
31  *
32  * \sa CLandmarksMap
33  * \ingroup mrpt_vision_grp
34  */
36 {
38 
39  public:
40  /** The type for the IDs of landmarks. */
42 
43  /** The set of features from which the landmark comes. */
44  std::vector<mrpt::vision::CFeature::Ptr> features;
45 
46  /** The mean of the landmark 3D position. */
48  /** The "normal" to the landmark, i.e. a unitary 3D vector towards the
49  * viewing direction, or a null vector if not applicable */
53 
54  /** An ID for the landmark (see details next...)
55  * This ID was introduced in the version 3 of this class (21/NOV/2006),
56  *and its aim is
57  * to provide a way for easily establishing correspondences between
58  *landmarks detected
59  * in sequential image frames. Thus, the management of this field should
60  *be:
61  * - In 'servers' (classes/modules/... that detect landmarks from
62  *images):
63  *A different ID must be assigned to every landmark (e.g. a sequential
64  *counter), BUT only in the case of being sure of the correspondence of one
65  *landmark with another one in the past (e.g. tracking).
66  * - In 'clients': This field can be ignored, but if it is used, the
67  *advantage is solving the correspondence between landmarks detected in
68  *consequentive instants of time: Two landmarks with the same ID
69  *<b>correspond</b> to the same physical feature, BUT it should not be
70  *expected the inverse to be always true.
71  *
72  * Note that this field is never fill out automatically, it must be set by
73  *the programmer if used.
74  */
76  /** The last time that this landmark was observed. */
78  /** The number of times that this landmark has been seen. */
80 
81  /** Returns the pose as an object:
82  */
84 
86  {
88  getPose(pdf);
89  p = pdf.mean;
90  COV = mrpt::math::CMatrixDouble(pdf.cov);
91  }
92 
93  /** Sets the pose from an object:
94  */
96 
97  /** Gets the type of the first feature in its feature vector. The vector
98  * must not be empty.
99  */
101  {
102  ASSERT_(!features.empty());
103  ASSERT_(features[0]) return features[0]->type;
104  }
105 
106  /** Creates one feature in the vector "features", calling the appropriate
107  * constructor of the smart pointer, so after calling this method
108  * "features[0]" is a valid pointer to a CFeature object.
109  */
111  {
112  features.assign(
114  }
115 
116  /** Default constructor
117  */
118  CLandmark();
119 
120  /** Virtual destructor
121  */
122  virtual ~CLandmark();
123 
124  protected:
125  /** Auxiliary variable
126  */
128 
129 }; // End of class definition
130 
131 } // End of namespace
132 } // End of namespace
133 
134 #endif
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:32
std::shared_ptr< CFeature > Ptr
Definition: CFeature.h:58
static TLandmarkID m_counterIDs
Auxiliary variable.
Definition: CLandmark.h:127
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
Definition: CLandmark.h:110
std::vector< mrpt::vision::CFeature::Ptr > features
The set of features from which the landmark comes.
Definition: CLandmark.h:44
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
CPoint3D mean
The mean value.
CLandmark()
Default constructor.
Definition: CLandmark.cpp:31
int64_t TLandmarkID
The type for the IDs of landmarks.
Definition: CLandmark.h:41
void setPose(const mrpt::poses::CPointPDFGaussian &p)
Sets the pose from an object:
Definition: CLandmark.cpp:73
__int64 int64_t
Definition: rptypes.h:49
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
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
Definition: CLandmark.cpp:54
A class used to store a 3D point.
Definition: CPoint3D.h:32
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
Definition: CLandmark.h:77
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,...)
Definition: CLandmark.h:35
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
virtual ~CLandmark()
Virtual destructor.
Definition: CLandmark.cpp:50
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e.
Definition: CLandmark.h:50
void getPose(mrpt::poses::CPoint3D &p, mrpt::math::CMatrixDouble &COV) const
Definition: CLandmark.h:85
mrpt::vision::TFeatureType getType() const
Gets the type of the first feature in its feature vector.
Definition: CLandmark.h:100
#define ASSERT_(f)
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
Definition: CLandmark.h:47
Lightweight 3D point.
unsigned __int32 uint32_t
Definition: rptypes.h:47
GLfloat GLfloat p
Definition: glext.h:6305
uint32_t seenTimesCount
The number of times that this landmark has been seen.
Definition: CLandmark.h:79
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...
Definition: CLandmark.h:75



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