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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020