Main MRPT website > C++ reference for MRPT 1.9.9
CLandmark.cpp
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 
10 #include "vision-precomp.h" // Precompiled headers
11 
13 #include <mrpt/maps/CLandmark.h>
14 #include <mrpt/obs/CObservation.h>
16 
17 using namespace mrpt::obs;
18 using namespace mrpt::maps;
19 using namespace mrpt::poses;
20 
22 
23 // Initialization:
24 CLandmark::TLandmarkID CLandmark::m_counterIDs =
25  static_cast<CLandmark::TLandmarkID>(0);
26 
27 /*---------------------------------------------------------------
28  Default constructor
29  ---------------------------------------------------------------*/
30 CLandmark::CLandmark()
31  : features(),
32  pose_mean(),
33  normal(),
34  pose_cov_11(),
35  pose_cov_22(),
36  pose_cov_33(),
37  pose_cov_12(),
38  pose_cov_13(),
39  pose_cov_23(),
41  timestampLastSeen(INVALID_TIMESTAMP),
42  seenTimesCount(0)
43 {
44 }
45 
46 /*---------------------------------------------------------------
47  Destructor
48  ---------------------------------------------------------------*/
50 /*---------------------------------------------------------------
51  Destructor
52  ---------------------------------------------------------------*/
54 {
55  pose.mean.x(pose_mean.x);
56  pose.mean.y(pose_mean.y);
57  pose.mean.z(pose_mean.z);
58 
59  pose.cov(0, 0) = pose_cov_11;
60  pose.cov(1, 1) = pose_cov_22;
61  pose.cov(2, 2) = pose_cov_33;
62 
63  pose.cov(0, 1) = pose.cov(1, 0) = pose_cov_12;
64  pose.cov(0, 2) = pose.cov(2, 0) = pose_cov_13;
65 
66  pose.cov(1, 2) = pose.cov(2, 1) = pose_cov_23;
67 }
68 
69 /*---------------------------------------------------------------
70  Destructor
71  ---------------------------------------------------------------*/
73 {
74  pose_mean.x = pose.mean.x();
75  pose_mean.y = pose.mean.y();
76  pose_mean.z = pose.mean.z();
77 
78  pose_cov_11 = pose.cov(0, 0);
79  pose_cov_22 = pose.cov(1, 1);
80  pose_cov_33 = pose.cov(2, 2);
81  pose_cov_12 = pose.cov(0, 1);
82  pose_cov_13 = pose.cov(0, 2);
83  pose_cov_23 = pose.cov(1, 2);
84 }
85 
88 {
92 }
93 
96 {
97  switch (version)
98  {
99  case 0:
100  case 1:
101  case 2:
102  case 3:
104  "Importing from this old version is not implemented");
105  break;
106  case 4:
107  {
108  in >> features >> pose_mean >> normal >> pose_cov_11 >>
111  }
112  break;
113  default:
115  };
116 }
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: CLandmark.cpp:87
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
std::vector< mrpt::vision::CFeature::Ptr > features
The set of features from which the landmark comes.
Definition: CLandmark.h:44
#define THROW_EXCEPTION(msg)
Definition: exceptions.h:41
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
CPoint3D mean
The mean value.
unsigned char uint8_t
Definition: rptypes.h:41
int64_t TLandmarkID
The type for the IDs of landmarks.
Definition: CLandmark.h:41
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:90
void setPose(const mrpt::poses::CPointPDFGaussian &p)
Sets the pose from an object:
Definition: CLandmark.cpp:72
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Definition: CLandmark.cpp:94
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
This namespace contains representation of robot actions and observations.
double x
X,Y,Z coordinates.
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
Definition: CLandmark.cpp:53
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
Definition: CLandmark.cpp:86
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
Definition: CLandmark.h:77
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
Definition: datetime.h:15
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
Definition: CLandmark.h:35
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
virtual ~CLandmark()
Virtual destructor.
Definition: CLandmark.cpp:49
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e.
Definition: CLandmark.h:50
GLuint in
Definition: glext.h:7274
#define INVALID_LANDMARK_ID
Used for CObservationBearingRange::TMeasurement::beaconID and others.
Definition: CObservation.h:27
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
Definition: CLandmark.h:47
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: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019