44 template <
typename OP>
49 for_each( mmm.maps.begin(),mmm.maps.end(), op );
70 obs(_obs), takenFrom(_takenFrom),
71 total_log_lik(_total_log_lik)
76 template <
typename PTR>
78 total_log_lik+=ptr->computeObservationLikelihood(obs,takenFrom);
95 template <
typename PTR>
97 can = can || ptr->canComputeObservationLikelihood(obs);
110 obs(_obs), robot_pose(_robot_pose),
111 total_insert(_total_insert)
116 template <
typename PTR>
118 bool ret = ptr->insertObservation(obs,robot_pose);
119 if (ret) total_insert++;
131 template <
typename PTR>
133 if (ptr) ptr->getAs3DObject(obj_gl);
141 template <
typename PTR>
143 if (ptr) ptr->auxParticleFilterCleanUp();
157 template <
typename PTR>
160 is_empty = is_empty && ptr->isEmpty();
166 #define ALL_PROXIES_INIT \
167 m_pointsMaps(maps), \
170 m_colourOctoMaps(maps), \
171 m_gasGridMaps(maps), \
172 m_wifiGridMaps(maps), \
173 m_heightMaps(maps), \
174 m_heightMRFMaps(maps), \
175 m_reflectivityMaps(maps), \
176 m_colourPointsMap(maps), \
177 m_weightedPointsMap(maps), \
178 m_landmarksMap(maps), \
206 #if (__cplusplus>199711L)
208 maps(std::move(o.maps)),
216 maps = std::move(o.maps);
235 if (initializers!=NULL)
245 this->
maps.push_back( mrpt::maps::CMetricMapPtr(theMap) );
284 out << static_cast<uint32_t>(
m_ID);
310 this->
maps.resize(n);
356 return total_insert!=0;
371 m_pointsMaps[0]->determineMatching2D(otherMap,otherMapPose,correspondences,
params,extraResults);
390 for (
size_t idx=0;idx<
maps.size();idx++)
420 float accumResult = 0;
422 for (
size_t idx=0;idx<
maps.size();idx++)
430 const size_t nMapsComputed =
maps.size();
431 if (nMapsComputed) accumResult/=nMapsComputed;
473 return maps[idx].get_ptr();
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
Declares a virtual base class for all metric maps storage classes.
virtual float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map,...
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
virtual void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const =0
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >,...
This class stores any customizable set of metric maps.
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Internal method called by insertObservation()
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Internal method called by computeObservationLikelihood()
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
bool internal_canComputeObservationLikelihood(const mrpt::obs::CObservation *obs) const MRPT_OVERRIDE
Returns true if any of the inner maps is able to compute a sensible likelihood function for this obse...
bool isEmpty() const MRPT_OVERRIDE
Returns true if all maps returns true to their isEmpty() method, which is map-dependent....
unsigned int m_ID
An auxiliary variable that can be used freely by the users (this will be copied to other maps using t...
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
ProxyFilterContainerByClass< mrpt::maps::CSimplePointsMapPtr, TListMaps > m_pointsMaps
STL-like proxy to access this kind of maps in maps.
virtual const mrpt::maps::CSimplePointsMap * getAsSimplePointsMap() const MRPT_OVERRIDE
If the map is a simple point map or it's a multi-metric map that contains EXACTLY one simple point ma...
mrpt::maps::CMetricMapPtr getMapByIndex(size_t idx) const
Gets the i-th map.
CMultiMetricMap & operator=(const CMultiMetricMap &o)
void auxParticleFilterCleanUp() MRPT_OVERRIDE
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::...
void internal_clear() MRPT_OVERRIDE
Clear all elements of the map.
void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
CMultiMetricMap(const mrpt::maps::TSetOfMetricMapInitializers *initializers=NULL)
Constructor.
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers *initializers)
Sets the list of internal map according to the passed list of map initializers (Current maps' content...
virtual void determineMatching2D(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const mrpt::maps::TMatchingParams ¶ms, mrpt::maps::TMatchingExtraResults &extraResults) const MRPT_OVERRIDE
Computes the matching between this and another 2D point map, which includes finding:
float compute3DMatchingRatio(const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const MRPT_OVERRIDE
See the definition in the base class: Calls in this class become a call to every single map in this s...
void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const MRPT_OVERRIDE
The implementation in this class just calls all the corresponding method of the contained metric maps...
void deleteAllMaps()
Deletes all maps and clears the internal lists of maps (with clear_unique(), so user copies remain al...
TListMaps maps
The list of MRPT metric maps in this object.
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...
std::deque< TMetricMapInitializerPtr >::const_iterator const_iterator
Declares a class that represents any robot's observation.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
GLenum const GLfloat * params
GLsizei const GLchar ** string
#define ASSERT_BELOW_(__A, __B)
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define MRPT_CHECK_NORMAL_NUMBER(val)
#define ASSERTMSG_(f, __ERROR_MSG)
This namespace contains representation of robot actions and observations.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
unsigned __int32 uint32_t
void operator()(PTR &ptr)
void operator()(PTR &ptr)
MapCanComputeLikelihood(const CMultiMetricMap &m, const CObservation *_obs, bool &_can)
void operator()(PTR &ptr)
const CPose3D & takenFrom
MapComputeLikelihood(const CMultiMetricMap &m, const CObservation *_obs, const CPose3D &_takenFrom, double &_total_log_lik)
static void run(const CMultiMetricMap &_mmm, OP &op)
mrpt::opengl::CSetOfObjectsPtr & obj_gl
void operator()(PTR &ptr)
MapGetAs3DObject(mrpt::opengl::CSetOfObjectsPtr &_obj_gl)
const CPose3D * robot_pose
MapInsertObservation(const CMultiMetricMap &m, const CObservation *_obs, const CPose3D *_robot_pose, int &_total_insert)
void operator()(PTR &ptr)
void operator()(PTR &ptr)
MapIsEmpty(bool &_is_empty)
void operator()(T &container)
Parameters for the determination of matchings between point clouds, etc.
Parameters for CMetricMap::compute3DMatchingRatio()
Class factory & registry for map classes.
mrpt::maps::CMetricMap * factoryMapObjectFromDefinition(const mrpt::maps::TMetricMapInitializer &mi) const
Return NULL if not found.
static TMetricMapTypesRegistry & Instance()