Main MRPT website > C++ reference for MRPT 1.9.9
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(), landmarks()
26 {
27 }
28 
29 /*---------------------------------------------------------------
30  Implements the writing to a CStream capability of CSerializable objects
31  ---------------------------------------------------------------*/
33  mrpt::utils::CStream& out, int* version) const
34 {
35  if (version)
36  *version = 1;
37  else
38  {
39  out << refCameraPose << timestamp
40  // The landmarks:
41  << landmarks << sensorLabel;
42  }
43 }
44 
45 /*---------------------------------------------------------------
46  Implements the reading from a CStream capability of CSerializable objects
47  ---------------------------------------------------------------*/
49  mrpt::utils::CStream& in, int version)
50 {
51  switch (version)
52  {
53  case 0:
54  case 1:
55  {
56  in >> refCameraPose >> timestamp
57 
58  // The landmarks:
59  >> landmarks;
60 
61  if (version > 0)
62  in >> sensorLabel;
63  else
64  sensorLabel = "";
65  }
66  break;
67  default:
69  };
70 }
71 
72 /*---------------------------------------------------------------
73  Inserts a pure virtual method for finding the likelihood between this
74  and another observation, probably only of the same derived class. The
75  operator
76  may be asymmetric.
77 
78  \param anotherObs The other observation to compute likelihood with.
79  \param anotherObsPose If known, the belief about the robot pose when the other
80  observation was taken can be supplied here, or nullptr if it is unknown.
81 
82  \return Returns a likelihood measurement, in the range [0,1].
83  \exception std::exception On any error, as another observation being of an
84  invalid class.
85  ---------------------------------------------------------------*/
87  const CObservation* anotherObs, const CPosePDF* anotherObsPose) const
88 {
89  MRPT_UNUSED_PARAM(anotherObs);
90  MRPT_UNUSED_PARAM(anotherObsPose);
91  return 0;
92 }
93 
95 {
97 }
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.
Declares a class derived from "CObservation" that stores a Landmarks Map as seen from a stereo camera...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:41
float likelihoodWith(const mrpt::obs::CObservation *anotherObs, const mrpt::poses::CPosePDF *anotherObsPose=nullptr) const
Implements the virtual method in charge of finding the likelihood between this and another observatio...
#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.
Declares a class that represents a probability density function (pdf) of a 2D pose (x...
Definition: CPosePDF.h:41
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CPoint.h:17
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...
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
GLuint in
Definition: glext.h:7274
void getDescriptionAsText(std::ostream &o) const 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.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019