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



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