MRPT  1.9.9
CLandmark.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/math/CMatrixF.h>
12 #include <mrpt/math/TPoint3D.h>
13 #include <mrpt/obs/CObservation.h> // INVALID_LANDMARK_ID
14 #include <mrpt/poses/CPoint3D.h>
17 #include <mrpt/system/datetime.h>
18 #include <mrpt/vision/CFeature.h>
19 
20 #include <memory>
21 
22 namespace mrpt::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> 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 
77  /** The last time that this landmark was observed. */
79 
80  /** The number of times that this landmark has been seen. */
82 
83  /** Returns the pose as an object:
84  */
86 
88  {
90  getPose(pdf);
91  p = pdf.mean;
92  COV = mrpt::math::CMatrixDouble(pdf.cov);
93  }
94 
95  /** Sets the pose from an object:
96  */
98 
99  /** Gets the type of the first feature in its feature vector. The vector
100  * must not be empty.
101  */
103  {
104  ASSERT_(!features.empty());
105  return features[0].type;
106  }
107 
108  /** Creates one feature in the vector "features", calling the appropriate
109  * constructor of the smart pointer, so after calling this method
110  * "features[0]" is a valid pointer to a CFeature object.
111  */
112  void createOneFeature() { features.resize(1); }
113 
114  /** Default constructor */
115  CLandmark() = default;
116 
117  /** Virtual destructor */
118  ~CLandmark() override;
119 
120  protected:
121  /** Auxiliary variable
122  */
124 
125 }; // End of class definition
126 
127 } // namespace mrpt::maps
mrpt::vision::TKeyPointMethod getType() const
Gets the type of the first feature in its feature vector.
Definition: CLandmark.h:102
static TLandmarkID m_counterIDs
Auxiliary variable.
Definition: CLandmark.h:123
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
Definition: CLandmark.h:112
CPoint3D mean
The mean value.
int64_t TLandmarkID
The type for the IDs of landmarks.
Definition: CLandmark.h:41
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
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:51
__int64 int64_t
Definition: rptypes.h:52
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
TKeyPointMethod
Types of key point detectors.
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
Definition: CLandmark.cpp:32
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:78
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...
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:87
std::vector< mrpt::vision::CFeature > 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:30
#define INVALID_LANDMARK_ID
Used for CObservationBearingRange::TMeasurement::beaconID and others.
Definition: CObservation.h:27
CLandmark()=default
Default constructor.
~CLandmark() override
Virtual destructor.
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
Definition: CLandmark.h:47
Lightweight 3D point.
Definition: TPoint3D.h:90
unsigned __int32 uint32_t
Definition: rptypes.h:50
GLfloat GLfloat p
Definition: glext.h:6398
uint32_t seenTimesCount
The number of times that this landmark has been seen.
Definition: CLandmark.h:81
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
Definition: datetime.h:43
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
CMatrixDynamic< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 8fe78517f Sun Jul 14 19:43:28 2019 +0200 at lun oct 28 02:10:00 CET 2019