Go to the documentation of this file.
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>;
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;
std::string getCommentText() const
Returns the block of comment text for the rawlog.
virtual ~CRawlog() override=default
std::shared_ptr< CObservation > Ptr
This class stores a rawlog (robotic datasets) in one of two possible formats:
const mrpt::serialization::CSerializable::Ptr operator*() const
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,...
A structure that holds runtime class type information.
iterator & operator=(const iterator &o)=default
std::shared_ptr< CSerializable > Ptr
bool operator!=(const iterator &o)
#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.
std::multimap< mrpt::system::TTimeStamp, CObservation::Ptr > TListTimeAndObservations
For usage with CRawlog classes.
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.
std::shared_ptr< mrpt::obs ::CSensoryFrame > Ptr
TEntryType getType() const
void swap(CRawlog &obj)
Efficiently swap the contents of two existing objects.
virtual ~iterator()=default
const_iterator begin() const
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...
virtual ~const_iterator()=default
iterator erase(const iterator &it)
void getCommentTextAsConfigFile(mrpt::config::CConfigFileMemory &memCfg) const
Saves the block of comment text for the rawlog into the passed config file object.
mrpt::serialization::CSerializable::Ptr operator*()
std::shared_ptr< mrpt::obs ::CActionCollection > Ptr
Declares a class for storing a collection of robot actions.
TEntryType
The type of each entry in a rawlog.
This namespace contains representation of robot actions and observations.
static std::string detectImagesDirectory(const std::string &rawlogFilename)
Tries to auto-detect the external-images directory of the given rawlog file.
CObservationComment m_commentTexts
Comments of the rawlog.
Virtual base class for "archives": classes abstracting I/O streams.
void insert(CAction &action)
Add an action to the sequence: a collection of just one element is created.
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
const_iterator operator--(int)
std::pair< mrpt::system::TTimeStamp, CObservation::Ptr > TTimeObservationPair
For usage with CRawlog classes.
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.
const_iterator(const TListObjects::const_iterator &it)
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
TListObjects m_seqOfActObs
The list where the objects really are in.
bool loadFromRawLogFile(const std::string &fileName, bool non_obs_objects_are_legal=false)
Load the contents from a file containing one of these possibilities:
void clear()
Clear the sequence of actions/observations.
bool saveToRawLogFile(const std::string &fileName) const
Saves the contents to a rawlog-file, compatible with RawlogViewer (As the sequence of internal object...
bool operator!=(const const_iterator &o)
const_iterator operator++(int)
bool operator==(const const_iterator &o)
size_t size() const
Returns the number of actions / observations object in the sequence.
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.
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.
A normal iterator, plus the extra method "getType" to determine the type of each entry in the sequenc...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
std::vector< mrpt::serialization::CSerializable::Ptr > TListObjects
mrpt::serialization::CSerializable::Ptr getAsGeneric(size_t index) const
Returns the i'th element in the sequence, being its class whatever.
T::ConstPtr asObservation(size_t index) const
Get the i'th observation as an observation of the given type.
T::Ptr asObservation(size_t index)
const_iterator end() const
iterator(const TListObjects::iterator &it)
static iterator erase(TListObjects &lst, const iterator &it)
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
TEntryType getType() const
#define CLASS_ID(T)
Access to runtime class ID for a defined class name.
const_iterator & operator--()
Declares a class that represents any robot's observation.
const_iterator & operator++()
Declares a class for storing a robot action.
This class implements a config file-like interface over a memory-stored string list.
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.
TListObjects::const_iterator m_it
bool operator==(const iterator &o)
void setCommentText(const std::string &t)
Changes the block of comment text for the rawlog.
void remove(size_t index)
Delete the action or observation stored in the given index.
TListObjects::iterator m_it
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |