21 std::pair<mrpt::system::TTimeStamp, CObservation::Ptr>;
24 std::multimap<mrpt::system::TTimeStamp, CObservation::Ptr>;
70 using TListObjects = std::vector<mrpt::serialization::CSerializable::Ptr>;
79 virtual ~CRawlog()
override =
default;
139 const std::string& fileName,
bool non_obs_objects_are_legal =
false);
160 void remove(
size_t index);
166 void remove(
size_t first_index,
size_t last_index);
212 ASSERTMSG_(ptr,
"Could not convert observation to specified class");
222 ASSERTMSG_(ptr,
"Could not convert observation to specified class");
270 else if ((*m_it)->GetRuntimeClass()->derivedFrom(
288 TListObjects::const_iterator
m_it;
328 else if ((*m_it)->GetRuntimeClass()->derivedFrom(
356 size_t guess_start_position = 0)
const;
397 size_t& rawlogEntry);
411 size_t& rawlogEntry)
const;
This class implements a config file-like interface over a memory-stored string list.
bool operator==(const iterator &o)
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 < ti...
TListObjects m_seqOfActObs
The list where the objects really are in.
const_iterator end() const
std::vector< mrpt::serialization::CSerializable::Ptr > TListObjects
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...
static std::string detectImagesDirectory(const std::string &rawlogFilename)
Tries to auto-detect the external-images directory of the given rawlog file.
T::ConstPtr asObservation(size_t index) const
Get the i'th observation as an observation of the given type.
iterator erase(const iterator &it)
const_iterator & operator++()
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
const_iterator & operator--()
const_iterator operator--(int)
A structure that holds runtime class type information.
virtual ~CRawlog() override=default
mrpt::serialization::CSerializable::Ptr operator*()
const_iterator(const TListObjects::const_iterator &it)
TListObjects::const_iterator m_it
TEntryType getType() const
bool operator!=(const const_iterator &o)
Declares a class for storing a collection of robot actions.
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...
bool saveToRawLogFile(const std::string &fileName) const
Saves the contents to a rawlog-file, compatible with RawlogViewer (As the sequence of internal object...
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...
std::string getCommentText() const
Returns the block of comment text for the rawlog.
std::pair< mrpt::system::TTimeStamp, CObservation::Ptr > TTimeObservationPair
For usage with CRawlog classes.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
bool loadFromRawLogFile(const std::string &fileName, bool non_obs_objects_are_legal=false)
Load the contents from a file containing one of these possibilities:
mrpt::serialization::CSerializable::Ptr getAsGeneric(size_t index) const
Returns the i'th element in the sequence, being its class whatever.
#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.
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...
const_iterator operator++(int)
virtual ~const_iterator()=default
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 ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
void setCommentText(const std::string &t)
Changes the block of comment text for the rawlog.
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
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...
Declares a class for storing a robot action.
TEntryType getType() const
virtual ~iterator()=default
Virtual base class for "archives": classes abstracting I/O streams.
Declares a class that represents any robot's observation.
TEntryType
The type of each entry in a rawlog.
TListObjects::iterator m_it
void insert(CAction &action)
Add an action to the sequence: a collection of just one element is created.
bool operator!=(const iterator &o)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
void swap(CRawlog &obj)
Efficiently swap the contents of two existing objects.
void clear()
Clear the sequence of actions/observations.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
TEntryType getType(size_t index) const
Returns the type of a given element.
iterator(const TListObjects::iterator &it)
T::Ptr asObservation(size_t index)
static iterator erase(TListObjects &lst, const iterator &it)
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...
size_t size() const
Returns the number of actions / observations object in the sequence.
void getCommentTextAsConfigFile(mrpt::config::CConfigFileMemory &memCfg) const
Saves the block of comment text for the rawlog into the passed config file object.
CObservationComment m_commentTexts
Comments of the rawlog.
bool operator==(const const_iterator &o)
const mrpt::serialization::CSerializable::Ptr operator*() const
const_iterator begin() const
iterator & operator=(const iterator &o)=default