9 #ifndef CMultiMetricMap_H 10 #define CMultiMetricMap_H 36 class TSetOfMetricMapInitializers;
125 void deleteAllMaps();
126 virtual
void internal_clear();
128 virtual
bool internal_insertObservation( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D *robotPose = NULL )
MRPT_OVERRIDE;
133 bool internal_canComputeObservationLikelihood( const
mrpt::obs::CObservation *obs );
135 double internal_computeObservationLikelihood( const
mrpt::obs::CObservation *obs, const
mrpt::poses::CPose3D &takenFrom );
149 iterator
begin() {
return maps.begin(); }
155 mrpt::maps::CMetricMapPtr getMapByIndex(
size_t idx)
const;
164 template <
typename T>
167 size_t foundCount = 0;
170 if ( (*it)->GetRuntimeClass()->derivedFrom( class_ID ) )
171 if (foundCount++ == ith)
172 return typename T::SmartPtr(*it);
173 return typename T::SmartPtr();
179 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
182 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
183 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
190 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
194 SELECTED_CLASS_PTR operator [](
size_t index)
const {
197 if ( dynamic_cast<const_ptr_t>(it->pointer()) )
198 if (cnt++ == index) {
return SELECTED_CLASS_PTR(*it); }
199 throw std::out_of_range(
"Index is out of range");
201 template <
typename ELEMENT>
202 void push_back(
const ELEMENT &element) { m_source.push_back(element); }
209 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
212 typedef typename SELECTED_CLASS_PTR::value_type
pointee_t;
213 typedef typename SELECTED_CLASS_PTR::value_type*
ptr_t;
214 typedef const typename SELECTED_CLASS_PTR::value_type*
const_ptr_t;
216 operator const SELECTED_CLASS_PTR & ()
const { internal_update_ref();
return m_ret; }
217 operator bool()
const { internal_update_ref();
return m_ret.present(); }
218 bool present()
const { internal_update_ref();
return m_ret.present(); }
219 ptr_t
pointer(){ internal_update_ref();
return m_ret.pointer(); }
220 ptr_t operator ->()
const {
221 internal_update_ref();
222 if (m_ret.present())
return m_ret.pointer();
223 else throw std::runtime_error(
"Tried to derefer NULL pointer");
226 internal_update_ref();
227 if (m_ret.present())
return *m_ret.pointer();
228 else throw std::runtime_error(
"Tried to derefer NULL pointer");
235 if ( dynamic_cast<const_ptr_t>(it->pointer()) ) {
236 m_ret=SELECTED_CLASS_PTR(*it);
240 m_ret=SELECTED_CLASS_PTR();
277 virtual void determineMatching2D(
285 float compute3DMatchingRatio(
288 float maxDistForCorr = 0.10f,
289 float maxMahaDistForCorr = 2.0f
294 void saveMetricMapRepresentationToFile(
295 const std::string &filNamePrefix
301 void auxParticleFilterCleanUp();
305 void getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr &outObj )
const;
TListMaps::const_iterator const_iterator
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. ...
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.
A class used to store a 2D pose.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
SELECTED_CLASS_PTR::value_type * ptr_t
unsigned int m_ID
An auxiliary variable that can be used freely by the users (this will be copied to other maps using 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.