9#ifndef CMultiMetricMap_H
10#define CMultiMetricMap_H
37 class TSetOfMetricMapInitializers;
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 );
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;
188 bool empty()
const {
return size()==0; }
191 for(
typename CONTAINER::const_iterator it=m_source.begin();it!=m_source.end();++it)
196 SELECTED_CLASS_PTR operator [](
size_t index)
const {
198 for(
typename CONTAINER::const_iterator it=m_source.begin();it!=m_source.end();++it)
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");
236 for(
typename CONTAINER::const_iterator it=m_source.begin();it!=m_source.end();++it) {
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();
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#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...
Declares a virtual base class for all metric maps storage classes.
This class stores any customizable set of metric maps.
TListMaps::const_iterator const_iterator
ProxyFilterContainerByClass< mrpt::maps::COctoMapPtr, TListMaps > m_octoMaps
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.
virtual ~CMultiMetricMap()
Destructor.
ProxySelectorContainerByClass< mrpt::maps::CBeaconMapPtr, TListMaps > m_beaconMap
Proxy that looks like a smart pointer to the first matching object in maps.
ProxySelectorContainerByClass< mrpt::maps::CWeightedPointsMapPtr, TListMaps > m_weightedPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2DPtr, TListMaps > m_heightMaps
STL-like proxy to access this kind of maps in maps.
TListMaps::iterator iterator
ProxySelectorContainerByClass< mrpt::maps::CColouredPointsMapPtr, TListMaps > m_colourPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
ProxyFilterContainerByClass< mrpt::maps::CReflectivityGridMap2DPtr, TListMaps > m_reflectivityMaps
STL-like proxy to access this kind of maps in maps.
CMultiMetricMap(const mrpt::maps::TSetOfMetricMapInitializers *initializers=NULL)
Constructor.
mrpt::maps::CMetricMapPtr getMapByIndex(size_t idx) const
Gets the i-th map.
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMapPtr, TListMaps > m_pointsMaps
STL-like proxy to access this kind of maps in maps.
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers &initializers)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::deque< mrpt::maps::CMetricMapPtr > TListMaps
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...
ProxyFilterContainerByClass< mrpt::maps::CWirelessPowerGridMap2DPtr, TListMaps > m_wifiGridMaps
STL-like proxy to access this kind of maps in maps.
CMultiMetricMap(const mrpt::maps::CMultiMetricMap &other)
Copy constructor.
void internal_clear() MRPT_OVERRIDE
Clear all elements of the map.
bool isEmpty() const MRPT_OVERRIDE
Returns true if all maps returns true to their isEmpty() method, which is map-dependent....
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers *initializers)
Sets the list of internal map according to the passed list of map initializers (Current maps' content...
void deleteAllMaps()
Deletes all maps and clears the internal lists of maps (with clear_unique(), so user copies remain al...
ProxyFilterContainerByClass< mrpt::maps::CGasConcentrationGridMap2DPtr, TListMaps > m_gasGridMaps
STL-like proxy to access this kind of maps in maps.
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2D_MRFPtr, TListMaps > m_heightMRFMaps
STL-like proxy to access this kind of maps in maps.
ProxyFilterContainerByClass< mrpt::maps::COccupancyGridMap2DPtr, TListMaps > m_gridMaps
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.
const_iterator end() const
const_iterator begin() const
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
EIGEN_STRONG_INLINE iterator begin()
EIGEN_STRONG_INLINE iterator end()
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
struct OBS_IMPEXP CMetricMapPtr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Takes a const ref of a STL non-associative container of smart pointers at construction and exposes an...
const SELECTED_CLASS_PTR::value_type * const_ptr_t
void push_back(const ELEMENT &element)
SELECTED_CLASS_PTR::value_type * ptr_t
ProxyFilterContainerByClass(CONTAINER &source)
A proxy like ProxyFilterContainerByClass, but it directly appears as if it was a single smart pointer...
ProxySelectorContainerByClass(CONTAINER &source)
SELECTED_CLASS_PTR::value_type * ptr_t
const SELECTED_CLASS_PTR::value_type * const_ptr_t
SELECTED_CLASS_PTR::value_type pointee_t
void internal_update_ref() const
Parameters for the determination of matchings between point clouds, etc.
Parameters for CMetricMap::compute3DMatchingRatio()
A structure that holds runtime class type information.