Main MRPT website > C++ reference for MRPT 1.5.5
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Attributes
mrpt::obs::CRawlog Class Reference

Detailed Description

This class stores a rawlog (robotic datasets) in one of two possible formats:

Refer to the wiki page about rawlog files.

See also the application RawLogViewer for the GUI program that visualizes and manages rawlogs.

This class also publishes a static helper method for loading rawlog files in format #1: see CRawlog::readActionObservationPair

There is a field for comments and blocks of parameters (in ini-like format) accessible through getCommentText and setCommentText (introduced in MRPT 0.6.4). When serialized to a rawlog file, the comments are saved as an additional observation of the type CObservationComments at the beginning of the file, but this observation does not appear after loading for clarity.

Note
Since MRPT version 0.5.5, this class also provides a STL container-like interface (see CRawlog::begin, CRawlog::iterator, ...).
The format #2 is supported since MRPT version 0.6.0.
There is a static helper method "detectImagesDirectory" for localizing the external images directory of a rawlog.
See Also
CSensoryFrame, CPose2D, RawLog file format.

Definition at line 52 of file obs/CRawlog.h.

#include <mrpt/obs/CRawlog.h>

Inheritance diagram for mrpt::obs::CRawlog:
Inheritance graph

Classes

class  const_iterator
 A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequence. More...
 
class  iterator
 A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequence. More...
 

Public Types

enum  TEntryType { etSensoryFrame = 0, etActionCollection, etObservation, etOther }
 The type of each entry in a rawlog. More...
 

Public Member Functions

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
voidoperator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
void getCommentText (std::string &t) const
 Returns the block of comment text for the rawlog. More...
 
std::string getCommentText () const
 Returns the block of comment text for the rawlog. More...
 
void setCommentText (const std::string &t)
 Changes the block of comment text for the rawlog. More...
 
void getCommentTextAsConfigFile (mrpt::utils::CConfigFileMemory &memCfg) const
 Saves the block of comment text for the rawlog into the passed config file object. More...
 
 CRawlog ()
 Default constructor. More...
 
virtual ~CRawlog ()
 Destructor: More...
 
void clear ()
 Clear the sequence of actions/observations. More...
 
void addAction (CAction &action)
 Add an action to the sequence: a collection of just one element is created. More...
 
void addActions (CActionCollection &action)
 Add a set of actions to the sequence; the object is duplicated, so the original one can be freed if desired. More...
 
void addObservations (CSensoryFrame &observations)
 Add a set of observations to the sequence; the object is duplicated, so the original one can be free if desired. More...
 
void addActionsMemoryReference (const CActionCollectionPtr &action)
 Add a set of actions to the sequence, using a smart pointer to the object to add. More...
 
void addObservationsMemoryReference (const CSensoryFramePtr &observations)
 Add a set of observations to the sequence, using a smart pointer to the object to add. More...
 
void addObservationMemoryReference (const CObservationPtr &observation)
 Add a single observation to the sequence, using a smart pointer to the object to add. More...
 
void addGenericObject (const mrpt::utils::CSerializablePtr &obj)
 Generic add for a smart pointer to a CSerializable object: More...
 
bool loadFromRawLogFile (const std::string &fileName, bool non_obs_objects_are_legal=false)
 Load the contents from a file containing one of these possibilities: More...
 
bool saveToRawLogFile (const std::string &fileName) const
 Saves the contents to a rawlog-file, compatible with RawlogViewer (As the sequence of internal objects). More...
 
size_t size () const
 Returns the number of actions / observations object in the sequence. More...
 
TEntryType getType (size_t index) const
 Returns the type of a given element. More...
 
void remove (size_t index)
 Delete the action or observation stored in the given index. More...
 
void remove (size_t first_index, size_t last_index)
 Delete the elements stored in the given range of indices (including both the first and last one). More...
 
CActionCollectionPtr getAsAction (size_t index) const
 Returns the i'th element in the sequence, as being actions, where index=0 is the first object. More...
 
CSensoryFramePtr getAsObservations (size_t index) const
 Returns the i'th element in the sequence, as being an action, where index=0 is the first object. More...
 
mrpt::utils::CSerializablePtr getAsGeneric (size_t index) const
 Returns the i'th element in the sequence, being its class whatever. More...
 
CObservationPtr getAsObservation (size_t index) const
 Returns the i'th element in the sequence, as being an observation, where index=0 is the first object. More...
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
iterator erase (const iterator &it)
 
void findObservationsByClassInRange (mrpt::system::TTimeStamp time_start, mrpt::system::TTimeStamp time_end, const mrpt::utils::TRuntimeClassId *class_type, TListTimeAndObservations &out_found, size_t guess_start_position=0) const
 Returns the sub-set of observations of a given class whose time-stamp t fulfills time_start <= t < time_end. More...
 
void moveFrom (CRawlog &obj)
 Efficiently copy the contents from other existing object, and remove the data from the origin (after calling this, the original object will have no actions/observations). More...
 
void swap (CRawlog &obj)
 Efficiently swap the contents of two existing objects. More...
 
bool getActionObservationPair (CActionCollectionPtr &action, CSensoryFramePtr &observations, size_t &rawlogEntry) const
 Gets the next consecutive pair action / observation from the rawlog loaded into this object. More...
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 
static bool readActionObservationPair (mrpt::utils::CStream &inStream, CActionCollectionPtr &action, CSensoryFramePtr &observations, size_t &rawlogEntry)
 Reads a consecutive pair action / observation from the rawlog opened at some input stream. More...
 
static bool getActionObservationPairOrObservation (mrpt::utils::CStream &inStream, CActionCollectionPtr &action, CSensoryFramePtr &observations, CObservationPtr &observation, size_t &rawlogEntry)
 Reads a consecutive pair action/sensory_frame OR an observation, depending of the rawlog format, from the rawlog opened at some input stream. More...
 
static std::string detectImagesDirectory (const std::string &rawlogFilename)
 Tries to auto-detect the external-images directory of the given rawlog file. More...
 

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject
 
RTTI stuff
static const
mrpt::utils::TRuntimeClassId 
classCSerializable
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
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 be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

Private Types

typedef std::vector
< mrpt::utils::CSerializablePtr > 
TListObjects
 

Private Attributes

TListObjects m_seqOfActObs
 The list where the objects really are in. More...
 
CObservationComment m_commentTexts
 Comments of the rawlog. More...
 

RTTI stuff

typedef CRawlogPtr Ptr
 
typedef CRawlogPtr ConstPtr
 
static mrpt::utils::CLASSINIT _init_CRawlog
 
static mrpt::utils::TRuntimeClassId classCRawlog
 
static const
mrpt::utils::TRuntimeClassId
classinfo
 
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
 
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CRawlogPtr Create ()
 

Member Typedef Documentation

typedef CRawlogPtr mrpt::obs::CRawlog::ConstPtr

Definition at line 55 of file obs/CRawlog.h.

typedef CRawlogPtr mrpt::obs::CRawlog::Ptr

A typedef for the associated smart pointer

Definition at line 55 of file obs/CRawlog.h.

typedef std::vector<mrpt::utils::CSerializablePtr> mrpt::obs::CRawlog::TListObjects
private

Definition at line 58 of file obs/CRawlog.h.

Member Enumeration Documentation

The type of each entry in a rawlog.

See Also
CRawlog::getType
Enumerator
etSensoryFrame 
etActionCollection 
etObservation 
etOther 

Definition at line 72 of file obs/CRawlog.h.

Constructor & Destructor Documentation

CRawlog::CRawlog ( )

Default constructor.

Definition at line 29 of file CRawlog.cpp.

CRawlog::~CRawlog ( )
virtual

Destructor:

Definition at line 34 of file CRawlog.cpp.

References mrpt::utils::clear().

Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::obs::CRawlog::_GetBaseClass ( )
staticprotected
void CRawlog::addAction ( CAction action)

Add an action to the sequence: a collection of just one element is created.

The object is duplicated, so the original one can be freed if desired.

Definition at line 76 of file CRawlog.cpp.

References mrpt::obs::CActionCollection::Create().

Referenced by mrpt::detectors::CDetectorDoorCrossing::process().

void CRawlog::addActions ( CActionCollection action)

Add a set of actions to the sequence; the object is duplicated, so the original one can be freed if desired.

See Also
addObservations, addActionsMemoryReference

Definition at line 50 of file CRawlog.cpp.

References mrpt::utils::CObject::duplicateGetSmartPtr().

void CRawlog::addActionsMemoryReference ( const CActionCollectionPtr &  action)

Add a set of actions to the sequence, using a smart pointer to the object to add.

See Also
addActions, addObservationsMemoryReference, addObservationMemoryReference

Definition at line 54 of file CRawlog.cpp.

void CRawlog::addGenericObject ( const mrpt::utils::CSerializablePtr &  obj)

Generic add for a smart pointer to a CSerializable object:

See Also
addObservations, addActionsMemoryReference, addObservationMemoryReference

Definition at line 61 of file CRawlog.cpp.

void CRawlog::addObservationMemoryReference ( const CObservationPtr &  observation)

Add a single observation to the sequence, using a smart pointer to the object to add.

See Also
addObservations, addActionsMemoryReference

Definition at line 65 of file CRawlog.cpp.

References IS_CLASS.

void CRawlog::addObservations ( CSensoryFrame observations)

Add a set of observations to the sequence; the object is duplicated, so the original one can be free if desired.

See Also
addActions, addObservationsMemoryReference

Definition at line 45 of file CRawlog.cpp.

References mrpt::utils::CObject::duplicateGetSmartPtr().

Referenced by mrpt::detectors::CDetectorDoorCrossing::process().

void CRawlog::addObservationsMemoryReference ( const CSensoryFramePtr &  observations)

Add a set of observations to the sequence, using a smart pointer to the object to add.

See Also
addObservations, addActionsMemoryReference, addObservationMemoryReference

Definition at line 58 of file CRawlog.cpp.

const_iterator mrpt::obs::CRawlog::begin ( ) const
inline

Definition at line 256 of file obs/CRawlog.h.

iterator mrpt::obs::CRawlog::begin ( )
inline

Definition at line 257 of file obs/CRawlog.h.

void CRawlog::clear ( )

Clear the sequence of actions/observations.

Smart pointers to objects previously in the rawlog will remain being valid.

Definition at line 39 of file CRawlog.cpp.

Referenced by mrpt::detectors::CDetectorDoorCrossing::clear().

CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

static CRawlogPtr mrpt::obs::CRawlog::Create ( )
static
static mrpt::utils::CObject* mrpt::obs::CRawlog::CreateObject ( )
static
std::string CRawlog::detectImagesDirectory ( const std::string rawlogFilename)
static

Tries to auto-detect the external-images directory of the given rawlog file.

This searches for the existence of the directories:

  • "<rawlog_file_path>/<rawlog_filename>_Images"
  • "<rawlog_file_path>/<rawlog_filename>_images"
  • "<rawlog_file_path>/<rawlog_filename>_IMAGES"
  • "<rawlog_file_path>/Images" (This one is returned if none of the choices actually exists).

The results from this function should be written into mrpt::utils::CImage::IMAGES_PATH_BASE to enable automatic loading of extenrnally-stored images in rawlogs.

Definition at line 582 of file CRawlog.cpp.

References mrpt::system::extractFileDirectory(), mrpt::system::extractFileName(), and mrpt::system::fileExists().

virtual mrpt::utils::CObject* mrpt::obs::CRawlog::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 140 of file CObject.h.

Referenced by addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and addObservations().

const_iterator mrpt::obs::CRawlog::end ( ) const
inline

Definition at line 258 of file obs/CRawlog.h.

iterator mrpt::obs::CRawlog::end ( )
inline

Definition at line 259 of file obs/CRawlog.h.

iterator mrpt::obs::CRawlog::erase ( const iterator it)
inline

Definition at line 261 of file obs/CRawlog.h.

void CRawlog::findObservationsByClassInRange ( mrpt::system::TTimeStamp  time_start,
mrpt::system::TTimeStamp  time_end,
const mrpt::utils::TRuntimeClassId class_type,
TListTimeAndObservations out_found,
size_t  guess_start_position = 0 
) const

Returns the sub-set of observations of a given class whose time-stamp t fulfills time_start <= t < time_end.

This method requires the timestamps of the sensors to be in strict ascending order (which should be the normal situation). Otherwise, the output is undeterminate.

See Also
findClosestObservationsByClass

Definition at line 452 of file CRawlog.cpp.

References ASSERT_, CLASS_ID, mrpt::math::distance(), INVALID_TIMESTAMP, MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.

bool CRawlog::getActionObservationPair ( CActionCollectionPtr &  action,
CSensoryFramePtr &  observations,
size_t &  rawlogEntry 
) const

Gets the next consecutive pair action / observation from the rawlog loaded into this object.

Previous contents of action and observations are discarded (using stlplus::smart_ptr::clear_unique), and at exit they contain the new objects read from the rawlog file. The input/output variable "rawlogEntry" is just a counter of the last rawlog entry read, for logging or monitoring purposes.

Returns
false if there was some error, true otherwise.
See Also
readActionObservationPair

Definition at line 531 of file CRawlog.cpp.

References etActionCollection, and etSensoryFrame.

Referenced by run_test_pf_localization().

bool CRawlog::getActionObservationPairOrObservation ( mrpt::utils::CStream inStream,
CActionCollectionPtr &  action,
CSensoryFramePtr &  observations,
CObservationPtr &  observation,
size_t &  rawlogEntry 
)
static

Reads a consecutive pair action/sensory_frame OR an observation, depending of the rawlog format, from the rawlog opened at some input stream.

Previous contents of action and observations are discarded (using stlplus::smart_ptr::clear_unique), and at exit they contain the new objects read from the rawlog file.

At return, one of this will happen:

  • action/observations contain objects (i.e. action.present() evaluates as true).
  • observation contains an object (i.e. observation.present() evaluates as true).

The input/output variable "rawlogEntry" is just a counter of the last rawlog entry read, for logging or monitoring purposes.

Returns
false if there was some error, true otherwise.
See Also
getActionObservationPair

Definition at line 390 of file CRawlog.cpp.

References CLASS_ID, IS_CLASS, and IS_DERIVED.

CActionCollectionPtr CRawlog::getAsAction ( size_t  index) const

Returns the i'th element in the sequence, as being actions, where index=0 is the first object.

If it is not a CActionCollection, it throws an exception. Do neighter modify nor delete the returned pointer.

See Also
size, isAction, getAsObservations, getAsObservation
Exceptions
std::exceptionIf index is out of bounds

Definition at line 88 of file CRawlog.cpp.

References CLASS_ID, MRPT_END, MRPT_START, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.

Referenced by mrpt::detectors::CDetectorDoorCrossing::process().

CSerializablePtr CRawlog::getAsGeneric ( size_t  index) const

Returns the i'th element in the sequence, being its class whatever.

See Also
size, isAction, getAsAction, getAsObservations
Exceptions
std::exceptionIf index is out of bounds

Definition at line 118 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

CObservationPtr CRawlog::getAsObservation ( size_t  index) const

Returns the i'th element in the sequence, as being an observation, where index=0 is the first object.

If it is not an CObservation, it throws an exception. Do neighter modify nor delete the returned pointer. This is the proper method to obtain the objects stored in a "only observations"-rawlog file (named "format #2" above.

See Also
size, isAction, getAsAction
Exceptions
std::exceptionIf index is out of bounds

Definition at line 103 of file CRawlog.cpp.

References CLASS_ID, MRPT_END, MRPT_START, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.

Referenced by mrpt::topography::path_from_rtk_gps().

CSensoryFramePtr CRawlog::getAsObservations ( size_t  index) const

Returns the i'th element in the sequence, as being an action, where index=0 is the first object.

If it is not an CSensoryFrame, it throws an exception. Do neighter modify nor delete the returned pointer.

See Also
size, isAction, getAsAction, getAsObservation
Exceptions
std::exceptionIf index is out of bounds

Definition at line 147 of file CRawlog.cpp.

References CLASS_ID, MRPT_END, MRPT_START, THROW_EXCEPTION, and THROW_EXCEPTION_FMT.

Referenced by mrpt::detectors::CDetectorDoorCrossing::process().

void CRawlog::getCommentText ( std::string t) const

Returns the block of comment text for the rawlog.

Definition at line 563 of file CRawlog.cpp.

std::string CRawlog::getCommentText ( ) const

Returns the block of comment text for the rawlog.

Definition at line 567 of file CRawlog.cpp.

void CRawlog::getCommentTextAsConfigFile ( mrpt::utils::CConfigFileMemory memCfg) const

Saves the block of comment text for the rawlog into the passed config file object.

Definition at line 572 of file CRawlog.cpp.

References mrpt::utils::CConfigFileMemory::setContent().

Referenced by mrpt::topography::path_from_rtk_gps().

virtual const mrpt::utils::TRuntimeClassId* mrpt::obs::CRawlog::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

CRawlog::TEntryType CRawlog::getType ( size_t  index) const

Returns the type of a given element.

See Also
isAction, isObservation

Definition at line 128 of file CRawlog.cpp.

References CLASS_ID, MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::topography::path_from_rtk_gps().

bool CRawlog::loadFromRawLogFile ( const std::string fileName,
bool  non_obs_objects_are_legal = false 
)

Load the contents from a file containing one of these possibilities:

  • A "CRawlog" object.
  • Directly the sequence of objects (pairs CSensoryFrame/CActionCollection or CObservation* objects). In this case the method stops reading on EOF of an unrecogniced class name.
  • Only if non_obs_objects_are_legal is true, any CSerializable object is allowed in the log file. Otherwise, the read stops on classes different from the ones listed in the item above.
    Returns
    It returns false upon error reading or accessing the file.

Definition at line 204 of file CRawlog.cpp.

References CLASS_ID, mrpt::utils::clear(), mrpt::utils::CFileGZInputStream::fileOpenCorrectly(), and IS_CLASS.

Referenced by run_test_pf_localization(), and TEST().

void CRawlog::moveFrom ( CRawlog obj)

Efficiently copy the contents from other existing object, and remove the data from the origin (after calling this, the original object will have no actions/observations).

Definition at line 309 of file CRawlog.cpp.

References mrpt::utils::clear(), m_commentTexts, m_seqOfActObs, MRPT_END, MRPT_START, and mrpt::obs::CObservationComment::text.

void mrpt::obs::CRawlog::operator delete ( void ptr)
throw (
)
inline

Definition at line 55 of file obs/CRawlog.h.

void mrpt::obs::CRawlog::operator delete ( void ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 55 of file obs/CRawlog.h.

void mrpt::obs::CRawlog::operator delete ( void memory,
void ptr 
)
throw (
)
inline

Definition at line 55 of file obs/CRawlog.h.

void mrpt::obs::CRawlog::operator delete[] ( void ptr)
throw (
)
inline

Definition at line 55 of file obs/CRawlog.h.

void* mrpt::obs::CRawlog::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 55 of file obs/CRawlog.h.

static void* mrpt::obs::CRawlog::operator new ( size_t  size,
void ptr 
)
inlinestatic

Definition at line 55 of file obs/CRawlog.h.

void* mrpt::obs::CRawlog::operator new ( size_t  size)
inline

Definition at line 55 of file obs/CRawlog.h.

void* mrpt::obs::CRawlog::operator new[] ( size_t  size)
inline

Definition at line 55 of file obs/CRawlog.h.

bool CRawlog::readActionObservationPair ( mrpt::utils::CStream inStream,
CActionCollectionPtr &  action,
CSensoryFramePtr &  observations,
size_t &  rawlogEntry 
)
static

Reads a consecutive pair action / observation from the rawlog opened at some input stream.

Previous contents of action and observations are discarded (using stlplus::smart_ptr::clear_unique), and at exit they contain the new objects read from the rawlog file. The input/output variable "rawlogEntry" is just a counter of the last rawlog entry read, for logging or monitoring purposes.

Returns
false if there was some error, true otherwise.
See Also
getActionObservationPair, getActionObservationPairOrObservation

Definition at line 328 of file CRawlog.cpp.

References CLASS_ID.

void CRawlog::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 180 of file CRawlog.cpp.

References mrpt::utils::clear(), MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and mrpt::utils::CStream::ReadObject().

void CRawlog::remove ( size_t  index)

Delete the action or observation stored in the given index.

Exceptions
std::exceptionIf index is out of bounds

Definition at line 274 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::detectors::CDetectorDoorCrossing::process().

void CRawlog::remove ( size_t  first_index,
size_t  last_index 
)

Delete the elements stored in the given range of indices (including both the first and last one).

Exceptions
std::exceptionIf any index is out of bounds

Definition at line 283 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

bool CRawlog::saveToRawLogFile ( const std::string fileName) const

Saves the contents to a rawlog-file, compatible with RawlogViewer (As the sequence of internal objects).

The file is saved with gz-commpressed if MRPT has gz-streams.

Returns
It returns false if any error is found while writing/creating the target file.

Definition at line 292 of file CRawlog.cpp.

References CFileGZOutputStream.

void CRawlog::setCommentText ( const std::string t)

Changes the block of comment text for the rawlog.

Definition at line 577 of file CRawlog.cpp.

size_t CRawlog::size ( ) const

Returns the number of actions / observations object in the sequence.

Definition at line 83 of file CRawlog.cpp.

Referenced by mrpt::topography::path_from_rtk_gps(), mrpt::detectors::CDetectorDoorCrossing::process(), run_test_pf_localization(), and TEST().

void CRawlog::swap ( CRawlog obj)

Efficiently swap the contents of two existing objects.

Definition at line 321 of file CRawlog.cpp.

References m_commentTexts, and m_seqOfActObs.

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

void CRawlog::writeToStream ( mrpt::utils::CStream out,
int getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See Also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 161 of file CRawlog.cpp.

Member Data Documentation

mrpt::utils::CLASSINIT mrpt::obs::CRawlog::_init_CRawlog
staticprotected

Definition at line 55 of file obs/CRawlog.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 128 of file CObject.h.

mrpt::utils::TRuntimeClassId mrpt::obs::CRawlog::classCRawlog
static

Definition at line 55 of file obs/CRawlog.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 42 of file CSerializable.h.

const mrpt::utils::TRuntimeClassId* mrpt::obs::CRawlog::classinfo
static

Definition at line 55 of file obs/CRawlog.h.

CObservationComment mrpt::obs::CRawlog::m_commentTexts
private

Comments of the rawlog.

Definition at line 61 of file obs/CRawlog.h.

Referenced by moveFrom(), and swap().

TListObjects mrpt::obs::CRawlog::m_seqOfActObs
private

The list where the objects really are in.

Definition at line 59 of file obs/CRawlog.h.

Referenced by moveFrom(), and swap().




Page generated by Doxygen 1.8.6 for MRPT 1.5.5 Git: e06b63d Fri Dec 1 14:41:11 2017 +0100 at sáb dic 2 13:00:21 CET 2017