Go to the documentation of this file.
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>(
bool empty() const
Returns true if there are no observations in the list.
std::shared_ptr< CObservation > Ptr
A structure that holds runtime class type information.
void clear()
Clear all current observations.
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...
mrpt::maps::CMetricMap::Ptr m_cachedMap
A points map, build only under demand by the methods getAuxPointsMap() and buildAuxPointsMap().
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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.
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...
const POINTSMAP * getAuxPointsMap() const
Returns the cached points map representation of the scan, if already build with buildAuxPointsMap(),...
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 namespace contains representation of robot actions and observations.
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()
const_iterator begin() const
Returns a constant iterator to the first observation: this is an example of usage:
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
const CObservation::Ptr & getObservationByIndex(size_t idx) const
Returns 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 operator+=(const CSensoryFrame &sf)
You can use "sf1+=sf2;" to add observations in sf2 to sf1.
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).
CSensoryFrame & operator=(const CSensoryFrame &o)
Copy.
void eraseByLabel(const std::string &label)
Removes all the observations that match a given sensorLabel.
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).
void eraseByIndex(size_t idx)
Removes the i'th observation in the list (0=first).
T getObservationByIndexAs(size_t idx) const
Returns the i'th observation in the list (0=first), and as a different smart pointer type:
iterator begin()
Returns a iterator to the first observation: this is an example of usage:
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |