Main MRPT website > C++ reference for MRPT 1.9.9
COccupancyGridMap2D_io.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-2018, 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 "maps-precomp.h" // Precomp header
11 
12 #include <mrpt/system/os.h>
13 #include <mrpt/math/CMatrix.h>
16 #include <mrpt/core/round.h> // round()
18 #include <mrpt/random.h>
19 
20 using namespace mrpt;
21 using namespace mrpt::maps;
22 using namespace mrpt::tfest;
23 using namespace mrpt::math;
24 using namespace mrpt::obs;
25 using namespace mrpt::random;
26 using namespace mrpt::poses;
27 using namespace mrpt::img;
28 using namespace mrpt::system;
29 using namespace std;
30 
31 /*---------------------------------------------------------------
32  saveAsBitmapFile
33  ---------------------------------------------------------------*/
35 {
37 
38  CImage img;
39  getAsImage(img);
40  return img.saveToFile(file);
41 
42  MRPT_END
43 }
44 
47 {
48 // Version 3: Change to log-odds. The only change is in the loader, when
49 // translating
50 // from older versions.
51 
52 // Version 2: Save OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS/16BITS
53 #ifdef OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS
54  out << uint8_t(8);
55 #else
56  out << uint8_t(16);
57 #endif
58 
59  out << size_x << size_y << x_min << x_max << y_min << y_max << resolution;
60  ASSERT_(size_x * size_y == map.size());
61 
62 #ifdef OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS
63  out.WriteBuffer(&map[0], sizeof(map[0]) * size_x * size_y);
64 #else
65  out.WriteBufferFixEndianness(&map[0], size_x * size_y);
66 #endif
67 
68  // insertionOptions:
69  out << insertionOptions.mapAltitude << insertionOptions.useMapAltitude
70  << insertionOptions.maxDistanceInsertion
71  << insertionOptions.maxOccupancyUpdateCertainty
72  << insertionOptions.considerInvalidRangesAsFreeSpace
73  << insertionOptions.decimation << insertionOptions.horizontalTolerance;
74 
75  // Likelihood:
76  out << (int32_t)likelihoodOptions.likelihoodMethod
77  << likelihoodOptions.LF_stdHit << likelihoodOptions.LF_zHit
78  << likelihoodOptions.LF_zRandom << likelihoodOptions.LF_maxRange
79  << likelihoodOptions.LF_decimation
80  << likelihoodOptions.LF_maxCorrsDistance
81  << likelihoodOptions.LF_alternateAverageMethod
82  << likelihoodOptions.MI_exponent << likelihoodOptions.MI_skip_rays
83  << likelihoodOptions.MI_ratio_max_distance
84  << likelihoodOptions.rayTracing_useDistanceFilter
85  << likelihoodOptions.rayTracing_decimation
86  << likelihoodOptions.rayTracing_stdHit
87  << likelihoodOptions.consensus_takeEachRange
88  << likelihoodOptions.consensus_pow << likelihoodOptions.OWA_weights
89  << likelihoodOptions.enableLikelihoodCache;
90 
91  // Insertion as 3D:
92  out << genericMapParams; // v6
93 
94  // Version 4:
95  out << insertionOptions.CFD_features_gaussian_size
96  << insertionOptions.CFD_features_median_size;
97 
98  // Version: 5;
99  out << insertionOptions.wideningBeamsWithDistance;
100 }
101 
104 {
105  m_is_empty = false;
106 
107  switch (version)
108  {
109  case 0:
110  case 1:
111  case 2:
112  case 3:
113  case 4:
114  case 5:
115  case 6:
116  {
117 #ifdef OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS
118  const uint8_t MyBitsPerCell = 8;
119 #else
120  const uint8_t MyBitsPerCell = 16;
121 #endif
122 
123  uint8_t bitsPerCellStream;
124 
125  // Version 2: OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS/16BITS
126  if (version >= 2)
127  in >> bitsPerCellStream;
128  else
129  bitsPerCellStream =
130  MyBitsPerCell; // Old versinons: hope it's the same...
131 
132  uint32_t new_size_x, new_size_y;
133  float new_x_min, new_x_max, new_y_min, new_y_max;
134  float new_resolution;
135 
136  // resetFeaturesCache();
137 
138  in >> new_size_x >> new_size_y >> new_x_min >> new_x_max >>
139  new_y_min >> new_y_max >> new_resolution;
140 
141  setSize(
142  new_x_min, new_x_max, new_y_min, new_y_max, new_resolution,
143  0.5);
144 
145  ASSERT_(size_x * size_y == map.size());
146 
147  if (bitsPerCellStream == MyBitsPerCell)
148  {
149 // Perfect:
150 #ifdef OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS
151  in.ReadBuffer(&map[0], sizeof(map[0]) * map.size());
152 #else
153  in.ReadBufferFixEndianness(&map[0], map.size());
154 #endif
155  }
156  else
157  {
158 // We must do a conversion...
159 #ifdef OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS
160  // We are 8-bit, stream is 16-bit
161  ASSERT_(bitsPerCellStream == 16);
162  std::vector<uint16_t> auxMap(map.size());
163  in.ReadBuffer(&auxMap[0], sizeof(auxMap[0]) * auxMap.size());
164 
165  size_t i, N = map.size();
166  uint8_t* ptrTrg = (uint8_t*)&map[0];
167  const uint16_t* ptrSrc = (const uint16_t*)&auxMap[0];
168  for (i = 0; i < N; i++) *ptrTrg++ = (*ptrSrc++) >> 8;
169 #else
170  // We are 16-bit, stream is 8-bit
171  ASSERT_(bitsPerCellStream == 8);
172  std::vector<uint8_t> auxMap(map.size());
173  in.ReadBuffer(&auxMap[0], sizeof(auxMap[0]) * auxMap.size());
174 
175  size_t i, N = map.size();
176  uint16_t* ptrTrg = (uint16_t*)&map[0];
177  const uint8_t* ptrSrc = (const uint8_t*)&auxMap[0];
178  for (i = 0; i < N; i++) *ptrTrg++ = (*ptrSrc++) << 8;
179 #endif
180  }
181 
182  // If we are converting an old dump, convert from probabilities to
183  // log-odds:
184  if (version < 3)
185  {
186  size_t i, N = map.size();
187  cellType* ptr = &map[0];
188  for (i = 0; i < N; i++)
189  {
190  double p = cellTypeUnsigned(*ptr) * (1.0f / 0xFF);
191  if (p < 0) p = 0;
192  if (p > 1) p = 1;
193  *ptr++ = p2l(p);
194  }
195  }
196 
197  // For the precomputed likelihood trick:
198  precomputedLikelihoodToBeRecomputed = true;
199 
200  if (version >= 1)
201  {
202  // insertionOptions:
203  in >> insertionOptions.mapAltitude >>
204  insertionOptions.useMapAltitude >>
205  insertionOptions.maxDistanceInsertion >>
206  insertionOptions.maxOccupancyUpdateCertainty >>
207  insertionOptions.considerInvalidRangesAsFreeSpace >>
208  insertionOptions.decimation >>
209  insertionOptions.horizontalTolerance;
210 
211  // Likelihood:
212  int32_t i;
213  in >> i;
214  likelihoodOptions.likelihoodMethod =
215  static_cast<TLikelihoodMethod>(i);
216  in >> likelihoodOptions.LF_stdHit >>
217  likelihoodOptions.LF_zHit >> likelihoodOptions.LF_zRandom >>
218  likelihoodOptions.LF_maxRange >>
219  likelihoodOptions.LF_decimation >>
220  likelihoodOptions.LF_maxCorrsDistance >>
221  likelihoodOptions.LF_alternateAverageMethod >>
222  likelihoodOptions.MI_exponent >>
223  likelihoodOptions.MI_skip_rays >>
224  likelihoodOptions.MI_ratio_max_distance >>
225  likelihoodOptions.rayTracing_useDistanceFilter >>
226  likelihoodOptions.rayTracing_decimation >>
227  likelihoodOptions.rayTracing_stdHit >>
228  likelihoodOptions.consensus_takeEachRange >>
229  likelihoodOptions.consensus_pow >>
230  likelihoodOptions.OWA_weights >>
231  likelihoodOptions.enableLikelihoodCache;
232 
233  // Insertion as 3D:
234  if (version >= 6)
235  in >> genericMapParams;
236  else
237  {
238  bool disableSaveAs3DObject;
239  in >> disableSaveAs3DObject;
240  genericMapParams.enableSaveAs3DObject =
241  !disableSaveAs3DObject;
242  }
243  }
244 
245  if (version >= 4)
246  {
247  in >> insertionOptions.CFD_features_gaussian_size >>
248  insertionOptions.CFD_features_median_size;
249  }
250 
251  if (version >= 5)
252  {
253  in >> insertionOptions.wideningBeamsWithDistance;
254  }
255  }
256  break;
257  default:
259  };
260 }
261 
262 /*---------------------------------------------------------------
263  loadFromBitmapFile
264  Load a 8-bits, black & white bitmap file as a grid map. It will be loaded such
265 as coordinates (0,0) falls just in the middle of map.
266 \param file The file to be loaded.
267 \param resolution The size of a pixel (cell), in meters. Recall cells are always
268 squared, so just a dimension is needed.
269 \return False on any error.
270  ---------------------------------------------------------------*/
272  const std::string& file, float res, float xCentralPixel,
273  float yCentralPixel)
274 {
275  MRPT_START
276 
277  CImage imgFl;
278  if (!imgFl.loadFromFile(file, 0)) return false;
279 
280  m_is_empty = false;
281  return loadFromBitmap(imgFl, res, xCentralPixel, yCentralPixel);
282 
283  MRPT_END
284 }
285 
286 /*---------------------------------------------------------------
287  loadFromBitmap
288  ---------------------------------------------------------------*/
290  const mrpt::img::CImage& imgFl, float res, float xCentralPixel,
291  float yCentralPixel)
292 {
293  MRPT_START
294 
295  // For the precomputed likelihood trick:
296  precomputedLikelihoodToBeRecomputed = true;
297 
298  size_t bmpWidth = imgFl.getWidth();
299  size_t bmpHeight = imgFl.getHeight();
300 
301  if (size_x != bmpWidth || size_y != bmpHeight)
302  {
303  // Middle of bitmap?
304  if (xCentralPixel < -1 || yCentralPixel <= -1)
305  {
306  xCentralPixel = imgFl.getWidth() / 2.0f;
307  yCentralPixel = imgFl.getHeight() / 2.0f;
308  }
309 
310  // Resize grid:
311  float new_x_max = (imgFl.getWidth() - xCentralPixel) * res;
312  float new_x_min = -xCentralPixel * res;
313  float new_y_max = (imgFl.getHeight() - yCentralPixel) * res;
314  float new_y_min = -yCentralPixel * res;
315 
316  setSize(new_x_min, new_x_max, new_y_min, new_y_max, res);
317  }
318 
319  // And load cells content:
320  for (size_t x = 0; x < bmpWidth; x++)
321  for (size_t y = 0; y < bmpHeight; y++)
322  {
323  float f = imgFl.getAsFloat(x, bmpHeight - 1 - y);
324  f = std::max(0.01f, f);
325  f = std::min(0.99f, f);
326  setCell(x, y, f);
327  }
328 
329  m_is_empty = false;
330  return true;
331 
332  MRPT_END
333 }
334 
335 /*---------------------------------------------------------------
336  saveAsBitmapTwoMapsWithCorrespondences
337  ---------------------------------------------------------------*/
339  const std::string& fileName, const COccupancyGridMap2D* m1,
340  const COccupancyGridMap2D* m2, const TMatchingPairList& corrs)
341 {
342  MRPT_START
343 
344  CImage img1, img2;
345  CImage img(10, 10, 3, true);
346  unsigned int i, n, Ay1, Ay2;
347  unsigned int px, py;
348 
349  // The individual maps:
350  // ---------------------------------------------
351  m1->getAsImage(img1, false);
352  m2->getAsImage(img2, false);
353  unsigned int lx1 = img1.getWidth();
354  unsigned int ly1 = img1.getHeight();
355 
356  unsigned int lx2 = img2.getWidth();
357  unsigned int ly2 = img2.getHeight();
358 
359  // The map with the lowest height has to be vertically aligned:
360  if (ly1 > ly2)
361  {
362  Ay1 = 0;
363  Ay2 = (ly1 - ly2) / 2;
364  }
365  else
366  {
367  Ay2 = 0;
368  Ay1 = (ly2 - ly1) / 2;
369  }
370 
371  // Compute the size of the composite image:
372  // ---------------------------------------------
373  img.resize(lx1 + lx2 + 1, max(ly1, ly2), 3, true);
374  img.filledRectangle(
375  0, 0, img.getWidth() - 1, img.getHeight() - 1,
376  TColor::black()); // background: black
377  img.drawImage(0, Ay1, img1);
378  img.drawImage(lx1 + 1, Ay2, img2);
379 
380  // Draw the features:
381  // ---------------------------------------------
382  n = corrs.size();
383  TColor lineColor = TColor::black();
384  for (i = 0; i < n; i++)
385  {
386  // In M1:
387  px = m1->x2idx(corrs[i].this_x);
388  py = Ay1 + ly1 - 1 - m1->y2idx(corrs[i].this_y);
389  img.rectangle(px - 10, py - 10, px + 10, py + 10, lineColor);
390  img.rectangle(px - 11, py - 11, px + 11, py + 11, lineColor);
391 
392  // In M2:
393  px = lx1 + 1 + m2->x2idx(corrs[i].other_x);
394  py = Ay2 + ly2 - 1 - m2->y2idx(corrs[i].other_y);
395  img.rectangle(px - 10, py - 10, px + 10, py + 10, lineColor);
396  img.rectangle(px - 11, py - 11, px + 11, py + 11, lineColor);
397  }
398 
399  // Draw the correspondences as lines:
400  // ---------------------------------------------
401  for (i = 0; i < n; i++)
402  {
403  lineColor = TColor(
404  static_cast<long>(getRandomGenerator().drawUniform(0, 255.0f)),
405  static_cast<long>(getRandomGenerator().drawUniform(0, 255.0f)),
406  static_cast<long>(getRandomGenerator().drawUniform(0, 255.0f)));
407 
408  img.line(
409  m1->x2idx(corrs[i].this_x),
410  // lx1+1+ m1->x2idx( corrs[i].this_x ),
411  Ay1 + ly1 - 1 - m1->y2idx(corrs[i].this_y),
412  lx1 + 1 + m2->x2idx(corrs[i].other_x),
413  Ay2 + ly2 - 1 - m2->y2idx(corrs[i].other_y), lineColor);
414  } // i
415 
416  return img.saveToFile(fileName.c_str());
417 
418  MRPT_END
419 }
420 
421 /*---------------------------------------------------------------
422  saveAsEMFTwoMapsWithCorrespondences
423  ---------------------------------------------------------------*/
425  const std::string& fileName, const COccupancyGridMap2D* m1,
426  const COccupancyGridMap2D* m2, const TMatchingPairList& corrs)
427 {
428  MRPT_START
429 
430  CEnhancedMetaFile emf(fileName, 1);
431  CImage img1, img2;
432  TColor lineColor;
433  unsigned int i, Ay1, Ay2;
434  unsigned int px, py;
435 
436  lineColor = TColor::red();
437 
438 // The individual maps:
439 // ---------------------------------------------
440 #ifdef _WIN32
441  m1->getAsImage(img1, true);
442  m2->getAsImage(img2, true);
443 #else
444  m1->getAsImage(img1, false); // Linux: emulated EMF is different.
445  m2->getAsImage(img2, false);
446 #endif
447  unsigned int lx1 = img1.getWidth();
448  unsigned int ly1 = img1.getHeight();
449  // unsigned int lx2 = img2.getWidth();
450  unsigned int ly2 = img2.getHeight();
451 
452  // The map with the lowest height has to be vertically aligned:
453  if (ly1 > ly2)
454  {
455  Ay1 = 0;
456  Ay2 = (ly1 - ly2) / 2;
457  }
458  else
459  {
460  Ay2 = 0;
461  Ay1 = (ly2 - ly1) / 2;
462  }
463 
464  // Draw the pair of maps:
465  // ---------------------------------------------
466  emf.drawImage(0, Ay1, img1);
467  emf.drawImage(lx1 + 1, Ay2, img2);
468 
469  // Draw the features:
470  // ---------------------------------------------
471  const unsigned int n = corrs.size();
472  lineColor = TColor::black();
473  for (i = 0; i < n; i++)
474  {
475  // In M1:
476  px = m1->x2idx(corrs[i].this_x);
477  py = Ay1 + ly1 - 1 - m1->y2idx(corrs[i].this_y);
478  emf.rectangle(px - 10, py - 10, px + 10, py + 10, lineColor);
479  emf.rectangle(px - 11, py - 11, px + 11, py + 11, lineColor);
480 
481  // In M2:
482  px = lx1 + 1 + m2->x2idx(corrs[i].other_x);
483  py = Ay2 + ly2 - 1 - m2->y2idx(corrs[i].other_y);
484  emf.rectangle(px - 10, py - 10, px + 10, py + 10, lineColor);
485  emf.rectangle(px - 11, py - 11, px + 11, py + 11, lineColor);
486  }
487 
488  /** /
489  // Draw the correspondences as lines:
490  // ---------------------------------------------
491  for (i=0;i<n;i++)
492  {
493  lineColor =
494  ((unsigned long)RandomUni(0,255.0f)) +
495  (((unsigned long)RandomUni(0,255.0f)) << 8 ) +
496  (((unsigned long)RandomUni(0,255.0f)) << 16 );
497 
498  emf.line(
499  m1->x2idx( corrs[i].this_x ),
500  Ay1+ly1-1- m1->y2idx( corrs[i].this_y ),
501  lx1+1+ m2->x2idx( corrs[i].other_x ),
502  Ay2+ly2-1-m2->y2idx( corrs[i].other_y ),
503  lineColor);
504  } // i
505  / **/
506 
507  // Draw the correspondences as text labels:
508  // ---------------------------------------------
509  char str[100];
510  for (i = 0; i < n; i++)
511  {
512  os::sprintf(str, 100, "%i", i);
513 
514  emf.textOut(
515  m1->x2idx(corrs[i].this_x) - 10,
516  Ay1 + ly1 - 1 - m1->y2idx(corrs[i].this_y) - 25, str,
517  TColor::black());
518 
519  emf.textOut(
520  lx1 + 1 + m2->x2idx(corrs[i].other_x) - 10,
521  Ay2 + ly2 - 1 - m2->y2idx(corrs[i].other_y) - 25, str,
522  TColor::black());
523  } // i
524 
525  return true;
526 
527  MRPT_END
528 }
529 
530 /*---------------------------------------------------------------
531  auxParticleFilterCleanUp
532  ---------------------------------------------------------------*/
534  const std::string& filNamePrefix) const
535 {
536  std::string fil(filNamePrefix + std::string(".png"));
537  saveAsBitmapFile(fil);
538 
539  fil = filNamePrefix + std::string("_limits.txt");
540  CMatrix LIMITS(1, 4);
541  LIMITS(0, 0) = x_min;
542  LIMITS(0, 1) = x_max;
543  LIMITS(0, 2) = y_min;
544  LIMITS(0, 3) = y_max;
545  LIMITS.saveToTextFile(
546  fil, MATRIX_FORMAT_FIXED, false /* add mrpt header */,
547  "% Grid limits: [x_min x_max y_min y_max]\n");
548 }
n
GLenum GLsizei n
Definition: glext.h:5074
os.h
mrpt::maps::COccupancyGridMap2D::serializeTo
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Definition: COccupancyGridMap2D_io.cpp:46
mrpt::img::CImage::getWidth
size_t getWidth() const override
Returns the width of the image in pixels.
Definition: CImage.cpp:864
COccupancyGridMap2D.h
red
unsigned char red[10]
Definition: PbMapMaker.cpp:1298
mrpt::maps::COccupancyGridMap2D::loadFromBitmap
bool loadFromBitmap(const mrpt::img::CImage &img, float resolution, float xCentralPixel=-1, float yCentralPixel=-1)
Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).
Definition: COccupancyGridMap2D_io.cpp:289
mrpt::maps::COccupancyGridMap2D::loadFromBitmapFile
bool loadFromBitmapFile(const std::string &file, float resolution, float xCentralPixel=-1, float yCentralPixel=-1)
Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).
Definition: COccupancyGridMap2D_io.cpp:271
uint16_t
unsigned __int16 uint16_t
Definition: rptypes.h:44
mrpt::math::MATRIX_FORMAT_FIXED
@ MATRIX_FORMAT_FIXED
fixed floating point 'f'
Definition: math_frwds.h:65
mrpt::maps::COccupancyGridMap2D::serializeGetVersion
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
Definition: COccupancyGridMap2D_io.cpp:45
CMatrix.h
CEnhancedMetaFile.h
mrpt::maps::COccupancyGridMap2D::getAsImage
void getAsImage(mrpt::img::CImage &img, bool verticalFlip=false, bool forceRGB=false, bool tricolor=false) const
Returns the grid as a 8-bit graylevel image, where each pixel is a cell (output image is RGB only if ...
Definition: COccupancyGridMap2D_getAs.cpp:29
mrpt::tfest
Functions for estimating the optimal transformation between two frames of references given measuremen...
Definition: indiv-compat-decls.h:16
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::img::CEnhancedMetaFile
This class represents a Windows Enhanced Meta File (EMF) for generating and saving graphics.
Definition: CEnhancedMetaFile.h:24
ASSERT_
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:113
p
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::poses
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Definition: CHierarchicalMapMHPartition.h:25
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition: CParticleFilter.h:17
mrpt::serialization::CArchive
Virtual base class for "archives": classes abstracting I/O streams.
Definition: CArchive.h:48
mrpt::img::CImage::getAsFloat
float getAsFloat(unsigned int col, unsigned int row, unsigned int channel) const
Returns the contents of a given pixel at the desired channel, in float format: [0,...
Definition: CImage.cpp:948
random.h
mrpt::system::os::sprintf
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
Definition: os.cpp:189
mrpt::serialization::CArchive::WriteBuffer
void WriteBuffer(const void *Buffer, size_t Count)
Writes a block of bytes to the stream from Buffer.
Definition: CArchive.cpp:48
mrpt::img
Definition: CCanvas.h:17
mrpt::math::CMatrix
This class is a "CSerializable" wrapper for "CMatrixFloat".
Definition: CMatrix.h:24
MRPT_START
#define MRPT_START
Definition: exceptions.h:262
mrpt::maps::COccupancyGridMap2D::cellType
int16_t cellType
The type of the map cells:
Definition: COccupancyGridMap2D.h:77
mrpt::maps::COccupancyGridMap2D::y2idx
int y2idx(float y) const
Definition: COccupancyGridMap2D.h:314
res
GLuint res
Definition: glext.h:7268
mrpt::maps::COccupancyGridMap2D::x2idx
int x2idx(float x) const
Transform a coordinate value into a cell index.
Definition: COccupancyGridMap2D.h:310
mrpt::img::TColor
A RGB color - 8bit.
Definition: TColor.h:22
round.h
mrpt::maps::COccupancyGridMap2D::saveMetricMapRepresentationToFile
void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const override
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >,...
Definition: COccupancyGridMap2D_io.cpp:533
setSize
EIGEN_STRONG_INLINE void setSize(size_t row, size_t col)
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...
Definition: eigen_plugins.h:343
mrpt::img::CImage
A class for storing images as grayscale or RGB bitmaps.
Definition: img/CImage.h:130
int32_t
__int32 int32_t
Definition: rptypes.h:46
mrpt::maps::COccupancyGridMap2D::TLikelihoodMethod
TLikelihoodMethod
The type for selecting a likelihood computation method.
Definition: COccupancyGridMap2D.h:557
mrpt::maps::COccupancyGridMap2D::saveAsBitmapFile
bool saveAsBitmapFile(const std::string &file) const
Saves the gridmap as a graphical file (BMP,PNG,...).
Definition: COccupancyGridMap2D_io.cpp:34
min
#define min(a, b)
Definition: rplidar_driver.cpp:42
mrpt::img::CImage::getHeight
size_t getHeight() const override
Returns the height of the image in pixels.
Definition: CImage.cpp:892
mrpt::random::getRandomGenerator
CRandomGenerator & getRandomGenerator()
A static instance of a CRandomGenerator class, for use in single-thread applications.
Definition: RandomGenerator.cpp:19
mrpt::maps::COccupancyGridMap2D::cellTypeUnsigned
uint16_t cellTypeUnsigned
Definition: COccupancyGridMap2D.h:78
img
GLint GLvoid * img
Definition: glext.h:3763
mrpt::maps::COccupancyGridMap2D::serializeFrom
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
Definition: COccupancyGridMap2D_io.cpp:102
maps-precomp.h
MRPT_END
#define MRPT_END
Definition: exceptions.h:266
mrpt::math
This base provides a set of functions for maths stuff.
Definition: math/include/mrpt/math/bits_math.h:13
mrpt::maps::COccupancyGridMap2D
A class for storing an occupancy grid map.
Definition: COccupancyGridMap2D.h:62
mrpt::tfest::TMatchingPairList
A list of TMatchingPair.
Definition: TMatchingPair.h:83
in
GLuint in
Definition: glext.h:7274
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::maps::COccupancyGridMap2D::saveAsBitmapTwoMapsWithCorrespondences
static bool saveAsBitmapTwoMapsWithCorrespondences(const std::string &fileName, const COccupancyGridMap2D *m1, const COccupancyGridMap2D *m2, const mrpt::tfest::TMatchingPairList &corrs)
Saves a composite image with two gridmaps and lines representing a set of correspondences between the...
Definition: COccupancyGridMap2D_io.cpp:338
mrpt::random
A namespace of pseudo-random numbers generators of diferent distributions.
Definition: random_shuffle.h:17
mrpt::maps
Definition: CBeacon.h:24
CArchive.h
MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
Definition: exceptions.h:90
mrpt::maps::COccupancyGridMap2D::saveAsEMFTwoMapsWithCorrespondences
static bool saveAsEMFTwoMapsWithCorrespondences(const std::string &fileName, const COccupancyGridMap2D *m1, const COccupancyGridMap2D *m2, const mrpt::tfest::TMatchingPairList &corrs)
Saves a composite image with two gridmaps and numbers for the correspondences between them.
Definition: COccupancyGridMap2D_io.cpp:424
mrpt::serialization::CArchive::WriteBufferFixEndianness
void WriteBufferFixEndianness(const T *ptr, size_t ElementCount)
Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running arch...
Definition: CArchive.h:123
y
GLenum GLint GLint y
Definition: glext.h:3538
uint32_t
unsigned __int32 uint32_t
Definition: rptypes.h:47
x
GLenum GLint x
Definition: glext.h:3538
mrpt::system
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
Definition: math_frwds.h:25



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST