9 #ifndef CMultiMetricMap_H 10 #define CMultiMetricMap_H 38 class TSetOfMetricMapInitializers;
128 void deleteAllMaps();
131 bool internal_insertObservation( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D *robotPose = NULL )
MRPT_OVERRIDE;
136 bool internal_canComputeObservationLikelihood( const
mrpt::obs::CObservation *obs ) const
MRPT_OVERRIDE;
138 double internal_computeObservationLikelihood( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D &takenFrom )
MRPT_OVERRIDE;
158 mrpt::maps::CMetricMapPtr getMapByIndex(
size_t idx)
const;
167 template <
typename T>
170 size_t foundCount = 0;
173 if ( (*it)->GetRuntimeClass()->derivedFrom( class_ID ) )
174 if (foundCount++ == ith)
175 return typename T::Ptr(it->get_ptr());
176 return typename T::Ptr();
182 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
185 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
186 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
191 #if (__cplusplus>199711L) 193 ProxyFilterContainerByClass<SELECTED_CLASS_PTR, CONTAINER>& operator=(ProxyFilterContainerByClass<SELECTED_CLASS_PTR, CONTAINER>&&o) {
return *
this; }
199 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
206 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
207 if (cnt++ ==
index) {
return SELECTED_CLASS_PTR(it->get_ptr()); }
208 throw std::out_of_range(
"Index is out of range");
210 template <
typename ELEMENT>
211 void push_back(
const ELEMENT &element) { m_source->push_back(element); }
218 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
221 typedef typename SELECTED_CLASS_PTR::value_type
pointee_t;
222 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
223 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
227 #if (__cplusplus>199711L) 229 ProxySelectorContainerByClass<SELECTED_CLASS_PTR, CONTAINER>& operator=(ProxySelectorContainerByClass<SELECTED_CLASS_PTR, CONTAINER>&&o) {
return *
this; }
232 operator const SELECTED_CLASS_PTR & ()
const { internal_update_ref();
return m_ret; }
233 operator bool()
const { internal_update_ref();
return m_ret.present(); }
234 bool present()
const { internal_update_ref();
return m_ret.present(); }
237 internal_update_ref();
238 if (m_ret.present())
return m_ret.pointer();
239 else throw std::runtime_error(
"Tried to derefer NULL pointer");
242 internal_update_ref();
243 if (m_ret.present())
return *m_ret.pointer();
244 else throw std::runtime_error(
"Tried to derefer NULL pointer");
251 if ( dynamic_cast<const_ptr_t>(it->pointer()) ) {
252 m_ret=SELECTED_CLASS_PTR(it->get_ptr());
256 m_ret=SELECTED_CLASS_PTR();
286 #if (__cplusplus>199711L) 299 virtual
void determineMatching2D(
301 const
mrpt::poses::CPose2D & otherMapPose,
302 mrpt::utils::TMatchingPairList & correspondences,
310 void saveMetricMapRepresentationToFile(const
std::
string &filNamePrefix ) const
MRPT_OVERRIDE;
std::deque< mrpt::utils::poly_ptr_ptr< mrpt::maps::CMetricMapPtr > > TListMaps
TListMaps::const_iterator const_iterator
Parameters for CMetricMap::compute3DMatchingRatio()
ProxySelectorContainerByClass< mrpt::maps::CWeightedPointsMapPtr, TListMaps > m_weightedPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers &initializers)
ProxyFilterContainerByClass< mrpt::maps::COctoMapPtr, TListMaps > m_octoMaps
STL-like proxy to access this kind of maps in maps.
T::Ptr getMapByClass(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...
ProxyFilterContainerByClass(CONTAINER &source)
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
SELECTED_CLASS_PTR::value_type * ptr_t
EIGEN_STRONG_INLINE iterator begin()
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2D_MRFPtr, TListMaps > m_heightMRFMaps
STL-like proxy to access this kind of maps in maps.
const Scalar * const_iterator
Takes a const ref of a STL non-associative container of smart pointers at construction and exposes an...
SELECTED_CLASS_PTR::value_type pointee_t
ProxyFilterContainerByClass< mrpt::maps::COccupancyGridMap2DPtr, TListMaps > m_gridMaps
STL-like proxy to access this kind of maps in maps.
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
ProxySelectorContainerByClass< mrpt::maps::CBeaconMapPtr, TListMaps > m_beaconMap
Proxy that looks like a smart pointer to the first matching object in maps.
const SELECTED_CLASS_PTR::value_type * const_ptr_t
void internal_update_ref() const
#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...
ProxyFilterContainerByClass< mrpt::maps::CGasConcentrationGridMap2DPtr, TListMaps > m_gasGridMaps
STL-like proxy to access this kind of maps in maps.
ProxySelectorContainerByClass< mrpt::maps::CLandmarksMapPtr, TListMaps > m_landmarksMap
Proxy that looks like a smart pointer to the first matching object in maps.
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
ProxySelectorContainerByClass(CONTAINER &source)
ProxySelectorContainerByClass(ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &)
void push_back(const ELEMENT &element)
ProxyFilterContainerByClass< mrpt::maps::CWirelessPowerGridMap2DPtr, TListMaps > m_wifiGridMaps
STL-like proxy to access this kind of maps in maps.
ProxyFilterContainerByClass< mrpt::maps::CColouredOctoMapPtr, TListMaps > m_colourOctoMaps
STL-like proxy to access this kind of maps in maps.
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2DPtr, TListMaps > m_heightMaps
STL-like proxy to access this kind of maps in maps.
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...
mrpt::maps::CMultiMetricMap CMultiMetricMap
Backward compatible typedef.
const SELECTED_CLASS_PTR::value_type * const_ptr_t
Declares a virtual base class for all metric maps storage classes.
ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(const ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &o)
SELECTED_CLASS_PTR::value_type * ptr_t
GLsizei GLsizei GLchar * source
ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(const ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &o)
A proxy like ProxyFilterContainerByClass, but it directly appears as if it was a single smart pointer...
ProxyFilterContainerByClass(ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &)
A structure that holds runtime class type information.
const_iterator end() const
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMapPtr, TListMaps > m_pointsMaps
STL-like proxy to access this kind of maps in maps.
This class stores any customizable set of metric maps.
ProxySelectorContainerByClass< mrpt::maps::CColouredPointsMapPtr, TListMaps > m_colourPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
Parameters for the determination of matchings between point clouds, etc.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
GLenum const GLfloat * params
TListMaps::iterator iterator
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
const_iterator begin() const
ProxyFilterContainerByClass< mrpt::maps::CReflectivityGridMap2DPtr, TListMaps > m_reflectivityMaps
STL-like proxy to access this kind of maps in maps.