Main MRPT website > C++ reference for MRPT 1.5.7
CObservationVisualLandmarks.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 "vision-precomp.h" // Precompiled headers
11 
13 #include <mrpt/utils/CStream.h>
14 
15 using namespace mrpt::obs;
16 using namespace mrpt::utils;
17 using namespace mrpt::poses;
18 
19 // This must be added to any CSerializable class implementation file.
21 
22 /** Constructor
23  */
25  refCameraPose(),
26  landmarks()
27 {
28 }
29 
30 /*---------------------------------------------------------------
31  Implements the writing to a CStream capability of CSerializable objects
32  ---------------------------------------------------------------*/
34 {
35  if (version)
36  *version = 1;
37  else
38  {
39  out << refCameraPose
40  << timestamp
41  // The landmarks:
42  << landmarks
43  << sensorLabel;
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  case 1:
56  {
57  in >> refCameraPose
58  >> timestamp
59 
60  // The landmarks:
61  >> landmarks;
62 
63  if (version>0)
64  in >> sensorLabel;
65  else sensorLabel = "";
66 
67  } break;
68  default:
70 
71  };
72 
73 }
74 
75 /*---------------------------------------------------------------
76  Inserts a pure virtual method for finding the likelihood between this
77  and another observation, probably only of the same derived class. The operator
78  may be asymmetric.
79 
80  \param anotherObs The other observation to compute likelihood with.
81  \param anotherObsPose If known, the belief about the robot pose when the other observation was taken can be supplied here, or NULL if it is unknown.
82 
83  \return Returns a likelihood measurement, in the range [0,1].
84  \exception std::exception On any error, as another observation being of an invalid class.
85  ---------------------------------------------------------------*/
87  const CObservation *anotherObs,
88  const CPosePDF *anotherObsPose ) const
89 {
90  MRPT_UNUSED_PARAM(anotherObs); MRPT_UNUSED_PARAM(anotherObsPose);
91  return 0;
92 }
93 
95 {
97 
98 }
99 
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...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
Declares a class derived from "CObservation" that stores a Landmarks Map as seen from a stereo camera...
float likelihoodWith(const mrpt::obs::CObservation *anotherObs, const mrpt::poses::CPosePDF *anotherObsPose=NULL) const
Implements the virtual method in charge of finding the likelihood between this and another observatio...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
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...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
#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
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
Definition: CPosePDF.h:39
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.
Declares a class that represents any robot&#39;s observation.
GLuint in
Definition: glext.h:6301
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.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019