30     m_seqOfActObs.clear();
    31     m_commentTexts.text.clear();
    36     m_seqOfActObs.push_back(std::dynamic_pointer_cast<CSerializable>(
    42     m_seqOfActObs.push_back(std::dynamic_pointer_cast<CSerializable>(
    54         m_seqOfActObs.push_back(obj);
    61     m_seqOfActObs.push_back(temp);
    69     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
    74         return std::dynamic_pointer_cast<CActionCollection>(obj);
    77             "Element at index %i is not a CActionCollection", (
int)index);
    85     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
    90         return std::dynamic_pointer_cast<CObservation>(obj);
    93             "Element at index %i is not a CObservation", (
int)index);
   100     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
   102     return m_seqOfActObs[index];
   109     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
   114         return etObservation;
   116         return etActionCollection;
   118         return etSensoryFrame;
   128     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
   133         return std::dynamic_pointer_cast<CSensoryFrame>(obj);
   136             "Element at index %i is not a CSensoryFrame", (
int)index);
   140 uint8_t CRawlog::serializeGetVersion()
 const { 
return 1; }
   143     out.WriteAs<uint32_t>(m_seqOfActObs.size());
   144     for (
const auto& a : m_seqOfActObs) 
out << a;
   145     out << m_commentTexts;
   156             m_seqOfActObs.resize(in.
ReadAs<uint32_t>());
   157             for (
auto& a : m_seqOfActObs) a = in.
ReadObject();
   158             in >> m_commentTexts;
   166 bool CRawlog::loadFromRawLogFile(
   167     const std::string& fileName, 
bool non_obs_objects_are_legal)
   171     if (!fi.
open(fileName)) 
return false;
   177     bool keepReading = 
true;
   184             bool add_obj = 
false;
   193             else if (newObj->GetRuntimeClass()->derivedFrom(
   218                 if (non_obs_objects_are_legal)
   227             if (add_obj) m_seqOfActObs.push_back(newObj);
   233         catch (
const std::exception& e)
   246 void CRawlog::remove(
size_t index)
   249     if (index >= m_seqOfActObs.size()) 
THROW_EXCEPTION(
"Index out of bounds");
   250     m_seqOfActObs.erase(m_seqOfActObs.begin() + index);
   254 void CRawlog::remove(
size_t first_index, 
size_t last_index)
   257     if (first_index >= m_seqOfActObs.size() ||
   258         last_index >= m_seqOfActObs.size())
   261         m_seqOfActObs.begin() + first_index,
   262         m_seqOfActObs.begin() + last_index + 1);
   266 bool CRawlog::saveToRawLogFile(
const std::string& fileName)
 const   272         if (!m_commentTexts.text.empty()) f << m_commentTexts;
   273         for (
const auto& m_seqOfActOb : m_seqOfActObs) f << *m_seqOfActOb;
   276     catch (
const std::exception& e)
   285     if (
this == &obj) 
return;
   290 bool CRawlog::readActionObservationPair(
   314         observations.reset();
   315         while (!observations)
   321                 observations = std::dynamic_pointer_cast<
CSensoryFrame>(obj);
   335     catch (
const std::exception& e)
   337         std::cerr << 
"[CRawlog::readActionObservationPair] Found exception:"   344         std::cerr << 
"Untyped exception reading rawlog file!!" << std::endl;
   349 bool CRawlog::getActionObservationPairOrObservation(
   357         observations.reset();
   370                 observation = std::dynamic_pointer_cast<
CObservation>(obj);
   380         observations.reset();
   381         while (!observations)
   387                 observations = std::dynamic_pointer_cast<
CSensoryFrame>(obj);
   397     catch (
const std::exception& e)
   399         std::cerr << 
"[CRawlog::readActionObservationPair] Found exception:"   406         std::cerr << 
"Untyped exception reading rawlog file!!" << std::endl;
   411 void CRawlog::findObservationsByClassInRange(
   415     [[maybe_unused]] 
size_t guess_start_position)
 const   421     if (m_seqOfActObs.empty()) 
return;
   425     auto first = m_seqOfActObs.begin();
   426     const auto last = m_seqOfActObs.end();
   435             std::advance(it, step);
   443                 this_timestamp = o->timestamp;
   448                     "Element found which is not derived from CObservation");
   450             if (this_timestamp < time_start)  
   462     while (first != last)
   469             this_timestamp = o->timestamp;
   472             if (this_timestamp < time_end)
   474                 if (o->GetRuntimeClass()->derivedFrom(class_type))
   484                 "Element found which is not derived from CObservation");
   492 bool CRawlog::getActionObservationPair(
   494     size_t& rawlogEntry)
 const   498         while (getType(rawlogEntry) != CRawlog::etActionCollection)
   502         action = getAsAction(rawlogEntry++);
   504         while (getType(rawlogEntry) != CRawlog::etSensoryFrame)
   508         observations = getAsObservations(rawlogEntry++);
   512     catch (
const std::exception& e)
   519         std::cerr << 
"Untyped exception getting act-obs pair from rawlog!!"   525 void CRawlog::getCommentText(std::string& t)
 const { t = m_commentTexts.text; }
   526 std::string CRawlog::getCommentText()
 const { 
return m_commentTexts.text; }
   527 void CRawlog::getCommentTextAsConfigFile(
   533 void CRawlog::setCommentText(
const std::string& t) { m_commentTexts.text = t; }
   534 std::string CRawlog::detectImagesDirectory(
const std::string& str)
   537     std::string temptative_img_path =
   540         return temptative_img_path;
   542                  temptative_img_path =
   544                       std::string(
"_images"))))
   545         return temptative_img_path;
   547                  temptative_img_path =
   549                       std::string(
"_IMAGES"))))
   550         return temptative_img_path;
   552         return rawlog_path + 
"Images";
 
This class implements a config file-like interface over a memory-stored string list. 
 
TListObjects m_seqOfActObs
The list where the objects really are in. 
 
#define THROW_EXCEPTION(msg)
 
size_t size(const MATRIXLIKE &m, const int dim)
 
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files. 
 
bool fileExists(const std::string &fileName)
Test if a given file (or directory) exists. 
 
A structure that holds runtime class type information. 
 
Declares a class for storing a collection of robot actions. 
 
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations. 
 
CArchiveStreamBase< STREAM > archiveFrom(STREAM &s)
Helper function to create a templatized wrapper CArchive object for a: MRPT's CStream, std::istream, std::ostream, std::stringstream. 
 
std::pair< mrpt::system::TTimeStamp, CObservation::Ptr > TTimeObservationPair
For usage with CRawlog classes. 
 
#define ASSERT_(f)
Defines an assertion mechanism. 
 
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
 
#define CLASS_ID(T)
Access to runtime class ID for a defined class name. 
 
std::multimap< mrpt::system::TTimeStamp, CObservation::Ptr > TListTimeAndObservations
For usage with CRawlog classes. 
 
STORED_TYPE ReadAs()
De-serialize a variable and returns it by value. 
 
#define IS_DERIVED(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is an instance of the given ...
 
This class stores a rawlog (robotic datasets) in one of two possible formats: 
 
This namespace contains representation of robot actions and observations. 
 
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
 
#define IS_CLASS(obj, class_name)
True if the given reference to object (derived from mrpt::rtti::CObject) is of the given class...
 
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
 
Declares a class for storing a robot action. 
 
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries. 
 
Virtual base class for "archives": classes abstracting I/O streams. 
 
mrpt::vision::TStereoCalibResults out
 
Declares a class that represents any robot's observation. 
 
void setContent(const std::vector< std::string > &stringList)
Changes the contents of the virtual "config file". 
 
TEntryType
The type of each entry in a rawlog. 
 
CSerializable::Ptr ReadObject()
Reads an object from stream, its class determined at runtime, and returns a smart pointer to the obje...
 
The virtual base class which provides a unified interface for all persistent objects in MRPT...
 
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
 
Saves data to a file and transparently compress the data using the given compression level...
 
std::string extractFileName(const std::string &filePath)
Extract just the name (without extension) of a filename from a complete path plus name plus extension...
 
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
 
void clear()
Clear the contents of this container. 
 
CObservationComment m_commentTexts
Comments of the rawlog. 
 
#define INVALID_TIMESTAMP
Represents an invalid timestamp, where applicable. 
 
std::string extractFileDirectory(const std::string &filePath)
Extract the whole path (the directory) of a filename from a complete path plus name plus extension...
 
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space. 
 
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr() const
Makes a deep copy of the object and returns a smart pointer to it. 
 
Used in mrpt::serialization::CArchive.