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

Detailed Description

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

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 68 of file 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) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *memory, void *ptr) noexcept
 
voidoperator new (size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
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::config::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 CActionCollection::Ptr &action)
 Add a set of actions to the sequence, using a smart pointer to the object to add. More...
 
void addObservationsMemoryReference (const CSensoryFrame::Ptr &observations)
 Add a set of observations to the sequence, using a smart pointer to the object to add. More...
 
void addObservationMemoryReference (const CObservation::Ptr &observation)
 Add a single observation to the sequence, using a smart pointer to the object to add. More...
 
void addGenericObject (const mrpt::serialization::CSerializable::Ptr &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...
 
CActionCollection::Ptr getAsAction (size_t index) const
 Returns the i'th element in the sequence, as being actions, where index=0 is the first object. More...
 
CSensoryFrame::Ptr 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::serialization::CSerializable::Ptr getAsGeneric (size_t index) const
 Returns the i'th element in the sequence, being its class whatever. More...
 
CObservation::Ptr 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::rtti::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 swap (CRawlog &obj)
 Efficiently swap the contents of two existing objects. More...
 
bool getActionObservationPair (CActionCollection::Ptr &action, CSensoryFrame::Ptr &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...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 
static bool readActionObservationPair (mrpt::serialization::CArchive &inStream, CActionCollection::Ptr &action, CSensoryFrame::Ptr &observations, size_t &rawlogEntry)
 Reads a consecutive pair action / observation from the rawlog opened at some input stream. More...
 
static bool getActionObservationPairOrObservation (mrpt::serialization::CArchive &inStream, CActionCollection::Ptr &action, CSensoryFrame::Ptr &observations, CObservation::Ptr &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...
 

Protected Member Functions

CSerializable virtual methods
uint8_t serializeGetVersion () const override
 Must return the current versioning number of the object. More...
 
void serializeTo (mrpt::serialization::CArchive &out) const override
 Pure virtual method for writing (serializing) to an abstract archive. More...
 
void serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override
 Pure virtual method for reading (deserializing) from an abstract archive. More...
 

Private Types

using TListObjects = std::vector< mrpt::serialization::CSerializable::Ptr >
 

Private Attributes

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

RTTI stuff


using Ptr = std::shared_ptr< CRawlog >
 
using ConstPtr = std::shared_ptr< const CRawlog >
 
using UniquePtr = std::unique_ptr< CRawlog >
 
using ConstUniquePtr = std::unique_ptr< const CRawlog >
 
static mrpt::rtti::CLASSINIT _init_CRawlog
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "CRawlog"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static mrpt::rtti::CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Member Typedef Documentation

◆ ConstPtr

using mrpt::obs::CRawlog::ConstPtr = std::shared_ptr<const CRawlog >

Definition at line 70 of file CRawlog.h.

◆ ConstUniquePtr

using mrpt::obs::CRawlog::ConstUniquePtr = std::unique_ptr<const CRawlog >

Definition at line 70 of file CRawlog.h.

◆ Ptr

using mrpt::obs::CRawlog::Ptr = std::shared_ptr< CRawlog >

A type for the associated smart pointer

Definition at line 70 of file CRawlog.h.

◆ TListObjects

Definition at line 73 of file CRawlog.h.

◆ UniquePtr

using mrpt::obs::CRawlog::UniquePtr = std::unique_ptr< CRawlog >

Definition at line 70 of file CRawlog.h.

Member Enumeration Documentation

◆ TEntryType

The type of each entry in a rawlog.

See also
CRawlog::getType
Enumerator
etSensoryFrame 
etActionCollection 
etObservation 
etOther 

Definition at line 95 of file CRawlog.h.

Constructor & Destructor Documentation

◆ CRawlog()

CRawlog::CRawlog ( )

Default constructor.

Definition at line 29 of file CRawlog.cpp.

◆ ~CRawlog()

CRawlog::~CRawlog ( )
virtual

Destructor:

Definition at line 31 of file CRawlog.cpp.

References mrpt::containers::clear().

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::rtti::TRuntimeClassId* mrpt::obs::CRawlog::_GetBaseClass ( )
staticprotected

◆ addAction()

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 80 of file CRawlog.cpp.

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

◆ addActions()

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 45 of file CRawlog.cpp.

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

◆ addActionsMemoryReference()

void CRawlog::addActionsMemoryReference ( const CActionCollection::Ptr 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 52 of file CRawlog.cpp.

◆ addGenericObject()

void CRawlog::addGenericObject ( const mrpt::serialization::CSerializable::Ptr obj)

Generic add for a smart pointer to a CSerializable object:

See also
addObservations, addActionsMemoryReference, addObservationMemoryReference

Definition at line 62 of file CRawlog.cpp.

◆ addObservationMemoryReference()

void CRawlog::addObservationMemoryReference ( const CObservation::Ptr observation)

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

See also
addObservations, addActionsMemoryReference

Definition at line 67 of file CRawlog.cpp.

References IS_CLASS.

◆ addObservations()

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 38 of file CRawlog.cpp.

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

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

◆ addObservationsMemoryReference()

void CRawlog::addObservationsMemoryReference ( const CSensoryFrame::Ptr 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 57 of file CRawlog.cpp.

◆ begin() [1/2]

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

Definition at line 346 of file CRawlog.h.

References m_seqOfActObs.

◆ begin() [2/2]

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

Definition at line 345 of file CRawlog.h.

References m_seqOfActObs.

◆ clear()

void CRawlog::clear ( )

Clear the sequence of actions/observations.

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

Definition at line 32 of file CRawlog.cpp.

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

◆ clone()

virtual mrpt::rtti::CObject* mrpt::obs::CRawlog::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::rtti::CObject.

◆ Create()

template<typename... Args>
static Ptr mrpt::obs::CRawlog::Create ( Args &&...  args)
inlinestatic

Definition at line 70 of file CRawlog.h.

◆ CreateObject()

static mrpt::rtti::CObject* mrpt::obs::CRawlog::CreateObject ( )
static

◆ CreateUnique()

template<typename... Args>
static UniquePtr mrpt::obs::CRawlog::CreateUnique ( Args &&...  args)
inlinestatic

Definition at line 70 of file CRawlog.h.

◆ detectImagesDirectory()

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::img::CImage::getImagesPathBase() to enable automatic loading of extenrnally-stored images in rawlogs.

Definition at line 557 of file CRawlog.cpp.

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

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr 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 169 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by addActions(), and addObservations().

◆ end() [1/2]

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

Definition at line 348 of file CRawlog.h.

References m_seqOfActObs.

◆ end() [2/2]

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

Definition at line 347 of file CRawlog.h.

References m_seqOfActObs.

◆ erase()

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

Definition at line 349 of file CRawlog.h.

References mrpt::obs::CRawlog::iterator::erase(), and m_seqOfActObs.

◆ findObservationsByClassInRange()

void CRawlog::findObservationsByClassInRange ( mrpt::system::TTimeStamp  time_start,
mrpt::system::TTimeStamp  time_end,
const mrpt::rtti::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 435 of file CRawlog.cpp.

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

◆ getActionObservationPair()

bool CRawlog::getActionObservationPair ( CActionCollection::Ptr action,
CSensoryFrame::Ptr 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::reset), 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 516 of file CRawlog.cpp.

Referenced by run_test_pf_localization().

◆ getActionObservationPairOrObservation()

bool CRawlog::getActionObservationPairOrObservation ( mrpt::serialization::CArchive inStream,
CActionCollection::Ptr action,
CSensoryFrame::Ptr observations,
CObservation::Ptr 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::reset), 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() evaluates as true).
  • observation contains an object (i.e. observation 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 373 of file CRawlog.cpp.

References CLASS_ID, IS_CLASS, and IS_DERIVED.

◆ getAsAction()

CActionCollection::Ptr 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 89 of file CRawlog.cpp.

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

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

◆ getAsGeneric()

CSerializable::Ptr 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 121 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ getAsObservation()

CObservation::Ptr 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 105 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().

◆ getAsObservations()

CSensoryFrame::Ptr 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 149 of file CRawlog.cpp.

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

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

◆ getClassName()

static constexpr auto mrpt::obs::CRawlog::getClassName ( )
inlinestaticconstexpr

Definition at line 70 of file CRawlog.h.

◆ getCommentText() [1/2]

std::string CRawlog::getCommentText ( ) const

Returns the block of comment text for the rawlog.

Definition at line 549 of file CRawlog.cpp.

◆ getCommentText() [2/2]

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

Returns the block of comment text for the rawlog.

Definition at line 548 of file CRawlog.cpp.

◆ getCommentTextAsConfigFile()

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

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

Definition at line 550 of file CRawlog.cpp.

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

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

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::obs::CRawlog::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::serialization::CSerializable.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::obs::CRawlog::GetRuntimeClassIdStatic ( )
static

◆ getType()

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

Returns the type of a given element.

See also
isAction, isObservation

Definition at line 130 of file CRawlog.cpp.

References CLASS_ID, MRPT_END, MRPT_START, and THROW_EXCEPTION.

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

◆ loadFromRawLogFile()

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 190 of file CRawlog.cpp.

References mrpt::serialization::archiveFrom(), CLASS_ID, mrpt::containers::clear(), mrpt::io::CFileGZInputStream::fileOpenCorrectly(), and IS_CLASS.

Referenced by run_test_pf_localization(), and TEST().

◆ operator delete() [1/3]

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

Definition at line 70 of file CRawlog.h.

◆ operator delete() [2/3]

void mrpt::obs::CRawlog::operator delete ( void ptr)
inlinenoexcept

Definition at line 70 of file CRawlog.h.

◆ operator delete() [3/3]

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

Definition at line 70 of file CRawlog.h.

◆ operator delete[]()

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

Definition at line 70 of file CRawlog.h.

◆ operator new() [1/3]

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

Definition at line 70 of file CRawlog.h.

◆ operator new() [2/3]

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

Definition at line 70 of file CRawlog.h.

◆ operator new() [3/3]

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

Definition at line 70 of file CRawlog.h.

◆ operator new[]()

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

Definition at line 70 of file CRawlog.h.

◆ readActionObservationPair()

bool CRawlog::readActionObservationPair ( mrpt::serialization::CArchive inStream,
CActionCollection::Ptr action,
CSensoryFrame::Ptr 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::reset), 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 314 of file CRawlog.cpp.

References CLASS_ID.

◆ remove() [1/2]

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 278 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ remove() [2/2]

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 270 of file CRawlog.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

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

◆ saveToRawLogFile()

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 290 of file CRawlog.cpp.

References mrpt::serialization::archiveFrom().

◆ serializeFrom()

void CRawlog::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

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 I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 172 of file CRawlog.cpp.

References mrpt::containers::clear(), and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ serializeGetVersion()

uint8_t CRawlog::serializeGetVersion ( ) const
overrideprotectedvirtual

Must return the current versioning number of the object.

Start in zero for new classes, and increments each time there is a change in the stored format.

Implements mrpt::serialization::CSerializable.

Definition at line 164 of file CRawlog.cpp.

◆ serializeTo()

void CRawlog::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 165 of file CRawlog.cpp.

References mrpt::serialization::CArchive::WriteAs().

◆ setCommentText()

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

Changes the block of comment text for the rawlog.

Definition at line 556 of file CRawlog.cpp.

◆ size()

size_t CRawlog::size ( ) const

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

Definition at line 88 of file CRawlog.cpp.

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

◆ swap()

void CRawlog::swap ( CRawlog obj)

Efficiently swap the contents of two existing objects.

Definition at line 307 of file CRawlog.cpp.

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::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 nullptr is class does not support conversion to MATLAB.

Definition at line 70 of file CSerializable.h.

Member Data Documentation

◆ _init_CRawlog

mrpt::rtti::CLASSINIT mrpt::obs::CRawlog::_init_CRawlog
staticprotected

Definition at line 70 of file CRawlog.h.

◆ className

constexpr const char* mrpt::obs::CRawlog::className = "CRawlog"
staticconstexpr

Definition at line 70 of file CRawlog.h.

◆ m_commentTexts

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

Comments of the rawlog.

Definition at line 78 of file CRawlog.h.

◆ m_seqOfActObs

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

The list where the objects really are in.

Definition at line 75 of file CRawlog.h.

Referenced by begin(), end(), and erase().

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::obs::CRawlog::runtimeClassId
staticprotected

Definition at line 70 of file CRawlog.h.




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