MRPT  1.9.9
maps/src/maps/serializations_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #define MRPT_NO_WARN_BIG_HDR // Yes, we really want to include all classes.
11 #include <mrpt/maps.h>
14 
15 #include <CTraitsTest.h>
16 #include <gtest/gtest.h>
17 #include <mrpt/io/CMemoryStream.h>
19 
20 using namespace mrpt;
21 using namespace mrpt::maps;
22 using namespace mrpt::obs;
23 using namespace mrpt::io;
24 using namespace mrpt::serialization;
25 using namespace std;
26 
27 #define TEST_CLASS_MOVE_COPY_CTORS(_classname) \
28  template class mrpt::CTraitsTest<_classname>
29 
48 
49 // Create a set of classes, then serialize and deserialize to test possible
50 // bugs:
51 TEST(SerializeTestMaps, WriteReadToMem)
52 {
71 
72  for (auto& lstClasse : lstClasses)
73  {
74  try
75  {
76  CMemoryStream buf;
77  auto arch = mrpt::serialization::archiveFrom(buf);
78  {
80  lstClasse->createObject());
81  arch << *o;
82  o.reset();
83  }
84 
85  CSerializable::Ptr recons;
86  buf.Seek(0);
87  arch >> recons;
88  }
89  catch (const std::exception& e)
90  {
91  GTEST_FAIL() << "Exception during serialization test for class '"
92  << lstClasse->className << "':\n"
93  << e.what() << endl;
94  }
95  }
96 }
Digital Elevation Model (DEM), a mesh or grid representation of a surface which keeps the estimated h...
An observation from any sensor that can be summarized as a pointcloud.
A structure that holds runtime class type information.
Definition: CObject.h:31
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
STL namespace.
A 2D grid map representing the reflectivity of the environment (for example, measured with an IR prox...
#define TEST_CLASS_MOVE_COPY_CTORS(_classname)
CWirelessPowerGridMap2D represents a PDF of wifi concentrations over a 2D area.
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT&#39;s CStream, std::istream, std::ostream, std::stringstream.
Definition: CArchive.h:592
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
Definition: CObject.h:102
This CStream derived class allow using a memory buffer as a CStream.
A smart look-up-table (LUT) of sin/cos values for 2D laser scans.
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
This namespace contains representation of robot actions and observations.
A class for storing a map of 3D probabilistic beacons, using a Montecarlo, Gaussian, or Sum of Gaussians (SOG) representation (for range-only SLAM).
Definition: CBeaconMap.h:43
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
Definition: COctoMap.h:40
A map of 2D/3D points with individual colours (RGB).
A map of 3D points with reflectance/intensity (float).
A 3D occupancy grid map with a regular, even distribution of voxels.
A class for storing an occupancy grid map.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CRandomFieldGridMap3D represents a 3D regular grid where each voxel is associated one real-valued pro...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
static CAST_TO::Ptr from(const CAST_FROM_PTR &ptr)
Definition: CObject.h:356
const mrpt::rtti::TRuntimeClassId * lstClasses[]
CGasConcentrationGridMap2D represents a PDF of gas concentrations over a 2D area. ...
A CObservation-derived class for raw range data from a 2D or 3D rotating scanner. ...
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
TEST(SerializeTestMaps, WriteReadToMem)
The class for storing individual "beacon landmarks" under a variety of 3D position PDF distributions...
Definition: CBeacon.h:35



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020