9 #ifndef CSENSORYFRAME_H
10 #define CSENSORYFRAME_H
65 CSensoryFrame( const CSensoryFrame &);
73 mutable
mrpt::slam::CMetricMapPtr m_cachedMap;
75 void internal_buildAuxPointsMap( const
void *options = NULL ) const;
86 template <class POINTSMAP>
87 inline const POINTSMAP* getAuxPointsMap()
const {
88 return static_cast<POINTSMAP*
>(m_cachedMap.pointer());
99 template <
class POINTSMAP>
101 internal_buildAuxPointsMap(options);
102 return static_cast<POINTSMAP*
>(m_cachedMap.pointer());
144 return insertObservationsInto(theMap.pointer(), robotPose);
165 void push_back(
const CObservationPtr &obs);
169 void insert(
const CObservationPtr &obs);
178 template <
typename T>
182 size_t foundCount = 0;
185 if ( (*it)->GetRuntimeClass()->derivedFrom( class_ID ) )
186 if (foundCount++ == ith)
187 return typename T::SmartPtr(*it);
188 return typename T::SmartPtr();
211 const_iterator
begin()
const {
return m_observations.begin(); }
224 const_iterator
end()
const {
return m_observations.end(); }
237 iterator
begin() {
return m_observations.begin(); }
250 inline iterator
end() {
return m_observations.end(); }
254 inline size_t size()
const {
return m_observations.size(); }
257 inline bool empty()
const {
return m_observations.empty(); }
260 void eraseByIndex(
const size_t &idx);
264 iterator erase(
const iterator &it);
268 void eraseByLabel(
const std::string &label);
273 CObservationPtr getObservationByIndex(
const size_t &idx )
const;
281 template <
typename T>
284 return static_cast<T
>(getObservationByIndex(idx));
291 CObservationPtr getObservationBySensorLabel(
const std::string &label,
const size_t &idx = 0)
const;
299 template <
typename T>
302 return T(getObservationBySensorLabel(label,idx));
bool insertObservationsInto(mrpt::slam::CMetricMapPtr &theMap, const mrpt::poses::CPose3D *robotPose=NULL) const
Insert all the observations in this SF into a metric map or any kind (see mrpt::slam::CMetricMap).
EIGEN_STRONG_INLINE iterator end()
The virtual base class which provides a unified interface for all persistent objects in MRPT...
size_t size() const
Returns the number of observations in the list.
EIGEN_STRONG_INLINE iterator begin()
EIGEN_STRONG_INLINE void push_back(Scalar val)
Insert an element at the end of the container (for 1D vectors/arrays)
const Scalar * const_iterator
const POINTSMAP * buildAuxPointsMap(const void *options=NULL) const
Returns a cached points map representing this laser scan, building it upon the first call...
std::deque< CObservationPtr >::const_iterator const_iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
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: ...
const_iterator begin() const
Returns a iterator to the first observation: this is an example of usage:
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
std::vector< T1 > & operator+=(std::vector< T1 > &a, const std::vector< T2 > &b)
a+=b (element-wise sum)
bool empty() const
Returns true if there are no observations in the list.
iterator begin()
Returns a iterator to the first observation: this is an example of usage:
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...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Declares a class for storing a "sensory frame", a set of "observations" taken by the robot approximat...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
std::deque< CObservationPtr >::iterator iterator
You can use CSensoryFrame::begin to get a iterator to the first element.
A structure that holds runtime class type information.
T getObservationByIndexAs(const size_t &idx) const
Returns the i'th observation in the list (0=first), and as a different smart pointer type: ...
const_iterator end() const
Returns a iterator to the end of the list of observations: this is an example of usage: ...
T::SmartPtr getObservationByClass(const size_t &ith=0) const
Returns the i'th observation of a given class (or of a descendant class), or NULL if there is no such...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
std::deque< CObservationPtr > m_observations
The set of observations taken at the same time instant.