MRPT data formats and serialization

MRPT data file formats:

  • .gridmap (or  compressed  version  .gridmap.gz).   A  2D  occupancygrid map.   These ?les consist on one COccupancyGridMap2D objectserialized into a binary .  See Chapter 10 for more details on howto serialize and de-serialize objects.
  • .ini.   Configuration  ?les.   The  format  is  plain  text,  with  the  structured in sections (denoted as [NAME]) and variables within eachsection (denoted by var=value).  These files can contain comments,which may start with ; or //.
  • .simplemap (or compressed version .simplemap.gz). A collection of pairs location-observations, from which metric maps can be built easily.   The actually contains a binary serialization of an object of the  class  CSensFrameProbSequence.   See  Chapter  10  for  more  details  on  how  to  serialize  and  de-serialize  objects.   The  application
    observations2map can convert a simplemap file into a set of difierentmetric maps (grid maps, point maps,...)  and save them to diferentles. Refer to the documentation of that program for details.
  • .rawlog.   Robotic datasets.   The format of these files is explainedin detail in the Chapter 13.  These files can be managed and visualized with the application RawlogViewer, or captured from sensors byrawlog-grabber.

Serialization

image

image

class identification

image

image

Rawlog files (datasets)

Format  #1:   A  Bayesian  filter-friendly  file format

a rawlog file is divided in a sequence of actions, observations, actions, observations,...  ”Actions” typically include robot motor actuations (odometry), but any kind of user-defined actions can be defined as well (e.g. robot arm actuations). ”Observations” include readings from the rest of robotic sensors:  laser scanners, images from cameras, sonar ranges, etc.

A rawlog file is a binary serialization of alternating objects of the classes:
•  CActionCollection, one or more actions (e.g. odometry), and
•  CSensoryFrame, which stores the observations.

Format #2: An timestamp-ordered sequence of observations

While the previous format is really well-suited for Bayesian approaches with clearly separate steps of process action-process observation, in the case of complex datasets with many different sensors, working at different rates, and possibly without odometry (the typical ’action’ in SLAM algorithms), it is more clear to just store datasets as an ordered list of observations.

Actual contents of a ”.rawlog” file in this format In this case, the rawlog file is a binary serialization of objects derived from the class slam::CObservation.  In this case, odometry (if present) is also stored as an observation.

The applications RawLogViewer, rawlog-grabber, and the class slam::CRawlog all support both rawlog formats.

Generating Rawlog files

image

Reading Rawlog files

Option A: Streaming from the file

This is the preferred mode of operation in general: actions and observations are read sequentially from the file, processed, freed, and so on. In this way only the required objects are loaded in memory at any time, which is mandatory when managing large datasets (e.g.  containing thousands of embedded images).  However, notice that if images are stored externally the rawlog could be loaded at once without problems. A typical loop for loading a rawlog in this way is shown next:

image

Option B: Read at once

A rawlog file can be read as a whole using the class slam::CRawlog.  Notice that this may be impractical for very large datasets (several millions of entries) due to memory requirements, but for mid-sized datasets it definitively is the easiest way of loading rawlogs.
image

你可能感兴趣的:(serialization)