22 std::pair<mrpt::system::TTimeStamp, CObservation::Ptr>;
25 std::multimap<mrpt::system::TTimeStamp, CObservation::Ptr>;
71 using TListObjects = std::vector<mrpt::serialization::CSerializable::Ptr>;
166 const std::string& fileName,
bool non_obs_objects_are_legal =
false);
193 void remove(
size_t first_index,
size_t last_index);
277 else if ((*m_it)->GetRuntimeClass()->derivedFrom(
335 else if ((*m_it)->GetRuntimeClass()->derivedFrom(
363 size_t guess_start_position = 0)
const;
404 size_t& rawlogEntry);
418 size_t& rawlogEntry)
const;
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
This class implements a config file-like interface over a memory-stored string list.
Declares a class for storing a collection of robot actions.
std::shared_ptr< CActionCollection > Ptr
Declares a class for storing a robot action.
Declares a class that represents any robot's observation.
std::shared_ptr< CObservation > Ptr
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
TListObjects::const_iterator m_it
TEntryType getType() const
virtual ~const_iterator()
const_iterator & operator++()
const_iterator operator++(int)
bool operator!=(const const_iterator &o)
const mrpt::serialization::CSerializable::Ptr operator*() const
const_iterator & operator--()
const_iterator operator--(int)
bool operator==(const const_iterator &o)
const_iterator(const TListObjects::const_iterator &it)
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
TListObjects::iterator m_it
TEntryType getType() const
iterator(const TListObjects::iterator &it)
iterator & operator=(const iterator &o)
static iterator erase(TListObjects &lst, const iterator &it)
bool operator!=(const iterator &o)
bool operator==(const iterator &o)
mrpt::serialization::CSerializable::Ptr operator*()
This class stores a rawlog (robotic datasets) in one of two possible formats:
void swap(CRawlog &obj)
Efficiently swap the contents of two existing objects.
void addObservations(CSensoryFrame &observations)
Add a set of observations to the sequence; the object is duplicated, so the original one can be free ...
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.
void addObservationMemoryReference(const CObservation::Ptr &observation)
Add a single observation to the sequence, using a smart pointer to the object to add.
void setCommentText(const std::string &t)
Changes the block of comment text for the rawlog.
const_iterator begin() const
void addActions(CActionCollection &action)
Add a set of actions to the sequence; the object is duplicated, so the original one can be freed if d...
bool loadFromRawLogFile(const std::string &fileName, bool non_obs_objects_are_legal=false)
Load the contents from a file containing one of these possibilities:
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.
void getCommentTextAsConfigFile(mrpt::config::CConfigFileMemory &memCfg) const
Saves the block of comment text for the rawlog into the passed config file object.
bool saveToRawLogFile(const std::string &fileName) const
Saves the contents to a rawlog-file, compatible with RawlogViewer (As the sequence of internal object...
std::vector< mrpt::serialization::CSerializable::Ptr > TListObjects
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...
static std::string detectImagesDirectory(const std::string &rawlogFilename)
Tries to auto-detect the external-images directory of the given rawlog file.
void addObservationsMemoryReference(const CSensoryFrame::Ptr &observations)
Add a set of observations to the sequence, using a smart pointer to the object to add.
CRawlog()
Default constructor.
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.
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.
void remove(size_t index)
Delete the action or observation stored in the given index.
void addAction(CAction &action)
Add an action to the sequence: a collection of just one element is created.
void addGenericObject(const mrpt::serialization::CSerializable::Ptr &obj)
Generic add for a smart pointer to a CSerializable object:
TListObjects m_seqOfActObs
The list where the objects really are in.
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.
void addActionsMemoryReference(const CActionCollection::Ptr &action)
Add a set of actions to the sequence, using a smart pointer to the object to add.
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,...
TEntryType
The type of each entry in a rawlog.
virtual ~CRawlog()
Destructor:
void clear()
Clear the sequence of actions/observations.
const_iterator end() const
std::string getCommentText() const
Returns the block of comment text for the rawlog.
mrpt::serialization::CSerializable::Ptr getAsGeneric(size_t index) const
Returns the i'th element in the sequence, being its class whatever.
size_t size() const
Returns the number of actions / observations object in the sequence.
CObservationComment m_commentTexts
Comments of the rawlog.
iterator erase(const iterator &it)
TEntryType getType(size_t index) const
Returns the type of a given element.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
std::shared_ptr< CSensoryFrame > Ptr
Virtual base class for "archives": classes abstracting I/O streams.
The virtual base class which provides a unified interface for all persistent objects in MRPT.
std::shared_ptr< CSerializable > Ptr
const Scalar * const_iterator
GLsizei GLsizei GLuint * obj
GLsizei const GLchar ** string
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
This namespace contains representation of robot actions and observations.
std::multimap< mrpt::system::TTimeStamp, CObservation::Ptr > TListTimeAndObservations
For usage with CRawlog classes.
std::pair< mrpt::system::TTimeStamp, CObservation::Ptr > TTimeObservationPair
For usage with CRawlog classes.
A structure that holds runtime class type information.