Go to the documentation of this file.
9 #ifndef CMultiMetricMap_H
10 #define CMultiMetricMap_H
36 class TSetOfMetricMapInitializers;
198 template <
typename T>
201 size_t foundCount = 0;
203 &T::GetRuntimeClassIdStatic();
205 if ((*it)->GetRuntimeClass()->derivedFrom(class_ID))
206 if (foundCount++ == ith)
207 return std::dynamic_pointer_cast<T>(it->get_ptr());
208 return typename T::Ptr();
217 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
220 using ptr_t =
typename SELECTED_CLASS_PTR::element_type*;
221 using const_ptr_t =
const typename SELECTED_CLASS_PTR::element_type*;
261 return std::dynamic_pointer_cast<
262 typename SELECTED_CLASS_PTR::element_type>(
265 throw std::out_of_range(
"Index is out of range");
267 template <
typename ELEMENT>
280 template <
class SELECTED_CLASS_PTR,
class CONTAINER>
283 using pointee_t =
typename SELECTED_CLASS_PTR::element_type;
284 using ptr_t =
typename SELECTED_CLASS_PTR::element_type*;
285 using const_ptr_t =
const typename SELECTED_CLASS_PTR::element_type*;
309 operator const SELECTED_CLASS_PTR&()
const
314 explicit operator bool()
const
317 return m_ret ? true :
false;
330 throw std::runtime_error(
"Tried to derefer nullptr pointer");
338 throw std::runtime_error(
"Tried to derefer nullptr pointer");
351 m_ret = std::dynamic_pointer_cast<pointee_t>(it->get_ptr());
355 m_ret = SELECTED_CLASS_PTR();
361 ProxyFilterContainerByClass<mrpt::maps::CSimplePointsMap::Ptr, TListMaps>
const typename mrpt::maps::CSimplePointsMap::Ptr ::element_type * const_ptr_t
const typename mrpt::maps::CColouredPointsMap::Ptr ::element_type * const_ptr_t
ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(const ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &o)
unsigned int m_ID
An auxiliary variable that can be used freely by the users (this will be copied to other maps using t...
ProxySelectorContainerByClass< mrpt::maps::CWeightedPointsMap::Ptr, TListMaps > m_weightedPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
typename mrpt::maps::CSimplePointsMap::Ptr ::element_type * ptr_t
const Scalar * const_iterator
A structure that holds runtime class type information.
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2D_MRF::Ptr, TListMaps > m_heightMRFMaps
STL-like proxy to access this kind of maps in maps.
virtual void determineMatching2D(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::TMatchingPairList &correspondences, const mrpt::maps::TMatchingParams ¶ms, mrpt::maps::TMatchingExtraResults &extraResults) const override
Computes the matching between this and another 2D point map, which includes finding:
ProxyFilterContainerByClass< mrpt::maps::CReflectivityGridMap2D::Ptr, TListMaps > m_reflectivityMaps
STL-like proxy to access this kind of maps in maps.
bool isEmpty() const override
Returns true if all maps returns true to their isEmpty() method, which is map-dependent.
typename mrpt::maps::CColouredPointsMap::Ptr ::element_type * ptr_t
virtual const mrpt::maps::CSimplePointsMap * getAsSimplePointsMap() const override
If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point ma...
typename mrpt::maps::CColouredPointsMap::Ptr ::element_type pointee_t
void auxParticleFilterCleanUp() override
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::...
std::shared_ptr< CWirelessPowerGridMap2D > Ptr
ProxySelectorContainerByClass< mrpt::maps::CBeaconMap::Ptr, TListMaps > m_beaconMap
Proxy that looks like a smart pointer to the first matching object in maps.
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
Internal method called by insertObservation()
T::Ptr getMapByClass(const size_t &ith=0) const
Returns the i'th observation of a given class (or of a descendant class), or nullptr if there is no s...
Parameters for CMetricMap::compute3DMatchingRatio()
ProxyFilterContainerByClass< mrpt::maps::COccupancyGridMap2D::Ptr, TListMaps > m_gridMaps
STL-like proxy to access this kind of maps in maps.
A proxy like ProxyFilterContainerByClass, but it directly appears as if it was a single smart pointer...
ProxySelectorContainerByClass(ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &&)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
CMultiMetricMap & operator=(const CMultiMetricMap &o)
ProxyFilterContainerByClass< mrpt::maps::CColouredOctoMap::Ptr, TListMaps > m_colourOctoMaps
STL-like proxy to access this kind of maps in maps.
ProxySelectorContainerByClass< mrpt::maps::CLandmarksMap::Ptr, TListMaps > m_landmarksMap
Proxy that looks like a smart pointer to the first matching object in maps.
CMultiMetricMap(const mrpt::maps::TSetOfMetricMapInitializers *initializers=nullptr)
Constructor.
SELECTED_CLASS_PTR operator[](size_t index) const
std::shared_ptr< CColouredPointsMap > Ptr
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMap::Ptr, TListMaps > m_pointsMaps
STL-like proxy to access this kind of maps in maps.
ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(const ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &o)
GLsizei GLsizei GLchar * source
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
bool internal_canComputeObservationLikelihood(const mrpt::obs::CObservation *obs) const override
Returns true if any of the inner maps is able to compute a sensible likelihood function for this obse...
ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &&o)
mrpt::maps::CMetricMap::Ptr getMapByIndex(size_t idx) const
Gets the i-th map.
Declares a virtual base class for all metric maps storage classes.
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
std::shared_ptr< CGasConcentrationGridMap2D > Ptr
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
This class stores any customizable set of metric maps.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const override
See the definition in the base class: Calls in this class become a call to every single map in this s...
ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > & operator=(ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &&o)
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.
std::shared_ptr< CMetricMap > Ptr
pointee_t & operator*() const
ProxySelectorContainerByClass(CONTAINER &source)
std::shared_ptr< CSetOfObjects > Ptr
void push_back(const ELEMENT &element)
ProxyFilterContainerByClass(CONTAINER &source)
Parameters for the determination of matchings between point clouds, etc.
void internal_update_ref() const
TListMaps maps
The list of MRPT metric maps in this object.
ProxyFilterContainerByClass< mrpt::maps::CHeightGridMap2D::Ptr, TListMaps > m_heightMaps
STL-like proxy to access this kind of maps in maps.
void internal_clear() override
Clear all elements of the map.
const_iterator end() const
std::deque< mrpt::containers::deepcopy_poly_ptr< mrpt::maps::CMetricMap::Ptr > > TListMaps
const_iterator begin() const
void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const override
The implementation in this class just calls all the corresponding method of the contained metric maps...
ProxyFilterContainerByClass(ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &&)
std::shared_ptr< CHeightGridMap2D_MRF > Ptr
TListMaps::iterator iterator
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers &initializers)
This is an overloaded member function, provided for convenience. It differs from the above function o...
ProxyFilterContainerByClass< mrpt::maps::CWirelessPowerGridMap2D::Ptr, TListMaps > m_wifiGridMaps
STL-like proxy to access this kind of maps in maps.
Declares a class that represents any robot's observation.
Takes a const ref of a STL non-associative container of smart pointers at construction and exposes an...
ProxyFilterContainerByClass< mrpt::maps::COctoMap::Ptr, TListMaps > m_octoMaps
STL-like proxy to access this kind of maps in maps.
GLsizei const GLchar ** string
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers *initializers)
Sets the list of internal map according to the passed list of map initializers (Current maps' content...
std::shared_ptr< CReflectivityGridMap2D > Ptr
void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
TListMaps::const_iterator const_iterator
void deleteAllMaps()
Deletes all maps and clears the internal lists of maps (with clear_unique(), so user copies remain al...
ProxyFilterContainerByClass(ProxyFilterContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &)
ProxySelectorContainerByClass< mrpt::maps::CColouredPointsMap::Ptr, TListMaps > m_colourPointsMap
Proxy that looks like a smart pointer to the first matching object in maps.
ProxyFilterContainerByClass< mrpt::maps::CGasConcentrationGridMap2D::Ptr, TListMaps > m_gasGridMaps
STL-like proxy to access this kind of maps in maps.
GLenum const GLfloat * params
ProxySelectorContainerByClass(ProxySelectorContainerByClass< SELECTED_CLASS_PTR, CONTAINER > &)
std::shared_ptr< CWeightedPointsMap > Ptr
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |