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