9 #ifndef CMultiMetricMap_H 10 #define CMultiMetricMap_H 37 class TSetOfMetricMapInitializers;
127 void deleteAllMaps();
130 bool internal_insertObservation( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D *robotPose = NULL )
MRPT_OVERRIDE;
135 bool internal_canComputeObservationLikelihood( const
mrpt::obs::CObservation *obs );
137 double internal_computeObservationLikelihood( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D &takenFrom );
157 mrpt::maps::CMetricMapPtr getMapByIndex(
size_t idx)
const;
166 template <
typename T>
169 size_t foundCount = 0;
172 if ( (*it)->GetRuntimeClass()->derivedFrom( class_ID ) )
173 if (foundCount++ == ith)
174 return typename T::SmartPtr(*it);
175 return typename T::SmartPtr();
181 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
184 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
185 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
192 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
196 SELECTED_CLASS_PTR operator [](
size_t index)
const {
199 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
200 if (cnt++ == index) {
return SELECTED_CLASS_PTR(*it); }
201 throw std::out_of_range(
"Index is out of range");
203 template <
typename ELEMENT>
204 void push_back(
const ELEMENT &element) { m_source.push_back(element); }
211 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
214 typedef typename SELECTED_CLASS_PTR::value_type
pointee_t;
215 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
216 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
218 operator const SELECTED_CLASS_PTR & ()
const { internal_update_ref();
return m_ret; }
219 operator bool()
const { internal_update_ref();
return m_ret.present(); }
220 bool present()
const { internal_update_ref();
return m_ret.present(); }
223 internal_update_ref();
224 if (m_ret.present())
return m_ret.pointer();
225 else throw std::runtime_error(
"Tried to derefer NULL pointer");
228 internal_update_ref();
229 if (m_ret.present())
return *m_ret.pointer();
230 else throw std::runtime_error(
"Tried to derefer NULL pointer");
237 if ( dynamic_cast<const_ptr_t>(it->pointer()) ) {
238 m_ret=SELECTED_CLASS_PTR(*it);
242 m_ret=SELECTED_CLASS_PTR();
280 virtual
void determineMatching2D(
282 const
mrpt::poses::CPose2D & otherMapPose,
283 mrpt::utils::TMatchingPairList & correspondences,
291 void saveMetricMapRepresentationToFile(const
std::
string &filNamePrefix ) const
MRPT_OVERRIDE;
296 void auxParticleFilterCleanUp();
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.
EIGEN_STRONG_INLINE iterator end()
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...
std::deque< mrpt::maps::CMetricMapPtr > TListMaps
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.
ProxySelectorContainerByClass(CONTAINER &source)
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.
T::SmartPtr 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...
const SELECTED_CLASS_PTR::value_type * const_ptr_t
size_t size(const MATRIXLIKE &m, int dim)
Declares a virtual base class for all metric maps storage classes.
SELECTED_CLASS_PTR::value_type * ptr_t
A proxy like ProxyFilterContainerByClass, but it directly appears as if it was a single smart pointer...
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_)
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.