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();
virtual void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const =0
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >...
Parameters for CMetricMap::compute3DMatchingRatio()
void auxParticleFilterCleanUp() MRPT_OVERRIDE
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::...
void operator()(PTR &ptr)
void deleteAllMaps()
Deletes all maps and clears the internal lists of maps (with clear_unique(), so user copies remain al...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
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...
mrpt::maps::CMetricMap * factoryMapObjectFromDefinition(const mrpt::maps::TMetricMapInitializer &mi) const
Return NULL if not found.
void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
void operator()(PTR &ptr)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
#define MRPT_CHECK_NORMAL_NUMBER(val)
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...
#define ASSERT_BELOW_(__A, __B)
const CPose3D * robot_pose
void operator()(PTR &ptr)
std::deque< TMetricMapInitializerPtr >::const_iterator const_iterator
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans. ...
mrpt::opengl::CSetOfObjectsPtr & obj_gl
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...
void operator()(T &container)
A set of TMetricMapInitializer structures, passed to the constructor CMultiMetricMap::CMultiMetricMap...
MapCanComputeLikelihood(const CMultiMetricMap &m, const CObservation *_obs, bool &_can)
const CPose3D & takenFrom
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
void operator()(PTR &ptr)
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void internal_clear() MRPT_OVERRIDE
Clear all elements of the map.
CMultiMetricMap & operator=(const CMultiMetricMap &o)
bool internal_insertObservation(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) MRPT_OVERRIDE
Internal method called by insertObservation()
static TMetricMapTypesRegistry & Instance()
This namespace contains representation of robot actions and observations.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
GLsizei const GLchar ** string
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
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: ...
static void run(const CMultiMetricMap &_mmm, OP &op)
MapComputeLikelihood(const CMultiMetricMap &m, const CObservation *_obs, const CPose3D &_takenFrom, double &_total_log_lik)
mrpt::maps::CMetricMapPtr getMapByIndex(size_t idx) const
Gets the i-th map.
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...
Declares a virtual base class for all metric maps storage classes.
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).
Declares a class that represents any robot's observation.
void setListOfMaps(const mrpt::maps::TSetOfMetricMapInitializers *initializers)
Sets the list of internal map according to the passed list of map initializers (Current maps' content...
MapIsEmpty(bool &_is_empty)
bool isEmpty() const MRPT_OVERRIDE
Returns true if all maps returns true to their isEmpty() method, which is map-dependent. Read the docs of each map class.
void operator()(PTR &ptr)
unsigned int m_ID
An auxiliary variable that can be used freely by the users (this will be copied to other maps using t...
double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Internal method called by computeObservationLikelihood()
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...
TListMaps maps
The list of MRPT metric maps in this object.
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.
Class factory & registry for map classes.
Parameters for the determination of matchings between point clouds, etc.
unsigned __int32 uint32_t
virtual const mrpt::utils::TRuntimeClassId * GetRuntimeClass() const
Returns information about the class of an object in runtime.
#define ASSERTMSG_(f, __ERROR_MSG)
GLenum const GLfloat * params
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, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
CMultiMetricMap(const mrpt::maps::TSetOfMetricMapInitializers *initializers=NULL)
Constructor.
MapInsertObservation(const CMultiMetricMap &m, const CObservation *_obs, const CPose3D *_robot_pose, int &_total_insert)
void operator()(PTR &ptr)
MapGetAs3DObject(mrpt::opengl::CSetOfObjectsPtr &_obj_gl)