Digital Elevation Model (DEM), a mesh or grid representation of a surface which keeps the estimated height for each (x,y) location.
Important implemented features are the insertion of 2D laser scans (from arbitrary 6D poses) and the exportation as 3D scenes.
Each cell contains the up-to-date average height from measured falling in that cell. Algorithms that can be used:
This class implements generic version of mrpt::maps::CMetric::insertObservation() accepting these types of sensory data:
Definition at line 63 of file CHeightGridMap2D.h.
#include <mrpt/maps/CHeightGridMap2D.h>
Classes | |
struct | TInsertionOptions |
Parameters related with inserting observations into the map. More... | |
struct | TMapDefinition |
struct | TMapDefinitionBase |
Public Types | |
enum | TMapRepresentation { mrSimpleAverage = 0 } |
The type of map representation to be used. More... | |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) noexcept |
void | operator delete[] (void *ptr) noexcept |
void | operator delete (void *memory, void *ptr) noexcept |
void * | operator new (size_t size, const std::nothrow_t &) noexcept |
void | operator delete (void *ptr, const std::nothrow_t &) noexcept |
void | clear () |
Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes. More... | |
float | cell2float (const THeightGridmapCell &c) const override |
CHeightGridMap2D (TMapRepresentation mapType=mrSimpleAverage, double x_min=-2, double x_max=2, double y_min=-2, double y_max=2, double resolution=0.1) | |
Constructor. More... | |
bool | isEmpty () const override |
Returns true if the map is empty/no observation has been inserted. More... | |
float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const override |
See docs in base class: in this class it always returns 0. More... | |
void | saveMetricMapRepresentationToFile (const std::string &filNamePrefix) const override |
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface). More... | |
void | getAs3DObject (mrpt::opengl::CSetOfObjects::Ptr &outObj) const override |
Returns a 3D object representing the map: by default, it will be a mrpt::opengl::CMesh object, unless it is specified otherwise in mrpt::global_settings::HEIGHTGRIDMAP_EXPORT3D_AS_MESH. More... | |
TMapRepresentation | getMapType () |
Return the type of the gas distribution map, according to parameters passed on construction. More... | |
size_t | countObservedCells () const |
Return the number of cells with at least one height data inserted. More... | |
virtual bool | insertIndividualPoint (const double x, const double y, const double z, const CHeightGridMap2D_Base::TPointInsertParams ¶ms=CHeightGridMap2D_Base::TPointInsertParams()) override |
Update the DEM with one new point. More... | |
virtual double | dem_get_resolution () const override |
virtual size_t | dem_get_size_x () const override |
virtual size_t | dem_get_size_y () const override |
virtual bool | dem_get_z_by_cell (const size_t cx, const size_t cy, double &z_out) const override |
Get cell 'z' by (cx,cy) cell indices. More... | |
virtual bool | dem_get_z (const double x, const double y, double &z_out) const override |
Get cell 'z' (x,y) by metric coordinates. More... | |
virtual void | dem_update_map () override |
Ensure that all observations are reflected in the map estimate. More... | |
void | internal_clear () override |
Internal method called by clear() More... | |
bool | internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) override |
Internal method called by insertObservation() More... | |
double | internal_computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override |
Internal method called by computeObservationLikelihood() More... | |
void | loadFromProbabilisticPosesAndObservations (const mrpt::maps::CSimpleMap &Map) |
Load the map contents from a CSimpleMap object, erasing all previous content of the map. More... | |
void | loadFromSimpleMap (const mrpt::maps::CSimpleMap &Map) |
! More... | |
bool | insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=NULL) |
Insert the observation information into this map. More... | |
bool | insertObservationPtr (const mrpt::obs::CObservation::Ptr &obs, const mrpt::poses::CPose3D *robotPose=NULL) |
A wrapper for smart pointers, just calls the non-smart pointer version. More... | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose. More... | |
double | computeObservationLikelihood (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose2D &takenFrom) |
virtual bool | canComputeObservationLikelihood (const mrpt::obs::CObservation *obs) const |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
bool | canComputeObservationLikelihood (const mrpt::obs::CObservation::Ptr &obs) const |
double | computeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf, const mrpt::poses::CPose2D &takenFrom) |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame. More... | |
bool | canComputeObservationsLikelihood (const mrpt::obs::CSensoryFrame &sf) const |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. More... | |
virtual void | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matching between this and another 2D point map, which includes finding: More... | |
virtual void | determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::utils::TMatchingPairList &correspondences, const TMatchingParams ¶ms, TMatchingExtraResults &extraResults) const |
Computes the matchings between this and another 3D points map - method used in 3D-ICP. More... | |
virtual void | auxParticleFilterCleanUp () |
This method is called at the end of each "prediction-update-map
insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation". More... | |
virtual float | squareDistanceToClosestCorrespondence (float x0, float y0) const |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map. More... | |
virtual const mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () const |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it. More... | |
virtual mrpt::maps::CSimplePointsMap * | getAsSimplePointsMap () |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
void | setSize (const double x_min, const double x_max, const double y_min, const double y_max, const double resolution, const THeightGridmapCell *fill_value=nullptr) |
Changes the size of the grid, ERASING all previous contents. More... | |
void | fill (const THeightGridmapCell &value) |
Fills all the cells with the same value. More... | |
virtual void | resize (double new_x_min, double new_x_max, double new_y_min, double new_y_max, const THeightGridmapCell &defaultValueNewCells, double additionalMarginMeters=2.0) |
Changes the size of the grid, maintaining previous contents. More... | |
THeightGridmapCell * | cellByPos (double x, double y) |
Returns a pointer to the contents of a cell given by its coordinates, or nullptr if it is out of the map extensions. More... | |
const THeightGridmapCell * | cellByPos (double x, double y) const |
THeightGridmapCell * | cellByIndex (unsigned int cx, unsigned int cy) |
Returns a pointer to the contents of a cell given by its cell indexes, or nullptr if it is out of the map extensions. More... | |
const THeightGridmapCell * | cellByIndex (unsigned int cx, unsigned int cy) const |
Returns a pointer to the contents of a cell given by its cell indexes, or nullptr if it is out of the map extensions. More... | |
size_t | getSizeX () const |
Returns the horizontal size of grid map in cells count. More... | |
size_t | getSizeY () const |
Returns the vertical size of grid map in cells count. More... | |
double | getXMin () const |
Returns the "x" coordinate of left side of grid map. More... | |
double | getXMax () const |
Returns the "x" coordinate of right side of grid map. More... | |
double | getYMin () const |
Returns the "y" coordinate of top side of grid map. More... | |
double | getYMax () const |
Returns the "y" coordinate of bottom side of grid map. More... | |
double | getResolution () const |
Returns the resolution of the grid map. More... | |
int | x2idx (double x) const |
Transform a coordinate values into cell indexes. More... | |
int | y2idx (double y) const |
int | xy2idx (double x, double y) const |
void | idx2cxcy (const int &idx, int &cx, int &cy) const |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes. More... | |
double | idx2x (int cx) const |
Transform a cell index into a coordinate value of the cell central point. More... | |
double | idx2y (int cy) const |
void | getAsMatrix (MAT &m) const |
Get the entire grid as a matrix. More... | |
virtual float | cell2float (const THeightGridmapCell &c) const |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value. More... | |
bool | saveToTextFile (const std::string &fileName) const |
Saves a float representation of the grid (via "cell2float()") to a text file. More... | |
bool | dem_internal_insertObservation (const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D *robotPose=nullptr) |
Internal method called by internal_insertObservation() More... | |
RTTI classes and functions | |
mrpt::utils::CObject::Ptr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Specific API for Digital Elevation Model (DEM) maps | |
bool | intersectLine3D (const mrpt::math::TLine3D &r1, mrpt::math::TObject3D &obj) const |
Gets the intersection between a 3D line and a Height Grid map (taking into account the different heights of each individual cell) More... | |
bool | getMinMaxHeight (float &z_min, float &z_max) const |
Computes the minimum and maximum height in the grid. More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
mrpt::maps::CHeightGridMap2D::TInsertionOptions | insertionOptions |
TMapRepresentation | m_mapType |
The map representation type of this map. More... | |
TMapGenericParams | genericMapParams |
Common params to all maps. More... | |
Protected Member Functions | |
void | publishEvent (const mrptEvent &e) const |
Called when you want this object to emit an event to all the observers currently subscribed to this object. More... | |
bool | hasSubscribers () const |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read. More... | |
std::vector< THeightGridmapCell > & | m_map_castaway_const () const |
Used only from logically const method that really need to modify the object. More... | |
void | dyngridcommon_writeToStream (mrpt::utils::CStream &out) const |
void | dyngridcommon_readFromStream (mrpt::utils::CStream &in, bool cast_from_float=false) |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const override |
Introduces a pure virtual method responsible for writing to a CStream. More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) override |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Protected Attributes | |
std::vector< THeightGridmapCell > | m_map |
The cells. More... | |
double | m_x_min |
double | m_x_max |
double | m_y_min |
double | m_y_max |
double | m_resolution |
size_t | m_size_x |
size_t | m_size_y |
RTTI stuff | |
using | Ptr = std::shared_ptr< CHeightGridMap2D > |
using | ConstPtr = std::shared_ptr< const CHeightGridMap2D > |
static mrpt::utils::CLASSINIT | _init_CHeightGridMap2D |
static const mrpt::utils::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "CHeightGridMap2D" |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
static const mrpt::utils::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static mrpt::utils::CObject * | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
Map Definition Interface stuff (see * mrpt::maps::TMetricMapInitializer) @{ | |
static const size_t | m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "CHeightGridMap2D,heightMap,dem" , & mrpt::maps::CHeightGridMap2D ::MapDefinition, & mrpt::maps::CHeightGridMap2D ::internal_CreateFromMapDefinition) |
ID used to initialize class registration (just ignore it) More... | |
static mrpt::maps::TMetricMapInitializer * | MapDefinition () |
Returns default map definition initializer. More... | |
static CHeightGridMap2D * | CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
Constructor from a map definition structure: initializes the map and * its parameters accordingly. More... | |
static mrpt::maps::CMetricMap * | internal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def) |
using mrpt::maps::CHeightGridMap2D::ConstPtr = std::shared_ptr<const CHeightGridMap2D > |
Definition at line 67 of file CHeightGridMap2D.h.
using mrpt::maps::CHeightGridMap2D::Ptr = std::shared_ptr< CHeightGridMap2D > |
A typedef for the associated smart pointer
Definition at line 67 of file CHeightGridMap2D.h.
The type of map representation to be used.
See mrpt::maps::CHeightGridMap2D for discussion.
Enumerator | |
---|---|
mrSimpleAverage |
Definition at line 82 of file CHeightGridMap2D.h.
CHeightGridMap2D::CHeightGridMap2D | ( | TMapRepresentation | mapType = mrSimpleAverage , |
double | x_min = -2 , |
||
double | x_max = 2 , |
||
double | y_min = -2 , |
||
double | y_max = 2 , |
||
double | resolution = 0.1 |
||
) |
Constructor.
Definition at line 110 of file CHeightGridMap2D.cpp.
|
staticprotected |
|
inlinevirtualinherited |
This method is called at the end of each "prediction-update-map insertion" cycle within "mrpt::slam::CMetricMapBuilderRBPF::processActionObservation".
This method should normally do nothing, but in some cases can be used to free auxiliary cached variables.
Reimplemented in mrpt::maps::CLandmarksMap, and mrpt::maps::CMultiMetricMap.
Definition at line 289 of file CMetricMap.h.
|
virtualinherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image). See: Maps and observations compatibility matrix
obs | The observation. |
Definition at line 180 of file CMetricMap.cpp.
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 121 of file CMetricMap.cpp.
|
inherited |
Returns true if this map is able to compute a sensible likelihood function for this observation (i.e.
an occupancy grid map cannot with an image). See: Maps and observations compatibility matrix
sf | The observations. |
Definition at line 86 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
|
inlineoverride |
Definition at line 74 of file CHeightGridMap2D.h.
|
inlinevirtualinherited |
The user must implement this in order to provide "saveToTextFile" a way to convert each cell into a numeric value.
Definition at line 322 of file CDynamicGrid.h.
|
inlineinherited |
Returns a pointer to the contents of a cell given by its cell indexes, or nullptr if it is out of the map extensions.
Definition at line 234 of file CDynamicGrid.h.
Referenced by dem_get_z_by_cell(), and getAs3DObject().
|
inlineinherited |
Returns a pointer to the contents of a cell given by its cell indexes, or nullptr if it is out of the map extensions.
Definition at line 245 of file CDynamicGrid.h.
|
inlineinherited |
Returns a pointer to the contents of a cell given by its coordinates, or nullptr if it is out of the map extensions.
Definition at line 213 of file CDynamicGrid.h.
Referenced by dem_get_z(), and insertIndividualPoint().
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 222 of file CDynamicGrid.h.
|
inline |
Calls the base CMetricMap::clear Declared here to avoid ambiguity between the two clear() in both base classes.
Definition at line 73 of file CHeightGridMap2D.h.
References mrpt::maps::CMetricMap::clear().
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
overridevirtual |
See docs in base class: in this class it always returns 0.
Reimplemented from mrpt::maps::CMetricMap.
Definition at line 444 of file CHeightGridMap2D.cpp.
References MRPT_UNUSED_PARAM.
|
inherited |
Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.
See: Maps and observations compatibility matrix
takenFrom | The robot's pose the observation is supposed to be taken from. |
obs | The observation. |
Definition at line 189 of file CMetricMap.cpp.
Referenced by mrpt::maps::CMultiMetricMapPDF::PF_SLAM_computeObservationLikelihoodForParticle().
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 77 of file CMetricMap.cpp.
|
inherited |
Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.
See: Maps and observations compatibility matrix
takenFrom | The robot's pose the observation is supposed to be taken from. |
sf | The set of observations in a CSensoryFrame. |
Definition at line 67 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
Referenced by mrpt::hmtslam::CLocalMetricHypothesis::auxiliarComputeObservationLikelihood().
size_t CHeightGridMap2D::countObservedCells | ( | ) | const |
Return the number of cells with at least one height data inserted.
Definition at line 391 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_map, m_mapType, mrSimpleAverage, and THROW_EXCEPTION.
|
inlinestatic |
Definition at line 67 of file CHeightGridMap2D.h.
|
static |
Constructor from a map definition structure: initializes the map and * its parameters accordingly.
Definition at line 33 of file CHeightGridMap2D.cpp.
|
static |
|
overridevirtual |
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 410 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_resolution.
|
overridevirtual |
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 411 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_size_x.
|
overridevirtual |
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 412 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_size_y.
|
overridevirtual |
Get cell 'z' (x,y) by metric coordinates.
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 425 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::cellByPos(), mrpt::maps::THeightGridmapCell::h, and mrpt::maps::THeightGridmapCell::w.
|
overridevirtual |
Get cell 'z' by (cx,cy) cell indices.
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 413 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::cellByIndex(), mrpt::maps::THeightGridmapCell::h, and mrpt::maps::THeightGridmapCell::w.
|
inherited |
Internal method called by internal_insertObservation()
Definition at line 128 of file CHeightGridMap2D_Base.cpp.
References mrpt::obs::CObservation2DRangeScan::buildAuxPointsMap(), mrpt::maps::CPointsMap::changeCoordinatesReference(), mrpt::maps::CHeightGridMap2D_Base::dem_update_map(), mrpt::maps::CPointsMap::empty(), mrpt::maps::CPointsMap::getPoint(), mrpt::maps::CHeightGridMap2D_Base::insertIndividualPoint(), IS_CLASS, mrpt::maps::CPointsMap::loadFromVelodyneScan(), MRPT_END, MRPT_START, mrpt::maps::CPointsMap::size(), and mrpt::maps::CHeightGridMap2D_Base::TPointInsertParams::update_map_after_insertion.
Referenced by internal_insertObservation().
|
overridevirtual |
Ensure that all observations are reflected in the map estimate.
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 439 of file CHeightGridMap2D.cpp.
|
virtualinherited |
Computes the matching between this and another 2D point map, which includes finding:
The algorithm is:
This method is the most time critical one into ICP-like algorithms.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented in mrpt::maps::COccupancyGridMap2D, mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CBeaconMap.
Definition at line 127 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP_Method_Classic().
|
virtualinherited |
Computes the matchings between this and another 3D points map - method used in 3D-ICP.
This method finds the set of point pairs in each map.
The method is the most time critical one into ICP-like algorithms.
The algorithm is:
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The pose of the other map as seen from "this". |
params | [IN] Parameters for the determination of pairings. |
correspondences | [OUT] The detected matchings pairs. |
extraResults | [OUT] Other results. |
Reimplemented in mrpt::maps::CPointsMap.
Definition at line 142 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().
|
inlineprotectedinherited |
Definition at line 355 of file CDynamicGrid.h.
Referenced by readFromStream().
|
inlineprotectedinherited |
Definition at line 348 of file CDynamicGrid.h.
Referenced by writeToStream().
|
inlineinherited |
Fills all the cells with the same value.
Definition at line 119 of file CDynamicGrid.h.
Referenced by internal_clear().
|
overridevirtual |
Returns a 3D object representing the map: by default, it will be a mrpt::opengl::CMesh object, unless it is specified otherwise in mrpt::global_settings::HEIGHTGRIDMAP_EXPORT3D_AS_MESH.
Implements mrpt::maps::CMetricMap.
Definition at line 315 of file CHeightGridMap2D.cpp.
References ASSERTDEB_, mrpt::utils::CDynamicGrid< THeightGridmapCell >::cellByIndex(), mrpt::utils::colormap(), mrpt::maps::CHeightGridMap2D::TInsertionOptions::colorMap, mrpt::maps::TMapGenericParams::enableSaveAs3DObject, mrpt::maps::CMetricMap::genericMapParams, mrpt::maps::CHeightGridMap2D_Base::getMinMaxHeight(), HEIGHTGRIDMAP_EXPORT3D_AS_MESH_value, mrpt::utils::CDynamicGrid< THeightGridmapCell >::idx2x(), mrpt::utils::CDynamicGrid< THeightGridmapCell >::idx2y(), insertionOptions, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_size_x, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_size_y, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_x_max, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_x_min, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_y_max, and mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_y_min.
|
inlineinherited |
Get the entire grid as a matrix.
MAT | The type of the matrix, typically a mrpt::math::CMatrixDouble. |
[out] | m | The output matrix; will be set automatically to the correct size. Entry (cy,cx) in the matrix contains the grid cell with indices (cx,cy). |
Definition at line 311 of file CDynamicGrid.h.
|
inlinevirtualinherited |
If the map is a simple points map or it's a multi-metric map that contains EXACTLY one simple points map, return it.
Otherwise, return NULL
Reimplemented in mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.
Definition at line 301 of file CMetricMap.h.
Referenced by mrpt::maps::CPointsMap::compute3DMatchingRatio().
|
inlinevirtualinherited |
Reimplemented in mrpt::maps::CPointsMap, mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.
Definition at line 305 of file CMetricMap.h.
TMapRepresentation mrpt::maps::CHeightGridMap2D::getMapType | ( | ) |
Return the type of the gas distribution map, according to parameters passed on construction.
|
inherited |
Computes the minimum and maximum height in the grid.
Definition at line 28 of file CHeightGridMap2D_Base.cpp.
References mrpt::maps::CHeightGridMap2D_Base::dem_get_size_x(), mrpt::maps::CHeightGridMap2D_Base::dem_get_size_y(), mrpt::maps::CHeightGridMap2D_Base::dem_get_z_by_cell(), mrpt::mrpt::utils::keep_max(), and mrpt::mrpt::utils::keep_min().
Referenced by getAs3DObject(), and mrpt::maps::CHeightGridMap2D_Base::intersectLine3D().
|
inlineinherited |
Returns the resolution of the grid map.
Definition at line 266 of file CDynamicGrid.h.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::maps::CMetricMap.
|
static |
|
inlineinherited |
Returns the horizontal size of grid map in cells count.
Definition at line 254 of file CDynamicGrid.h.
|
inlineinherited |
Returns the vertical size of grid map in cells count.
Definition at line 256 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "x" coordinate of right side of grid map.
Definition at line 260 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "x" coordinate of left side of grid map.
Definition at line 258 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "y" coordinate of bottom side of grid map.
Definition at line 264 of file CDynamicGrid.h.
|
inlineinherited |
Returns the "y" coordinate of top side of grid map.
Definition at line 262 of file CDynamicGrid.h.
|
inlineprotectedinherited |
Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
Definition at line 57 of file CObservable.h.
References mrpt::utils::CObservable::m_subscribers.
Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
|
inlineinherited |
Transform a global (linear) cell index value into its corresponding (x,y) cell indexes.
Definition at line 283 of file CDynamicGrid.h.
|
inlineinherited |
Transform a cell index into a coordinate value of the cell central point.
Definition at line 291 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
inlineinherited |
Definition at line 295 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
overridevirtual |
Update the DEM with one new point.
Implements mrpt::maps::CHeightGridMap2D_Base.
Definition at line 127 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::cellByPos(), mrpt::maps::CHeightGridMap2D::TInsertionOptions::filterByHeight, mrpt::maps::THeightGridmapCell::h, insertionOptions, mrpt::maps::THeightGridmapCell::u, mrpt::maps::THeightGridmapCell::v, mrpt::maps::THeightGridmapCell::var, mrpt::maps::THeightGridmapCell::w, mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_max, and mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_min.
|
inherited |
Insert the observation information into this map.
This method must be implemented in derived classes. See: Maps and observations compatibility matrix
obs | The observation |
robotPose | The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin. |
Definition at line 95 of file CMetricMap.cpp.
Referenced by ICPTests::align2scans(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun(), mrpt::opengl::CPlanarLaserScan::getBoundingBox(), mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::getICPEdge(), CAngularObservationMesh_fnctr::operator()(), mrpt::opengl::CPlanarLaserScan::render_dl(), TEST(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::updateMapVisualization().
|
inherited |
A wrapper for smart pointers, just calls the non-smart pointer version.
See: Maps and observations compatibility matrix
Definition at line 109 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().
|
overridevirtual |
Internal method called by clear()
Implements mrpt::maps::CMetricMap.
Definition at line 122 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::fill().
|
overridevirtual |
Internal method called by computeObservationLikelihood()
Implements mrpt::maps::CMetricMap.
Definition at line 165 of file CHeightGridMap2D.cpp.
References MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
|
static |
Definition at line 81 of file CHeightGridMap2D.cpp.
References mrpt::maps::CHeightGridMap2D::TMapDefinition::insertionOpts, mrpt::maps::CHeightGridMap2D::TMapDefinition::mapType, mrpt::maps::CHeightGridMap2D::TMapDefinition::max_x, mrpt::maps::CHeightGridMap2D::TMapDefinition::max_y, mrpt::maps::CHeightGridMap2D::TMapDefinition::min_x, mrpt::maps::CHeightGridMap2D::TMapDefinition::min_y, and mrpt::maps::CHeightGridMap2D::TMapDefinition::resolution.
|
overridevirtual |
Internal method called by insertObservation()
Implements mrpt::maps::CMetricMap.
Definition at line 156 of file CHeightGridMap2D.cpp.
References mrpt::maps::CHeightGridMap2D_Base::dem_internal_insertObservation().
|
inherited |
Gets the intersection between a 3D line and a Height Grid map (taking into account the different heights of each individual cell)
Definition at line 57 of file CHeightGridMap2D_Base.cpp.
References mrpt::maps::CHeightGridMap2D_Base::dem_get_resolution(), mrpt::maps::CHeightGridMap2D_Base::dem_get_z(), mrpt::maps::CHeightGridMap2D_Base::getMinMaxHeight(), mrpt::math::TObject3D::getPoint(), mrpt::math::intersect(), min, MRPT_END, MRPT_START, mrpt::math::TPoint3D::norm(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
overridevirtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::maps::CMetricMap.
Definition at line 126 of file CHeightGridMap2D.cpp.
|
inherited |
Load the map contents from a CSimpleMap object, erasing all previous content of the map.
This is done invoking insertObservation()
for each observation at the mean 3D robot pose of each pose-observations pair in the CSimpleMap object.
std::exception | Some internal steps in invoked methods can raise exceptions on invalid parameters, etc... |
Definition at line 37 of file CMetricMap.cpp.
References ASSERTMSG_, mrpt::utils::clear(), mrpt::maps::CSimpleMap::get(), and mrpt::maps::CSimpleMap::size().
Referenced by mrpt::maps::CMetricMap::loadFromSimpleMap(), and run_test_pf_localization().
|
inlineinherited |
!
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 109 of file CMetricMap.h.
References mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations().
Referenced by mrpt::maps::CRandomFieldGridMap2D::internal_clear().
|
inlineprotectedinherited |
Used only from logically const method that really need to modify the object.
Definition at line 47 of file CDynamicGrid.h.
|
static |
Returns default map definition initializer.
See * mrpt::maps::TMetricMapInitializer
Definition at line 33 of file CHeightGridMap2D.cpp.
Definition at line 67 of file CHeightGridMap2D.h.
Definition at line 67 of file CHeightGridMap2D.h.
|
inlinenoexcept |
Definition at line 67 of file CHeightGridMap2D.h.
Definition at line 67 of file CHeightGridMap2D.h.
|
inlinenoexcept |
Definition at line 67 of file CHeightGridMap2D.h.
Definition at line 67 of file CHeightGridMap2D.h.
|
inline |
Definition at line 67 of file CHeightGridMap2D.h.
|
inline |
Definition at line 67 of file CHeightGridMap2D.h.
Called when you want this object to emit an event to all the observers currently subscribed to this object.
Definition at line 47 of file CObservable.cpp.
References MRPT_END, and MRPT_START.
Referenced by mrpt::gui::CDisplayWindow3D::internal_emitGrabImageEvent(), mrpt::gui::CWindowDialog::OnChar(), mrpt::gui::CWindowDialog::OnClose(), mrpt::gui::C3DWindowDialog::OnClose(), mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::gui::C3DWindowDialog::OnResize(), and mrpt::opengl::COpenGLViewport::render().
|
overrideprotectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 211 of file CHeightGridMap2D.cpp.
References ASSERT_, mrpt::utils::CDynamicGrid< THeightGridmapCell >::dyngridcommon_readFromStream(), mrpt::maps::CHeightGridMap2D::TInsertionOptions::filterByHeight, mrpt::maps::CMetricMap::genericMapParams, insertionOptions, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_map, m_mapType, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_max, and mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_min.
|
inlinevirtualinherited |
Changes the size of the grid, maintaining previous contents.
Definition at line 129 of file CDynamicGrid.h.
|
overridevirtual |
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).
Implements mrpt::maps::CMetricMap.
Definition at line 305 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::saveToTextFile().
|
inlineinherited |
Saves a float representation of the grid (via "cell2float()") to a text file.
Definition at line 329 of file CDynamicGrid.h.
Referenced by saveMetricMapRepresentationToFile().
|
inlineinherited |
Changes the size of the grid, ERASING all previous contents.
If fill_value is left as nullptr, the contents of cells may be undefined (some will remain with their old values, the new ones will have the default cell value, but the location of old values may change wrt their old places). If fill_value is not nullptr, it is assured that all cells will have a copy of that value after resizing.
Definition at line 84 of file CDynamicGrid.h.
|
virtualinherited |
Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.
Reimplemented in mrpt::maps::CPointsMap.
Definition at line 170 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, MRPT_UNUSED_PARAM, and THROW_EXCEPTION.
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB. Definition at line 89 of file CSerializable.h.
|
overrideprotectedvirtual |
Introduces a pure virtual method responsible for writing to a CStream.
This can not be used directly be users, instead use "stream << object;" for writing it to a stream.
out | The output binary stream where object must be dumped. |
getVersion | If nullptr, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data. |
std::exception | On any error, see CStream::WriteBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 177 of file CHeightGridMap2D.cpp.
References mrpt::utils::CDynamicGrid< THeightGridmapCell >::dyngridcommon_writeToStream(), mrpt::maps::CHeightGridMap2D::TInsertionOptions::filterByHeight, mrpt::maps::CMetricMap::genericMapParams, insertionOptions, mrpt::utils::CDynamicGrid< THeightGridmapCell >::m_map, m_mapType, mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_max, and mrpt::maps::CHeightGridMap2D::TInsertionOptions::z_min.
|
inlineinherited |
Transform a coordinate values into cell indexes.
Definition at line 268 of file CDynamicGrid.h.
|
inlineinherited |
Definition at line 276 of file CDynamicGrid.h.
|
inlineinherited |
Definition at line 272 of file CDynamicGrid.h.
|
staticprotected |
Definition at line 67 of file CHeightGridMap2D.h.
|
static |
Definition at line 67 of file CHeightGridMap2D.h.
|
inherited |
Common params to all maps.
Definition at line 281 of file CMetricMap.h.
Referenced by mrpt::maps::internal::TMetricMapTypesRegistry::factoryMapObjectFromDefinition(), mrpt::maps::CWirelessPowerGridMap2D::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::getAs3DObject(), mrpt::maps::CReflectivityGridMap2D::getAs3DObject(), getAs3DObject(), mrpt::maps::CBeaconMap::getAs3DObject(), mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), mrpt::maps::CLandmarksMap::getAs3DObject(), mrpt::maps::CPointsMap::getAs3DObject(), mrpt::maps::CWirelessPowerGridMap2D::readFromStream(), mrpt::maps::CGasConcentrationGridMap2D::readFromStream(), mrpt::maps::CReflectivityGridMap2D::readFromStream(), readFromStream(), mrpt::maps::CWirelessPowerGridMap2D::writeToStream(), mrpt::maps::CGasConcentrationGridMap2D::writeToStream(), mrpt::maps::CReflectivityGridMap2D::writeToStream(), and writeToStream().
mrpt::maps::CHeightGridMap2D::TInsertionOptions mrpt::maps::CHeightGridMap2D::insertionOptions |
Referenced by getAs3DObject(), insertIndividualPoint(), readFromStream(), and writeToStream().
|
protectedinherited |
The cells.
Definition at line 44 of file CDynamicGrid.h.
Referenced by countObservedCells(), mrpt::utils::TEnumTypeFiller< maps::CHeightGridMap2D::TMapRepresentation >::fill(), readFromStream(), and writeToStream().
TMapRepresentation mrpt::maps::CHeightGridMap2D::m_mapType |
The map representation type of this map.
Definition at line 154 of file CHeightGridMap2D.h.
Referenced by countObservedCells(), readFromStream(), and writeToStream().
|
static |
ID used to initialize class registration (just ignore it)
Definition at line 172 of file CHeightGridMap2D.h.
|
protectedinherited |
Definition at line 52 of file CDynamicGrid.h.
Referenced by dem_get_resolution().
|
protectedinherited |
Definition at line 53 of file CDynamicGrid.h.
Referenced by dem_get_size_x(), and getAs3DObject().
|
protectedinherited |
Definition at line 53 of file CDynamicGrid.h.
Referenced by dem_get_size_y(), and getAs3DObject().
|
protectedinherited |
Definition at line 52 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
protectedinherited |
Definition at line 52 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
protectedinherited |
Definition at line 52 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
protectedinherited |
Definition at line 52 of file CDynamicGrid.h.
Referenced by getAs3DObject().
|
staticprotected |
Definition at line 67 of file CHeightGridMap2D.h.
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019 |