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 }
mrpt::maps::CLandmark::ID
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
mrpt::poses::CPointPDFGaussian::cov
mrpt::math::CMatrixDouble33 cov
The 3x3 covariance matrix.
Definition: CPointPDFGaussian.h:46
INVALID_LANDMARK_ID
#define INVALID_LANDMARK_ID
Used for CObservationBearingRange::TMeasurement::beaconID and others.
Definition: CObservation.h:27
mrpt::maps::CLandmark::TLandmarkID
int64_t TLandmarkID
The type for the IDs of landmarks.
Definition: CLandmark.h:41
mrpt::maps::CLandmark::seenTimesCount
uint32_t seenTimesCount
The number of times that this landmark has been seen.
Definition: CLandmark.h:79
mrpt::poses::CPointPDFGaussian
A gaussian distribution for 3D points.
Definition: CPointPDFGaussian.h:25
mrpt::maps::CLandmark::getPose
void getPose(mrpt::poses::CPointPDFGaussian &p) const
Returns the pose as an object:
Definition: CLandmark.cpp:53
mrpt::maps::CLandmark::serializeFrom
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
INVALID_TIMESTAMP
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable.
Definition: datetime.h:15
mrpt::math::TPoint3D::z
double z
Definition: lightweight_geom_data.h:385
stl_serialization.h
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::maps::CLandmark::features
std::vector< mrpt::vision::CFeature::Ptr > features
The set of features from which the landmark comes.
Definition: CLandmark.h:44
THROW_EXCEPTION
#define THROW_EXCEPTION(msg)
Definition: exceptions.h:41
mrpt::poses
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CHierarchicalMapMHPartition.h:25
vision-precomp.h
mrpt::maps::CLandmark::pose_cov_12
float pose_cov_12
Definition: CLandmark.h:51
mrpt::maps::CLandmark::pose_cov_13
float pose_cov_13
Definition: CLandmark.h:51
mrpt::maps::CLandmark::pose_cov_22
float pose_cov_22
Definition: CLandmark.h:51
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:17
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
mrpt::poses::CPoseOrPoint::y
double y() const
Definition: CPoseOrPoint.h:144
mrpt::maps::CLandmark
The class for storing "landmarks" (visual or laser-scan-extracted features,...)
Definition: CLandmark.h:35
mrpt::poses::CPoseOrPoint::x
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
mrpt::math::TPoint3D::x
double x
X,Y,Z coordinates.
Definition: lightweight_geom_data.h:385
mrpt::maps::CLandmark::pose_mean
mrpt::math::TPoint3D pose_mean
The mean of the landmark 3D position.
Definition: CLandmark.h:47
IMPLEMENTS_SERIALIZABLE
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
Definition: CSerializable.h:114
mrpt::maps::CLandmark::normal
mrpt::math::TPoint3D normal
The "normal" to the landmark, i.e.
Definition: CLandmark.h:50
mrpt::math::TPoint3D::y
double y
Definition: lightweight_geom_data.h:385
mrpt::maps::CLandmark::pose_cov_33
float pose_cov_33
Definition: CLandmark.h:51
CObservation.h
mrpt::maps::CLandmark::serializeGetVersion
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
Definition: CLandmark.cpp:86
mrpt::maps::CLandmark::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: CLandmark.cpp:87
mrpt::maps::CLandmark::~CLandmark
virtual ~CLandmark()
Virtual destructor.
Definition: CLandmark.cpp:49
in
GLuint in
Definition: glext.h:7274
mrpt::maps
Definition: CBeacon.h:24
CLandmark.h
CArchive.h
MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:90
mrpt::maps::CLandmark::pose_cov_11
float pose_cov_11
Definition: CLandmark.h:51
mrpt::poses::CPointPDFGaussian::mean
CPoint3D mean
The mean value.
Definition: CPointPDFGaussian.h:44
mrpt::maps::CLandmark::timestampLastSeen
mrpt::system::TTimeStamp timestampLastSeen
The last time that this landmark was observed.
Definition: CLandmark.h:77
mrpt::maps::CLandmark::pose_cov_23
float pose_cov_23
Definition: CLandmark.h:52
mrpt::maps::CLandmark::setPose
void setPose(const mrpt::poses::CPointPDFGaussian &p)
Sets the pose from an object:
Definition: CLandmark.cpp:72



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST