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



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020