Main MRPT website > C++ reference for MRPT 1.9.9
CObservationRobotPose.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-2017, 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 
12 #include <mrpt/utils/CStream.h>
14 #include <mrpt/system/os.h>
16 
17 using namespace mrpt::obs;
18 using namespace mrpt::utils;
19 using namespace mrpt::poses;
20 
21 // This must be added to any CSerializable class implementation file.
23 
24 /** Default constructor */
26 /*---------------------------------------------------------------
27  Implements the writing to a CStream capability of CSerializable objects
28  ---------------------------------------------------------------*/
30  mrpt::utils::CStream& out, int* version) const
31 {
32  if (version)
33  *version = 0;
34  else
35  {
36  out << pose;
37  out << sensorLabel << timestamp;
38  }
39 }
40 
41 /*---------------------------------------------------------------
42  Implements the reading from a CStream capability of CSerializable objects
43  ---------------------------------------------------------------*/
45  mrpt::utils::CStream& in, int version)
46 {
47  switch (version)
48  {
49  case 0:
50  {
51  in >> pose;
52  in >> sensorLabel >> timestamp;
53  }
54  break;
55  default:
57  };
58 }
59 
60 void CObservationRobotPose::getSensorPose(CPose3D& out_sensorPose) const
61 {
62  out_sensorPose = sensorPose;
63 }
64 
66 {
67  sensorPose = newSensorPose;
68 }
69 
71 {
72  using namespace std;
74 
75  o << "Sensor pose: " << sensorPose << endl;
76  o << "Pose: " << pose.asString() << endl;
77 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
An observation providing an alternative robot pose from an external source.
STL namespace.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
This file implements matrix/vector text and binary serialization.
GLuint in
Definition: glext.h:7274
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019