Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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>
16#include <mrpt/poses/CPoint3D.h>
19
20namespace 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 */
64
67 getPose(pdf);
68 p = pdf.mean;
70 }
71
72 /** Sets the pose from an object:
73 */
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 */
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
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
int64_t TLandmarkID
The type for the IDs of landmarks.
void getPose(mrpt::poses::CPoint3D &p, mrpt::math::CMatrixDouble &COV) const
void createOneFeature()
Creates one feature in the vector "features", calling the appropriate constructor of the smart pointe...
uint32_t seenTimesCount
The number of times that this landmark has been seen.
TLandmarkID ID
An ID for the landmark (see details next...) This ID was introduced in the version 3 of this class (2...
virtual ~CLandmark()
Virtual destructor.
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e. a unitary 3D vector towards the viewing direction,...
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
mrpt::vision::TFeatureType getType() const
Gets the type of the first feature in its feature vector.
void setPose(const mrpt::poses::CPointPDFGaussian &p)
Sets the pose from an object:
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
std::vector< mrpt::vision::CFeaturePtr > features
The set of features from which the landmark comes.
CLandmark()
Default constructor.
static TLandmarkID m_counterIDs
Auxiliary variable.
A class used to store a 3D point.
Definition: CPoint3D.h:33
A gaussian distribution for 3D points.
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
CPoint3D mean
The mean value.
A generic 2D feature from an image, extracted with CFeatureExtraction Each feature may have one or mo...
Definition: CFeature.h:54
TFeatureType
Types of features - This means that the point has been detected with this algorithm,...
struct VISION_IMPEXP CFeaturePtr
Definition: CFeature.h:44
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:30
#define ASSERT_(f)
Definition: mrpt_macros.h:261
CMatrixTemplateNumeric< double > CMatrixDouble
Declares a matrix of double numbers (non serializable).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned long uint32_t
Definition: pstdint.h:216
Lightweight 3D point.



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Tue Jan 17 22:40:29 UTC 2023