Go to the documentation of this file.
9 #ifndef CSENSORYFRAME_H
10 #define CSENSORYFRAME_H
90 template <
class POINTSMAP>
108 template <
class POINTSMAP>
110 const void* options =
nullptr)
const
212 template <
typename T>
216 size_t foundCount = 0;
218 &T::GetRuntimeClassIdStatic();
220 if ((*it)->GetRuntimeClass()->derivedFrom(class_ID))
221 if (foundCount++ == ith)
222 return std::dynamic_pointer_cast<T>(*it);
223 return typename T::Ptr();
315 template <
typename T>
318 return std::dynamic_pointer_cast<typename T::element_type>(
328 const std::string& label,
const size_t& idx = 0)
const;
337 template <
typename T>
339 const std::string& label,
const size_t& idx = 0)
const
341 return std::dynamic_pointer_cast<typename T::element_type>(
bool empty() const
Returns true if there are no observations in the list.
std::shared_ptr< CObservation > Ptr
const Scalar * const_iterator
A structure that holds runtime class type information.
void clear()
Clear all current observations.
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
CSensoryFrame()=default
Default constructor.
const_iterator end() const
Returns a constant iterator to the end of the list of observations: this is an example of usage:
std::deque< CObservation::Ptr > m_observations
The set of observations taken at the same time instant.
const POINTSMAP * getAuxPointsMap() const
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(),...
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).
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).
void swap(CSensoryFrame &sf)
Efficiently swaps the contents of two objects.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
T getObservationByIndexAs(const size_t &idx) const
Returns the i'th observation in the list (0=first), and as a different smart pointer type:
iterator erase(const iterator &it)
Removes the given observation in the list, and return an iterator to the next element (or this->end()...
size_t size() const
Returns the number of observations in the list.
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
Declares a virtual base class for all metric maps storage classes.
iterator end()
Returns a iterator to the end of the list of observations: this is an example of usage:
void internal_buildAuxPointsMap(const void *options=nullptr) const
Internal method, used from buildAuxPointsMap()
void moveFrom(CSensoryFrame &sf)
Copies all the observation from another object, then erase them from the origin object (this method i...
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage:
void operator+=(const CSensoryFrame &sf)
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
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...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
The virtual base class which provides a unified interface for all persistent objects in MRPT.
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::shared_ptr< CMetricMap > Ptr
void eraseByIndex(const size_t &idx)
Removes the i'th observation in the list (0=first).
std::deque< CObservation::Ptr >::const_iterator const_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...
std::deque< CObservation::Ptr >::iterator iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
const POINTSMAP * buildAuxPointsMap(const void *options=nullptr) const
Returns a cached points map representing this laser scan, building it upon the first call.
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).
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...
CObservation::Ptr getObservationByIndex(const size_t &idx) const
Returns the i'th observation in the list (0=first).
CSensoryFrame & operator=(const CSensoryFrame &o)
Copy.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void eraseByLabel(const std::string &label)
Removes all the observations that match a given sensorLabel.
GLsizei const GLchar ** string
iterator begin()
Returns a iterator to the first observation: this is an example of usage:
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |