MRPT  1.9.9
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
mrpt::maps::COccupancyGridMap3D Class Reference

Detailed Description

A 3D occupancy grid map with a regular, even distribution of voxels.

This is a faster alternative to COctoMap, but use with caution with limited map extensions, since it could easily exaust available memory.

Each voxel follows a Bernoulli probability distribution: a value of 0 means certainly occupied, 1 means a certainly empty voxel. Initially 0.5 means uncertainty.

Definition at line 33 of file COccupancyGridMap3D.h.

#include <mrpt/maps/COccupancyGridMap3D.h>

Inheritance diagram for mrpt::maps::COccupancyGridMap3D:

Classes

class  TInsertionOptions
 With this struct options are provided to the observation insertion process. More...
 
class  TLikelihoodOptions
 With this struct options are provided to the observation likelihood computation process. More...
 
struct  TMapDefinition
 
struct  TMapDefinitionBase
 
struct  TRenderingOptions
 Options for the conversion of a mrpt::maps::COccupancyGridMap3D into a mrpt::opengl::COctoMapVoxels. More...
 

Public Types

enum  TLikelihoodMethod { lmLikelihoodField_Thrun = 0, lmRayTracing }
 The type for selecting a likelihood computation method. More...
 
using voxelType = OccGridCellTraits::cellType
 The type of the map voxels: More...
 
using voxelTypeUnsigned = OccGridCellTraits::cellTypeUnsigned
 
using cell_t = OccGridCellTraits::cellType
 The type of cells. More...
 
using traits_t = detail::logoddscell_traits< OccGridCellTraits::cellType >
 
using grid_t = mrpt::containers::CDynamicGrid3D< OccGridCellTraits::cellType >
 

Public Member Functions

 COccupancyGridMap3D (const mrpt::math::TPoint3D &corner_min={-5.0f, -5.0f, -5.0f}, const mrpt::math::TPoint3D &corner_max={5.0f, 5.0f, 5.0f}, float resolution=0.25f)
 Constructor. More...
 
void fill (float default_value=0.5f)
 Fills all the voxels with a default value. More...
 
void setSize (const mrpt::math::TPoint3D &corner_min, const mrpt::math::TPoint3D &corner_max, double resolution, float default_value=0.5f)
 Change the size of gridmap, erasing all its previous contents. More...
 
void resizeGrid (const mrpt::math::TPoint3D &corner_min, const mrpt::math::TPoint3D &corner_max, float new_voxels_default_value=0.5f)
 Change the size of gridmap, maintaining previous contents. More...
 
void updateCell (int cx_idx, int cy_idx, int cz_idx, float v)
 Performs the Bayesian fusion of a new observation of a cell. More...
 
void setCellFreeness (unsigned int cx, unsigned int cy, unsigned int cz, float value)
 Change the contents [0,1] (0:occupied, 1:free) of a voxel, given its index. More...
 
float getCellFreeness (unsigned int cx, unsigned int cy, unsigned int cz) const
 Read the real valued [0,1] (0:occupied, 1:free) contents of a voxel, given its index. More...
 
void setFreenessByPos (float x, float y, float z, float value)
 Change the contents [0,1] of a voxel, given its coordinates. More...
 
float getFreenessByPos (float x, float y, float z) const
 Read the real valued [0,1] contents of a voxel, given its coordinates. More...
 
void insertRay (const mrpt::math::TPoint3D &sensor, const mrpt::math::TPoint3D &end, bool endIsOccupied=true)
 Increases the freeness of a ray segment, and the occupancy of the voxel at its end point (unless endIsOccupied=false). More...
 
void insertPointCloud (const mrpt::math::TPoint3D &sensorCenter, const mrpt::maps::CPointsMap &pts, const float maxValidRange=std::numeric_limits< float >::max())
 Calls insertRay() for each point in the point cloud, using as sensor central point (the origin of all rays), the given sensorCenter. More...
 
void getAsOctoMapVoxels (mrpt::opengl::COctoMapVoxels &gl_obj) const
 
void getAs3DObject (mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
 Returns a 3D object representing the map. More...
 
void simulateScanRay (const double x, const double y, const double angle_direction, float &out_range, bool &out_valid, const double max_range_meters, const float threshold_free=0.4f, const double noiseStd=.0, const double angleNoiseStd=.0) const
 Simulate just one "ray" in the grid map. More...
 
double computeLikelihoodField_Thrun (const CPointsMap &pm, const mrpt::poses::CPose3D &relativePose=mrpt::poses::CPose3D())
 Computes the likelihood [0,1] of a set of points, given the current grid map as reference. More...
 
bool isEmpty () const override
 Returns true upon map construction or after calling clear(), the return changes to false upon successful insertObservation() or any other method to load data in the map. More...
 
void determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::TMatchingPairList &correspondences, const TMatchingParams &params, TMatchingExtraResults &extraResults) const override
 See docs in base class: in this class this always returns 0. More...
 
float compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams &params) const override
 See docs in base class: in this class this always returns 0. More...
 
void saveMetricMapRepresentationToFile (const std::string &f) 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 clear ()
 Erase all the contents of the map. 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=nullptr)
 Insert the observation information into this map. More...
 
bool insertObservationPtr (const mrpt::obs::CObservation::Ptr &obs, const mrpt::poses::CPose3D *robotPose=nullptr)
 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...
 
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 determineMatching3D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, mrpt::tfest::TMatchingPairList &correspondences, const TMatchingParams &params, 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::CSimplePointsMapgetAsSimplePointsMap () 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...
 
mrpt::maps::CSimplePointsMapgetAsSimplePointsMap ()
 
virtual mxArraywriteToMatlab () 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 updateCell_fast_occupied (const unsigned x, const unsigned y, const unsigned z, const cell_t logodd_obs, const cell_t thres)
 Performs Bayesian fusion of a new observation of a cell. More...
 
void updateCell_fast_free (const unsigned x, const unsigned y, const unsigned z, const cell_t logodd_obs, const cell_t thres)
 Performs the Bayesian fusion of a new observation of a cell. More...
 
RTTI classes and functions for polymorphic hierarchies
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr () const
 Makes a deep copy of the object and returns a smart pointer to it. More...
 

Static Public Member Functions

static float l2p (const voxelType l)
 Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l)) More...
 
static uint8_t l2p_255 (const voxelType l)
 Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l)) More...
 
static voxelType p2l (const float p)
 Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the valid range of voxelType. More...
 
static void updateCell_fast_occupied (cell_t *theCell, const cell_t logodd_obs, const cell_t thres)
 Performs Bayesian fusion of a new observation of a cell. More...
 
static void updateCell_fast_free (cell_t *theCell, const cell_t logodd_obs, const cell_t thres)
 Performs Bayesian fusion of a new observation of a cell. More...
 

Public Attributes

TInsertionOptions insertionOptions
 With this struct options are provided to the observation insertion process. More...
 
TLikelihoodOptions likelihoodOptions
 
TRenderingOptions renderingOptions
 
TMapGenericParams genericMapParams
 Common params to all maps. More...
 
grid_t m_grid
 The actual 3D voxels container. More...
 

Protected Member Functions

void OnPostSuccesfulInsertObs (const mrpt::obs::CObservation &) override
 See base class. More...
 
void internal_clear () override
 Clear the map: It set all voxels to their default occupancy value (0.5), without changing the resolution (the grid extension is reset to the default values). More...
 
bool internal_insertObservation (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose=nullptr) override
 Insert the observation information into this map. More...
 
void internal_insertObservationScan2D (const mrpt::obs::CObservation2DRangeScan &o, const mrpt::poses::CPose3D &robotPose)
 
void internal_insertObservationScan3D (const mrpt::obs::CObservation3DRangeScan &o, const mrpt::poses::CPose3D &robotPose)
 
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...
 
CSerializable virtual methods
uint8_t serializeGetVersion () const override
 Must return the current versioning number of the object. More...
 
void serializeTo (mrpt::serialization::CArchive &out) const override
 Pure virtual method for writing (serializing) to an abstract archive. More...
 
void serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override
 Pure virtual method for reading (deserializing) from an abstract archive. More...
 
CSerializable virtual methods
virtual void serializeTo (CSchemeArchiveBase &out) const
 Virtual method for writing (serializing) to an abstract schema based archive. More...
 
virtual void serializeFrom (CSchemeArchiveBase &in)
 Virtual method for reading (deserializing) from an abstract schema based archive. More...
 

Static Protected Member Functions

static CLogOddsGridMapLUT< voxelType > & get_logodd_lut ()
 Lookup tables for log-odds. More...
 

Protected Attributes

bool m_is_empty {true}
 True upon construction; used by isEmpty() More...
 

Private Member Functions

double internal_computeObservationLikelihood (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D &takenFrom) override
 Internal method called by computeObservationLikelihood() More...
 
bool internal_canComputeObservationLikelihood (const mrpt::obs::CObservation &obs) const override
 

RTTI stuff

using Ptr = std::shared_ptr< mrpt::maps ::COccupancyGridMap3D >
 
using ConstPtr = std::shared_ptr< const mrpt::maps ::COccupancyGridMap3D >
 
using UniquePtr = std::unique_ptr< mrpt::maps ::COccupancyGridMap3D >
 
using ConstUniquePtr = std::unique_ptr< const mrpt::maps ::COccupancyGridMap3D >
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "mrpt::maps" "::" "COccupancyGridMap3D"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static std::shared_ptr< CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename Alloc , typename... Args>
static Ptr CreateAlloc (const Alloc &alloc, Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () 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( "mrpt::maps::COccupancyGridMap3D" , & mrpt::maps::COccupancyGridMap3D ::MapDefinition, & mrpt::maps::COccupancyGridMap3D ::internal_CreateFromMapDefinition)
 ID used to initialize class registration (just ignore it) More...
 
static mrpt::maps::TMetricMapInitializerMapDefinition ()
 Returns default map definition initializer. More...
 
static COccupancyGridMap3DCreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 Constructor from a map definition structure: initializes the map and * its parameters accordingly. More...
 
static mrpt::maps::CMetricMapinternal_CreateFromMapDefinition (const mrpt::maps::TMetricMapInitializer &def)
 

Member Typedef Documentation

◆ cell_t

The type of cells.

Definition at line 30 of file CLogOddsGridMap3D.h.

◆ ConstPtr

Definition at line 37 of file COccupancyGridMap3D.h.

◆ ConstUniquePtr

using mrpt::maps::COccupancyGridMap3D::ConstUniquePtr = std::unique_ptr<const mrpt::maps :: COccupancyGridMap3D >

Definition at line 37 of file COccupancyGridMap3D.h.

◆ grid_t

Definition at line 32 of file CLogOddsGridMap3D.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 37 of file COccupancyGridMap3D.h.

◆ traits_t

Definition at line 31 of file CLogOddsGridMap3D.h.

◆ UniquePtr

using mrpt::maps::COccupancyGridMap3D::UniquePtr = std::unique_ptr< mrpt::maps :: COccupancyGridMap3D >

Definition at line 37 of file COccupancyGridMap3D.h.

◆ voxelType

The type of the map voxels:

Definition at line 40 of file COccupancyGridMap3D.h.

◆ voxelTypeUnsigned

Definition at line 41 of file COccupancyGridMap3D.h.

Member Enumeration Documentation

◆ TLikelihoodMethod

The type for selecting a likelihood computation method.

Enumerator
lmLikelihoodField_Thrun 
lmRayTracing 

Definition at line 243 of file COccupancyGridMap3D.h.

Constructor & Destructor Documentation

◆ COccupancyGridMap3D()

COccupancyGridMap3D::COccupancyGridMap3D ( const mrpt::math::TPoint3D corner_min = {-5.0f, -5.0f, -5.0f},
const mrpt::math::TPoint3D corner_max = {5.0f, 5.0f, 5.0f},
float  resolution = 0.25f 
)

Constructor.

Definition at line 89 of file COccupancyGridMap3D.cpp.

References MRPT_END, MRPT_START, mrpt::maps::COccupancyGridMap3D::TMapDefinition::resolution, and setSize().

Referenced by internal_CreateFromMapDefinition().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::rtti::TRuntimeClassId* mrpt::maps::COccupancyGridMap3D::_GetBaseClass ( )
staticprotected

◆ auxParticleFilterCleanUp()

virtual void mrpt::maps::CMetricMap::auxParticleFilterCleanUp ( )
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 282 of file CMetricMap.h.

◆ canComputeObservationLikelihood()

bool CMetricMap::canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
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

Parameters
obsThe observation.
See also
computeObservationLikelihood, genericMapParams.enableObservationLikelihood

Definition at line 161 of file CMetricMap.cpp.

◆ canComputeObservationsLikelihood()

bool CMetricMap::canComputeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf) const
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

Parameters
sfThe observations.
See also
canComputeObservationLikelihood

Definition at line 85 of file CMetricMap.cpp.

References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().

Here is the call graph for this function:

◆ clear()

void CMetricMap::clear ( )
inherited

◆ clone()

virtual mrpt::rtti::CObject* mrpt::maps::COccupancyGridMap3D::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::rtti::CObject.

◆ compute3DMatchingRatio()

float COccupancyGridMap3D::compute3DMatchingRatio ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
const TMatchingRatioParams params 
) const
overridevirtual

See docs in base class: in this class this always returns 0.

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 205 of file COccupancyGridMap3D.cpp.

References THROW_EXCEPTION.

◆ computeLikelihoodField_Thrun()

double mrpt::maps::COccupancyGridMap3D::computeLikelihoodField_Thrun ( const CPointsMap pm,
const mrpt::poses::CPose3D relativePose = mrpt::poses::CPose3D() 
)

Computes the likelihood [0,1] of a set of points, given the current grid map as reference.

Parameters
pmThe points map
relativePoseThe relative pose of the points map in this map's coordinates, or nullptr for (0,0,0). See "likelihoodOptions" for configuration parameters.

◆ computeObservationLikelihood() [1/2]

double CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
inherited

Computes the log-likelihood of a given observation given an arbitrary robot 3D pose.

See: Maps and observations compatibility matrix

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
obsThe observation.
Returns
This method returns a log-likelihood.
See also
Used in particle filter algorithms, see: CMultiMetricMapPDF::update

Definition at line 170 of file CMetricMap.cpp.

Referenced by mrpt::maps::CMultiMetricMapPDF::PF_SLAM_computeObservationLikelihoodForParticle().

Here is the caller graph for this function:

◆ computeObservationLikelihood() [2/2]

double CMetricMap::computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose2D takenFrom 
)
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 76 of file CMetricMap.cpp.

◆ computeObservationsLikelihood()

double CMetricMap::computeObservationsLikelihood ( const mrpt::obs::CSensoryFrame sf,
const mrpt::poses::CPose2D takenFrom 
)
inherited

Returns the sum of the log-likelihoods of each individual observation within a mrpt::obs::CSensoryFrame.

See: Maps and observations compatibility matrix

Parameters
takenFromThe robot's pose the observation is supposed to be taken from.
sfThe set of observations in a CSensoryFrame.
Returns
This method returns a log-likelihood.
See also
canComputeObservationsLikelihood

Definition at line 66 of file CMetricMap.cpp.

Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::auxiliarComputeObservationLikelihood().

Here is the caller graph for this function:

◆ Create()

template<typename... Args>
static Ptr mrpt::maps::COccupancyGridMap3D::Create ( Args &&...  args)
inlinestatic

Definition at line 37 of file COccupancyGridMap3D.h.

◆ CreateAlloc()

template<typename Alloc , typename... Args>
static Ptr mrpt::maps::COccupancyGridMap3D::CreateAlloc ( const Alloc &  alloc,
Args &&...  args 
)
inlinestatic

Definition at line 37 of file COccupancyGridMap3D.h.

◆ CreateFromMapDefinition()

mrpt::maps::COccupancyGridMap3D * mrpt::maps::COccupancyGridMap3D::CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

Constructor from a map definition structure: initializes the map and * its parameters accordingly.

Definition at line 24 of file COccupancyGridMap3D.cpp.

◆ CreateObject()

static std::shared_ptr<CObject> mrpt::maps::COccupancyGridMap3D::CreateObject ( )
static

◆ CreateUnique()

template<typename... Args>
static UniquePtr mrpt::maps::COccupancyGridMap3D::CreateUnique ( Args &&...  args)
inlinestatic

Definition at line 37 of file COccupancyGridMap3D.h.

◆ determineMatching2D()

void COccupancyGridMap3D::determineMatching2D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose2D otherMapPose,
mrpt::tfest::TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
overridevirtual

See docs in base class: in this class this always returns 0.

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 189 of file COccupancyGridMap3D.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ determineMatching3D()

void CMetricMap::determineMatching3D ( const mrpt::maps::CMetricMap otherMap,
const mrpt::poses::CPose3D otherMapPose,
mrpt::tfest::TMatchingPairList correspondences,
const TMatchingParams params,
TMatchingExtraResults extraResults 
) const
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:

  • For each point in "otherMap":
    • Transform the point according to otherMapPose
    • Search with a KD-TREE the closest correspondences in "this" map.
    • Add to the set of candidate matchings, if it passes all the thresholds in params.
Parameters
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.
See also
compute3DMatchingRatio

Reimplemented in mrpt::maps::CPointsMap.

Definition at line 131 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().

Here is the caller graph for this function:

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Makes a deep copy of the object and returns a smart pointer to it.

Definition at line 204 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by mrpt::obs::CRawlog::insert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill()

void COccupancyGridMap3D::fill ( float  default_value = 0.5f)

Fills all the voxels with a default value.

Definition at line 152 of file COccupancyGridMap3D.cpp.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::fill(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, and p2l().

Here is the call graph for this function:

◆ get_logodd_lut()

CLogOddsGridMapLUT< COccupancyGridMap3D::voxelType > & COccupancyGridMap3D::get_logodd_lut ( )
staticprotected

Lookup tables for log-odds.

Definition at line 84 of file COccupancyGridMap3D.cpp.

References logodd_lut.

Referenced by l2p(), l2p_255(), and p2l().

Here is the caller graph for this function:

◆ getAs3DObject()

void COccupancyGridMap3D::getAs3DObject ( mrpt::opengl::CSetOfObjects::Ptr outObj) const
overridevirtual

Returns a 3D object representing the map.

See also
renderingOptions

Implements mrpt::maps::CMetricMap.

Definition at line 356 of file COccupancyGridMap3D.cpp.

References mrpt::opengl::COctoMapVoxels::Create(), and getAsOctoMapVoxels().

Here is the call graph for this function:

◆ getAsOctoMapVoxels()

void COccupancyGridMap3D::getAsOctoMapVoxels ( mrpt::opengl::COctoMapVoxels gl_obj) const
See also
renderingOptions

Definition at line 214 of file COccupancyGridMap3D.cpp.

References mrpt::img::TColor::A, mrpt::img::TColorf::asTColor(), mrpt::opengl::COctoMapVoxels::clear(), mrpt::d2f(), mrpt::f2u8(), mrpt::maps::COccupancyGridMap3D::TRenderingOptions::generateFreeVoxels, mrpt::maps::COccupancyGridMap3D::TRenderingOptions::generateGridLines, mrpt::maps::COccupancyGridMap3D::TRenderingOptions::generateOccupiedVoxels, getCellFreeness(), mrpt::opengl::CRenderizable::getColor(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getResolutionXY(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getResolutionZ(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeX(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeY(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeZ(), mrpt::opengl::COctoMapVoxels::getVisualizationMode(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getXMax(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getXMin(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getYMax(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getYMin(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getZMax(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getZMin(), mrpt::containers::CDynamicGrid3D< T, coord_t >::idx2x(), mrpt::containers::CDynamicGrid3D< T, coord_t >::idx2y(), mrpt::containers::CDynamicGrid3D< T, coord_t >::idx2z(), mrpt::opengl::COctoMapVoxels::isCubeTransparencyEnabled(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, MRPT_END, MRPT_START, mrpt::opengl::COctoMapVoxels::push_back_GridCube(), mrpt::opengl::COctoMapVoxels::push_back_Voxel(), renderingOptions, mrpt::opengl::COctoMapVoxels::reserveGridCubes(), mrpt::opengl::COctoMapVoxels::reserveVoxels(), mrpt::opengl::COctoMapVoxels::resizeVoxelSets(), mrpt::round(), mrpt::opengl::COctoMapVoxels::setBoundingBox(), mrpt::opengl::COctoMapVoxels::showVoxels(), mrpt::opengl::COctoMapVoxels::sort_voxels_by_z(), THROW_EXCEPTION, mrpt::maps::COccupancyGridMap3D::TRenderingOptions::visibleFreeVoxels, mrpt::maps::COccupancyGridMap3D::TRenderingOptions::visibleOccupiedVoxels, mrpt::opengl::VOXEL_SET_FREESPACE, and mrpt::opengl::VOXEL_SET_OCCUPIED.

Referenced by getAs3DObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsSimplePointsMap() [1/2]

virtual const mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( ) const
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 nullptr

Reimplemented in mrpt::maps::CMultiMetricMap, and mrpt::maps::CSimplePointsMap.

Definition at line 295 of file CMetricMap.h.

Referenced by mrpt::maps::CPointsMap::compute3DMatchingRatio(), and mrpt::maps::CMetricMap::getAsSimplePointsMap().

Here is the caller graph for this function:

◆ getAsSimplePointsMap() [2/2]

mrpt::maps::CSimplePointsMap* mrpt::maps::CMetricMap::getAsSimplePointsMap ( )
inlineinherited

Definition at line 299 of file CMetricMap.h.

References mrpt::maps::CMetricMap::getAsSimplePointsMap().

Here is the call graph for this function:

◆ getCellFreeness()

float mrpt::maps::COccupancyGridMap3D::getCellFreeness ( unsigned int  cx,
unsigned int  cy,
unsigned int  cz 
) const
inline

Read the real valued [0,1] (0:occupied, 1:free) contents of a voxel, given its index.

Definition at line 142 of file COccupancyGridMap3D.h.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), l2p(), and mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid.

Referenced by getAsOctoMapVoxels(), and getFreenessByPos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClassName()

static constexpr auto mrpt::maps::COccupancyGridMap3D::getClassName ( )
inlinestatic

Definition at line 37 of file COccupancyGridMap3D.h.

◆ getFreenessByPos()

float mrpt::maps::COccupancyGridMap3D::getFreenessByPos ( float  x,
float  y,
float  z 
) const
inline

Read the real valued [0,1] contents of a voxel, given its coordinates.

Definition at line 159 of file COccupancyGridMap3D.h.

References getCellFreeness(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, mrpt::containers::CDynamicGrid3D< T, coord_t >::x2idx(), mrpt::containers::CDynamicGrid3D< T, coord_t >::y2idx(), and mrpt::containers::CDynamicGrid3D< T, coord_t >::z2idx().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::maps::COccupancyGridMap3D::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::maps::CMetricMap.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::maps::COccupancyGridMap3D::GetRuntimeClassIdStatic ( )
static

◆ hasSubscribers()

bool mrpt::system::CObservable::hasSubscribers ( ) const
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 53 of file CObservable.h.

References mrpt::system::CObservable::m_subscribers.

Referenced by mrpt::gui::CWindowDialog::OnMouseDown(), mrpt::gui::CWindowDialog::OnMouseMove(), mrpt::gui::CWindowDialog::OnResize(), mrpt::opengl::COpenGLViewport::render(), and mrpt::opengl::COpenGLViewport::renderNormalSceneMode().

Here is the caller graph for this function:

◆ insertObservation()

bool CMetricMap::insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
inherited

Insert the observation information into this map.

This method must be implemented in derived classes. See: Maps and observations compatibility matrix

Parameters
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use the origin.
See also
CObservation::insertObservationInto

Definition at line 93 of file CMetricMap.cpp.

Referenced by ICPTests::align2scans(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun(), mrpt::graphslam::deciders::CRangeScanOps< GRAPH_T >::getICPEdge(), CAngularObservationMesh_fnctr::operator()(), TEST(), and mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::updateMapVisualization().

Here is the caller graph for this function:

◆ insertObservationPtr()

bool CMetricMap::insertObservationPtr ( const mrpt::obs::CObservation::Ptr obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
inherited

A wrapper for smart pointers, just calls the non-smart pointer version.

See: Maps and observations compatibility matrix

Definition at line 107 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::slam::CMetricMapBuilderICP::processObservation().

Here is the caller graph for this function:

◆ insertPointCloud()

void COccupancyGridMap3D::insertPointCloud ( const mrpt::math::TPoint3D sensorCenter,
const mrpt::maps::CPointsMap pts,
const float  maxValidRange = std::numeric_limits<float>::max() 
)

Calls insertRay() for each point in the point cloud, using as sensor central point (the origin of all rays), the given sensorCenter.

Parameters
[in]maxValidRangeIf a point has larger distance from sensorCenter than maxValidRange, it will be considered a non-echo, and NO occupied voxel will be created at the end of the segment.
See also
insertionOptions parameters are observed in this method.

Definition at line 73 of file COccupancyGridMap3D_insert.cpp.

References mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation, mrpt::maps::CPointsMap::getPointsBufferRef_x(), mrpt::maps::CPointsMap::getPointsBufferRef_y(), mrpt::maps::CPointsMap::getPointsBufferRef_z(), insertionOptions, insertRay(), MRPT_END, and MRPT_START.

Referenced by internal_insertObservationScan2D(), and internal_insertObservationScan3D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertRay()

void COccupancyGridMap3D::insertRay ( const mrpt::math::TPoint3D sensor,
const mrpt::math::TPoint3D end,
bool  endIsOccupied = true 
)

◆ internal_canComputeObservationLikelihood()

bool COccupancyGridMap3D::internal_canComputeObservationLikelihood ( const mrpt::obs::CObservation obs) const
overrideprivate

Definition at line 25 of file COccupancyGridMap3D_likelihood.cpp.

◆ internal_clear()

void COccupancyGridMap3D::internal_clear ( )
overrideprotectedvirtual

Clear the map: It set all voxels to their default occupancy value (0.5), without changing the resolution (the grid extension is reset to the default values).

Implements mrpt::maps::CMetricMap.

Definition at line 139 of file COccupancyGridMap3D.cpp.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::getResolutionXY(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, m_is_empty, mrpt::maps::COccupancyGridMap3D::TMapDefinition::max_x, mrpt::maps::COccupancyGridMap3D::TMapDefinition::max_y, mrpt::maps::COccupancyGridMap3D::TMapDefinition::max_z, mrpt::maps::COccupancyGridMap3D::TMapDefinition::min_x, mrpt::maps::COccupancyGridMap3D::TMapDefinition::min_y, mrpt::maps::COccupancyGridMap3D::TMapDefinition::min_z, and setSize().

Here is the call graph for this function:

◆ internal_computeObservationLikelihood()

double COccupancyGridMap3D::internal_computeObservationLikelihood ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D takenFrom 
)
overrideprivatevirtual

Internal method called by computeObservationLikelihood()

Implements mrpt::maps::CMetricMap.

Definition at line 18 of file COccupancyGridMap3D_likelihood.cpp.

References THROW_EXCEPTION.

◆ internal_CreateFromMapDefinition()

mrpt::maps::CMetricMap * COccupancyGridMap3D::internal_CreateFromMapDefinition ( const mrpt::maps::TMetricMapInitializer def)
static

Definition at line 65 of file COccupancyGridMap3D.cpp.

References COccupancyGridMap3D().

Here is the call graph for this function:

◆ internal_insertObservation()

bool COccupancyGridMap3D::internal_insertObservation ( const mrpt::obs::CObservation obs,
const mrpt::poses::CPose3D robotPose = nullptr 
)
overrideprotectedvirtual

Insert the observation information into this map.

Parameters
obsThe observation
robotPoseThe 3D pose of the robot mobile base in the map reference system, or nullptr (default) if you want to use CPose2D(0,0,deg)
See also
insertionOptions, CObservation::insertObservationInto

Implements mrpt::maps::CMetricMap.

Definition at line 23 of file COccupancyGridMap3D_insert.cpp.

References internal_insertObservationScan2D(), internal_insertObservationScan3D(), MRPT_END, and MRPT_START.

Here is the call graph for this function:

◆ internal_insertObservationScan2D()

void COccupancyGridMap3D::internal_insertObservationScan2D ( const mrpt::obs::CObservation2DRangeScan o,
const mrpt::poses::CPose3D robotPose 
)
protected

Definition at line 49 of file COccupancyGridMap3D_insert.cpp.

References mrpt::maps::CPointsMap::insertionOptions, insertPointCloud(), MRPT_END, MRPT_START, and mrpt::obs::CObservation2DRangeScan::sensorPose.

Referenced by internal_insertObservation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internal_insertObservationScan3D()

void COccupancyGridMap3D::internal_insertObservationScan3D ( const mrpt::obs::CObservation3DRangeScan o,
const mrpt::poses::CPose3D robotPose 
)
protected

Definition at line 93 of file COccupancyGridMap3D_insert.cpp.

References mrpt::poses::CPose3D::changeCoordinatesReference(), mrpt::obs::T3DPointsProjectionParams::decimation, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation_3d_range, insertionOptions, insertPointCloud(), mrpt::obs::CObservation3DRangeScan::maxRange, MRPT_END, MRPT_START, mrpt::obs::CObservation3DRangeScan::sensorPose, mrpt::obs::T3DPointsProjectionParams::takeIntoAccountSensorPoseOnRobot, and mrpt::obs::detail::unprojectInto().

Referenced by internal_insertObservation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool COccupancyGridMap3D::isEmpty ( ) const
overridevirtual

Returns true upon map construction or after calling clear(), the return changes to false upon successful insertObservation() or any other method to load data in the map.

Implements mrpt::maps::CMetricMap.

Definition at line 203 of file COccupancyGridMap3D.cpp.

References m_is_empty.

◆ l2p()

static float mrpt::maps::COccupancyGridMap3D::l2p ( const voxelType  l)
inlinestatic

Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l))

Definition at line 110 of file COccupancyGridMap3D.h.

References get_logodd_lut().

Referenced by getCellFreeness().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ l2p_255()

static uint8_t mrpt::maps::COccupancyGridMap3D::l2p_255 ( const voxelType  l)
inlinestatic

Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l))

Definition at line 116 of file COccupancyGridMap3D.h.

References get_logodd_lut().

Here is the call graph for this function:

◆ loadFromProbabilisticPosesAndObservations()

void CMetricMap::loadFromProbabilisticPosesAndObservations ( const mrpt::maps::CSimpleMap Map)
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.

See also
insertObservation, CSimpleMap
Exceptions
std::exceptionSome internal steps in invoked methods can raise exceptions on invalid parameters, etc...

Definition at line 36 of file CMetricMap.cpp.

References ASSERTMSG_, mrpt::containers::clear(), mrpt::maps::CSimpleMap::get(), and mrpt::maps::CSimpleMap::size().

Referenced by mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), mrpt::maps::CMetricMap::loadFromSimpleMap(), mrpt::apps::CGridMapAlignerApp::run(), and run_test_pf_localization().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromSimpleMap()

void mrpt::maps::CMetricMap::loadFromSimpleMap ( const mrpt::maps::CSimpleMap Map)
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 106 of file CMetricMap.h.

References mrpt::maps::CMetricMap::loadFromProbabilisticPosesAndObservations().

Referenced by mrpt::maps::CRandomFieldGridMap2D::internal_clear(), and mrpt::ros1bridge::MapHdl::loadMap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapDefinition()

mrpt::maps::TMetricMapInitializer * mrpt::maps::COccupancyGridMap3D::MapDefinition ( )
static

Returns default map definition initializer.

See * mrpt::maps::TMetricMapInitializer

Definition at line 24 of file COccupancyGridMap3D.cpp.

◆ OnPostSuccesfulInsertObs()

void COccupancyGridMap3D::OnPostSuccesfulInsertObs ( const mrpt::obs::CObservation )
overrideprotectedvirtual

See base class.

Reimplemented from mrpt::maps::CMetricMap.

Definition at line 205 of file COccupancyGridMap3D_insert.cpp.

References m_is_empty.

◆ p2l()

static voxelType mrpt::maps::COccupancyGridMap3D::p2l ( const float  p)
inlinestatic

Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the valid range of voxelType.

Definition at line 122 of file COccupancyGridMap3D.h.

References get_logodd_lut().

Referenced by fill(), insertRay(), resizeGrid(), setCellFreeness(), setSize(), and updateCell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publishEvent()

void CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

Called when you want this object to emit an event to all the observers currently subscribed to this object.

Definition at line 57 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(), mrpt::opengl::COpenGLViewport::render(), and mrpt::opengl::COpenGLViewport::renderNormalSceneMode().

Here is the caller graph for this function:

◆ resizeGrid()

void COccupancyGridMap3D::resizeGrid ( const mrpt::math::TPoint3D corner_min,
const mrpt::math::TPoint3D corner_max,
float  new_voxels_default_value = 0.5f 
)

Change the size of gridmap, maintaining previous contents.

Parameters
new_voxels_default_valueValue of new voxels, tipically 0.5
See also
setSize()

Definition at line 121 of file COccupancyGridMap3D.cpp.

References mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, m_is_empty, MRPT_END, MRPT_START, p2l(), mrpt::containers::CDynamicGrid3D< T, coord_t >::resize(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ saveMetricMapRepresentationToFile()

void COccupancyGridMap3D::saveMetricMapRepresentationToFile ( const std::string &  filNamePrefix) const
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 494 of file COccupancyGridMap3D.cpp.

◆ serializeFrom() [1/2]

void COccupancyGridMap3D::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 407 of file COccupancyGridMap3D.cpp.

References ASSERT_, mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation_3d_range, mrpt::containers::CDynamicGrid3D< T, coord_t >::dyngridcommon_readFromStream(), mrpt::maps::TMetricMapInitializer::genericMapParams, mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeX(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeY(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeZ(), insertionOptions, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_decimation, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_maxCorrsDistance, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_maxRange, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_stdHit, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_useSquareDist, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_zHit, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_zRandom, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::likelihoodMethod, likelihoodOptions, mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, m_is_empty, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxDistanceInsertion, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxFreenessUpdateCertainty, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxOccupancyUpdateCertainty, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::rayTracing_decimation, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::rayTracing_stdHit, mrpt::serialization::CArchive::ReadAsAndCastTo(), mrpt::serialization::CArchive::ReadBuffer(), mrpt::serialization::CArchive::ReadBufferFixEndianness(), mrpt::maps::COccupancyGridMap3D::TRenderingOptions::readFromStream(), and renderingOptions.

Here is the call graph for this function:

◆ serializeFrom() [2/2]

virtual void mrpt::serialization::CSerializable::serializeFrom ( CSchemeArchiveBase in)
inlineprotectedvirtualinherited

Virtual method for reading (deserializing) from an abstract schema based archive.

Definition at line 74 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeGetVersion()

uint8_t COccupancyGridMap3D::serializeGetVersion ( ) const
overrideprotectedvirtual

Must return the current versioning number of the object.

Start in zero for new classes, and increments each time there is a change in the stored format.

Implements mrpt::serialization::CSerializable.

Definition at line 364 of file COccupancyGridMap3D.cpp.

◆ serializeTo() [1/2]

void COccupancyGridMap3D::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 365 of file COccupancyGridMap3D.cpp.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::decimation_3d_range, mrpt::containers::CDynamicGrid3D< T, coord_t >::dyngridcommon_writeToStream(), mrpt::maps::TMetricMapInitializer::genericMapParams, mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeX(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeY(), mrpt::containers::CDynamicGrid3D< T, coord_t >::getSizeZ(), insertionOptions, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_decimation, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_maxCorrsDistance, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_maxRange, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_stdHit, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_useSquareDist, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_zHit, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::LF_zRandom, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::likelihoodMethod, likelihoodOptions, mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxDistanceInsertion, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxFreenessUpdateCertainty, mrpt::maps::COccupancyGridMap3D::TInsertionOptions::maxOccupancyUpdateCertainty, out, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::rayTracing_decimation, mrpt::maps::COccupancyGridMap3D::TLikelihoodOptions::rayTracing_stdHit, renderingOptions, and mrpt::maps::COccupancyGridMap3D::TRenderingOptions::writeToStream().

Here is the call graph for this function:

◆ serializeTo() [2/2]

virtual void mrpt::serialization::CSerializable::serializeTo ( CSchemeArchiveBase out) const
inlineprotectedvirtualinherited

Virtual method for writing (serializing) to an abstract schema based archive.

Definition at line 64 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ setCellFreeness()

void mrpt::maps::COccupancyGridMap3D::setCellFreeness ( unsigned int  cx,
unsigned int  cy,
unsigned int  cz,
float  value 
)
inline

Change the contents [0,1] (0:occupied, 1:free) of a voxel, given its index.

Definition at line 133 of file COccupancyGridMap3D.h.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, and p2l().

Referenced by setFreenessByPos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFreenessByPos()

void mrpt::maps::COccupancyGridMap3D::setFreenessByPos ( float  x,
float  y,
float  z,
float  value 
)
inline

Change the contents [0,1] of a voxel, given its coordinates.

Definition at line 152 of file COccupancyGridMap3D.h.

References mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, setCellFreeness(), mrpt::containers::CDynamicGrid3D< T, coord_t >::x2idx(), mrpt::containers::CDynamicGrid3D< T, coord_t >::y2idx(), and mrpt::containers::CDynamicGrid3D< T, coord_t >::z2idx().

Here is the call graph for this function:

◆ setSize()

void COccupancyGridMap3D::setSize ( const mrpt::math::TPoint3D corner_min,
const mrpt::math::TPoint3D corner_max,
double  resolution,
float  default_value = 0.5f 
)

Change the size of gridmap, erasing all its previous contents.

Parameters
resolutionThe new size of voxels.
default_valueThe value of voxels, tipically 0.5.
See also
ResizeGrid

Definition at line 98 of file COccupancyGridMap3D.cpp.

References ASSERT_ABOVE_, ASSERT_ABOVEEQ_, ASSERT_BELOWEQ_, mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, m_is_empty, MRPT_END, MRPT_START, p2l(), mrpt::containers::CDynamicGrid3D< T, coord_t >::setSize(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Referenced by COccupancyGridMap3D(), and internal_clear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simulateScanRay()

void mrpt::maps::COccupancyGridMap3D::simulateScanRay ( const double  x,
const double  y,
const double  angle_direction,
float &  out_range,
bool &  out_valid,
const double  max_range_meters,
const float  threshold_free = 0.4f,
const double  noiseStd = .0,
const double  angleNoiseStd = .0 
) const

Simulate just one "ray" in the grid map.

This method is used internally to sonarSimulator and laserScanSimulator.

See also
COccupancyGridMap3D::RAYTRACE_STEP_SIZE_IN_CELL_UNITS

◆ squareDistanceToClosestCorrespondence()

float CMetricMap::squareDistanceToClosestCorrespondence ( float  x0,
float  y0 
) const
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 153 of file CMetricMap.cpp.

References MRPT_END, MRPT_START, and THROW_EXCEPTION.

◆ updateCell()

void COccupancyGridMap3D::updateCell ( int  cx_idx,
int  cy_idx,
int  cz_idx,
float  v 
)

Performs the Bayesian fusion of a new observation of a cell.

See also
updateInfoChangeOnly, updateCell_fast_occupied, updateCell_fast_free

Definition at line 159 of file COccupancyGridMap3D.cpp.

References ASSERT_, mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::containers::CDynamicGrid3D< T, coord_t >::isOutOfBounds(), mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::m_grid, and p2l().

Here is the call graph for this function:

◆ updateCell_fast_free() [1/2]

static void mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::updateCell_fast_free ( cell_t theCell,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlinestaticinherited

Performs Bayesian fusion of a new observation of a cell.

This method increases the "free-ness" of a cell, managing possible saturation.

Parameters
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MAX-logodd_obs
See also
updateCell_fast_occupied

Definition at line 83 of file CLogOddsGridMap3D.h.

Referenced by insertRay().

◆ updateCell_fast_free() [2/2]

void mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::updateCell_fast_free ( const unsigned  x,
const unsigned  y,
const unsigned  z,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlineinherited

Performs the Bayesian fusion of a new observation of a cell.

This method increases the "free-ness" of a cell, managing possible saturation.

Parameters
xCell index in X axis.
yCell index in Y axis.
zCell index in Z axis.
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MAX-logodd_obs
See also
updateCell_fast_occupied

Definition at line 104 of file CLogOddsGridMap3D.h.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::maps::CLogOddsGridMap3D< TCELL >::m_grid, and mrpt::maps::CLogOddsGridMap3D< TCELL >::updateCell_fast_free().

◆ updateCell_fast_occupied() [1/2]

static void mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::updateCell_fast_occupied ( cell_t theCell,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlinestaticinherited

Performs Bayesian fusion of a new observation of a cell.

This method increases the "occupancy-ness" of a cell, managing possible saturation.

Parameters
theCellThe cell to modify
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MIN+logodd_obs
See also
updateCell, updateCell_fast_free

Definition at line 46 of file CLogOddsGridMap3D.h.

Referenced by insertRay().

◆ updateCell_fast_occupied() [2/2]

void mrpt::maps::CLogOddsGridMap3D< OccGridCellTraits::cellType >::updateCell_fast_occupied ( const unsigned  x,
const unsigned  y,
const unsigned  z,
const cell_t  logodd_obs,
const cell_t  thres 
)
inlineinherited

Performs Bayesian fusion of a new observation of a cell.

This method increases the "occupancy-ness" of a cell, managing possible saturation.

Parameters
xCell index in X axis.
yCell index in Y axis.
zCell index in Z axis.
logodd_obsObservation of the cell, in log-odd form as transformed by p2l.
thresThis must be CELLTYPE_MIN+logodd_obs
See also
updateCell, updateCell_fast_free

Definition at line 67 of file CLogOddsGridMap3D.h.

References mrpt::containers::CDynamicGrid3D< T, coord_t >::cellByIndex(), mrpt::maps::CLogOddsGridMap3D< TCELL >::m_grid, and mrpt::maps::CLogOddsGridMap3D< TCELL >::updateCell_fast_occupied().

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::CSerializable::writeToMatlab ( ) const
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.

Returns
A new mxArray (caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB.

Definition at line 90 of file CSerializable.h.

Member Data Documentation

◆ className

constexpr const char* mrpt::maps::COccupancyGridMap3D::className = "mrpt::maps" "::" "COccupancyGridMap3D"
static

Definition at line 37 of file COccupancyGridMap3D.h.

◆ genericMapParams

TMapGenericParams mrpt::maps::CMetricMap::genericMapParams
inherited

◆ insertionOptions

TInsertionOptions mrpt::maps::COccupancyGridMap3D::insertionOptions

With this struct options are provided to the observation insertion process.

See also
CObservation::insertIntoGridMap

Definition at line 240 of file COccupancyGridMap3D.h.

Referenced by insertPointCloud(), insertRay(), internal_insertObservationScan3D(), serializeFrom(), and serializeTo().

◆ likelihoodOptions

TLikelihoodOptions mrpt::maps::COccupancyGridMap3D::likelihoodOptions

Definition at line 302 of file COccupancyGridMap3D.h.

Referenced by serializeFrom(), and serializeTo().

◆ m_grid

◆ m_is_empty

bool mrpt::maps::COccupancyGridMap3D::m_is_empty {true}
protected

True upon construction; used by isEmpty()

Definition at line 48 of file COccupancyGridMap3D.h.

Referenced by internal_clear(), isEmpty(), OnPostSuccesfulInsertObs(), resizeGrid(), serializeFrom(), and setSize().

◆ m_private_map_register_id

const size_t mrpt::maps::COccupancyGridMap3D::m_private_map_register_id = mrpt::maps::internal::TMetricMapTypesRegistry::Instance().doRegister( "mrpt::maps::COccupancyGridMap3D" , & mrpt::maps::COccupancyGridMap3D ::MapDefinition, & mrpt::maps::COccupancyGridMap3D ::internal_CreateFromMapDefinition)
static

ID used to initialize class registration (just ignore it)

Definition at line 399 of file COccupancyGridMap3D.h.

◆ renderingOptions

TRenderingOptions mrpt::maps::COccupancyGridMap3D::renderingOptions

Definition at line 335 of file COccupancyGridMap3D.h.

Referenced by getAsOctoMapVoxels(), serializeFrom(), and serializeTo().

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::maps::COccupancyGridMap3D::runtimeClassId
staticprotected

Definition at line 37 of file COccupancyGridMap3D.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020