9 #ifndef CSENSORYFRAME_H 10 #define CSENSORYFRAME_H 88 template <
class POINTSMAP>
106 template <
class POINTSMAP>
108 const void* options =
nullptr)
const 210 template <
typename T>
214 size_t foundCount = 0;
216 &T::GetRuntimeClassIdStatic();
218 if ((*it)->GetRuntimeClass()->derivedFrom(class_ID))
219 if (foundCount++ == ith)
220 return std::dynamic_pointer_cast<T>(*it);
221 return typename T::Ptr();
313 template <
typename T>
316 return std::dynamic_pointer_cast<
typename T::element_type>(
326 const std::string& label,
const size_t& idx = 0)
const;
335 template <
typename T>
337 const std::string& label,
const size_t& idx = 0)
const 339 return std::dynamic_pointer_cast<
typename T::element_type>(
void clear()
Clear all current observations.
void insert(const CObservation::Ptr &obs)
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the p...
std::deque< CObservation::Ptr >::iterator iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
void push_back(const CObservation::Ptr &obs)
Inserts a new observation to the list: The pointer to the objects is copied, thus DO NOT delete the p...
void moveFrom(CSensoryFrame &sf)
Copies all the observation from another object, then erase them from the origin object (this method i...
CSensoryFrame & operator=(const CSensoryFrame &o)
Copy.
A structure that holds runtime class type information.
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
iterator erase(const iterator &it)
Removes the given observation in the list, and return an iterator to the next element (or this->end()...
CSensoryFrame()=default
Default constructor.
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage: ...
void swap(CSensoryFrame &sf)
Efficiently swaps the contents of two objects.
T getObservationBySensorLabelAs(const std::string &label, const size_t &idx=0) const
Returns the i'th observation in the list with the given "sensorLabel" (0=first), and as a different s...
void eraseByIndex(const size_t &idx)
Removes the i'th observation in the list (0=first).
void operator+=(const CSensoryFrame &sf)
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
std::deque< CObservation::Ptr >::const_iterator const_iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
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...
T getObservationByIndexAs(const size_t &idx) const
Returns the i'th observation in the list (0=first), and as a different smart pointer type: ...
GLsizei const GLchar ** string
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CObservation::Ptr getObservationBySensorLabel(const std::string &label, const size_t &idx=0) const
Returns the i'th observation in the list with the given "sensorLabel" (0=first).
const POINTSMAP * buildAuxPointsMap(const void *options=nullptr) const
Returns a cached points map representing this laser scan, building it upon the first call...
Declares a virtual base class for all metric maps storage classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
const POINTSMAP * getAuxPointsMap() const
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(), or nullptr otherwise.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
iterator begin()
Returns a iterator to the first observation: this is an example of usage:
bool insertObservationsInto(mrpt::maps::CMetricMap::Ptr &theMap, const mrpt::poses::CPose3D *robotPose=nullptr) const
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap).
const_iterator end() const
Returns a constant iterator to the end of the list of observations: this is an example of usage: ...
CObservation::Ptr getObservationByIndex(const size_t &idx) const
Returns the i'th observation in the list (0=first).
T::Ptr getObservationByClass(const size_t &ith=0) const
Returns the i'th observation of a given class (or of a descendant class), or nullptr if there is no s...
iterator end()
Returns a iterator to the end of the list of observations: this is an example of usage: ...
bool insertObservationsInto(mrpt::maps::CMetricMap *theMap, const mrpt::poses::CPose3D *robotPose=nullptr) const
Insert all the observations in this SF into a metric map or any kind (see mrpt::maps::CMetricMap).
size_t size() const
Returns the number of observations in the list.
const Scalar * const_iterator
std::deque< CObservation::Ptr > m_observations
The set of observations taken at the same time instant.
void eraseByLabel(const std::string &label)
Removes all the observations that match a given sensorLabel.
bool empty() const
Returns true if there are no observations in the list.
void internal_buildAuxPointsMap(const void *options=nullptr) const
Internal method, used from buildAuxPointsMap()