Main MRPT website > C++ reference for MRPT 1.9.9
CObservationReflectivity.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 "obs-precomp.h" // Precompiled headers
11 
14 
15 using namespace mrpt::obs;
16 using namespace mrpt::poses;
17 
18 // This must be added to any CSerializable class implementation file.
20 
21 uint8_t CObservationReflectivity::serializeGetVersion() const { return 1; }
24 {
25  out << reflectivityLevel << channel << sensorPose;
26  out << sensorLabel << timestamp;
27 }
28 
31 {
32  switch (version)
33  {
34  case 0:
35  case 1:
36  {
37  in >> reflectivityLevel;
38  if (version >= 1) in >> channel;
39  in >> sensorPose;
40  in >> sensorLabel >> timestamp;
41  }
42  break;
43  default:
45  };
46 }
47 
49 {
51 
52  o << "reflectivityLevel=" << reflectivityLevel << std::endl;
53  o << "channel=" << channel << " (-1=any)" << std::endl;
54 }
mrpt::obs::CObservationReflectivity
Declares a class derived from "CObservation" that encapsules a single short-range reflectivity measur...
Definition: CObservationReflectivity.h:27
mrpt::obs::CObservationReflectivity::getDescriptionAsText
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Definition: CObservationReflectivity.cpp:48
obs-precomp.h
mrpt::obs::CObservationReflectivity::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: CObservationReflectivity.cpp:22
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::poses
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CHierarchicalMapMHPartition.h:25
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::obs::CObservation::getDescriptionAsText
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Definition: CObservation.cpp:44
IMPLEMENTS_SERIALIZABLE
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
Definition: CSerializable.h:114
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
in
GLuint in
Definition: glext.h:7274
CObservationReflectivity.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::obs::CObservationReflectivity::serializeFrom
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Definition: CObservationReflectivity.cpp:29



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