87 template <
class POINTSMAP>
105 template <
class POINTSMAP>
107 const void* options =
nullptr)
const 200 template <
typename T>
204 size_t foundCount = 0;
206 &T::GetRuntimeClassIdStatic();
207 for (
const auto& it : *
this)
208 if (it->GetRuntimeClass()->derivedFrom(class_ID))
209 if (foundCount++ == ith)
210 return std::dynamic_pointer_cast<T>(it);
211 return typename T::Ptr();
217 using iterator = std::deque<CObservation::Ptr>::iterator;
305 template <
typename T>
308 return std::dynamic_pointer_cast<
typename T::element_type>(
318 const std::string& label,
size_t idx = 0)
const;
327 template <
typename T>
329 const std::string& label,
size_t idx = 0)
const 331 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 eraseByIndex(size_t idx)
Removes the i'th observation in the list (0=first).
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...
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().
T::Ptr getObservationByClass(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 erase(const iterator &it)
Removes the given observation in the list, and return an iterator to the next element (or this->end()...
T getObservationByIndexAs(size_t idx) const
Returns the i'th observation in the list (0=first), and as a different smart pointer type: ...
CSensoryFrame()=default
Default constructor.
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage: ...
const CObservation::Ptr & getObservationByIndex(size_t idx) const
Returns the i'th observation in the list (0=first).
void swap(CSensoryFrame &sf)
Efficiently swaps the contents of two objects.
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...
void operator+=(const CSensoryFrame &sf)
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
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:
T getObservationBySensorLabelAs(const std::string &label, size_t idx=0) const
Returns the i'th observation in the list with the given "sensorLabel" (0=first), and as a different s...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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: ...
iterator end()
Returns a iterator to the end of the list of observations: this is an example of usage: ...
CObservation::Ptr getObservationBySensorLabel(const std::string &label, size_t idx=0) const
Returns the i'th observation in the list with the given "sensorLabel" (0=first).
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.
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()