MRPT
2.0.4
|
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ library.
This version stores both, occupancy information and RGB colour data at each octree node. See the base class mrpt::maps::COctoMapBase.
Definition at line 36 of file CColouredOctoMap.h.
#include <mrpt/maps/CColouredOctoMap.h>
Classes | |
struct | TMapDefinition |
struct | TMapDefinitionBase |
Public Types | |
enum | TColourUpdate { INTEGRATE = 0, SET, AVERAGE } |
This allows the user to select the desired method to update voxels colour. More... | |
using | myself_t = COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode > |
Public Member Functions | |
CColouredOctoMap (const double resolution=0.10) | |
Default constructor. More... | |
~CColouredOctoMap () override | |
Destructor. More... | |
bool | getPointColour (const float x, const float y, const float z, uint8_t &r, uint8_t &g, uint8_t &b) const |
Get the RGB colour of a point. More... | |
void | updateVoxelColour (const double x, const double y, const double z, const uint8_t r, const uint8_t g, const uint8_t b) |
Manually update the colour of the voxel at (x,y,z) More... | |
void | setVoxelColourMethod (TColourUpdate new_method) |
Set the method used to update voxels colour. More... | |
TColourUpdate | getVoxelColourMethod () |
Get the method used to update voxels colour. More... | |
void | getAsOctoMapVoxels (mrpt::opengl::COctoMapVoxels &gl_obj) const override |
Builds a renderizable representation of the octomap as a mrpt::opengl::COctoMapVoxels object. More... | |
bool | isEmpty () const override |
Returns true if the map is empty/no observation has been inserted. More... | |
OCTOMAP_CLASS & | getOctomap () |
Get a reference to the internal octomap object. 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. More... | |
bool | getPointOccupancy (const float x, const float y, const float z, double &prob_occupancy) const |
Get the occupancy probability [0,1] of a point. More... | |
void | insertPointCloud (const CPointsMap &ptMap, const float sensor_x, const float sensor_y, const float sensor_z) |
Update the octomap with a 2D or 3D scan, given directly as a point cloud and the 3D location of the sensor (the origin of the rays) in this map's frame of reference. More... | |
bool | castRay (const mrpt::math::TPoint3D &origin, const mrpt::math::TPoint3D &direction, mrpt::math::TPoint3D &end, bool ignoreUnknownCells=false, double maxRange=-1.0) const |
Performs raycasting in 3d, similar to computeRay(). 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 | determineMatching2D (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose2D &otherMapPose, mrpt::tfest::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::tfest::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 float | compute3DMatchingRatio (const mrpt::maps::CMetricMap *otherMap, const mrpt::poses::CPose3D &otherMapPose, const TMatchingRatioParams ¶ms) const |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps. 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... | |
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... | |
Direct access to octomap library methods | |
void | insertRay (const float end_x, const float end_y, const float end_z, const float sensor_x, const float sensor_y, const float sensor_z) |
Just like insertPointCloud but with a single ray. More... | |
void | updateVoxel (const double x, const double y, const double z, bool occupied) |
Manually updates the occupancy of the voxel at (x,y,z) as being occupied (true) or free (false), using the log-odds parameters in insertionOptions. More... | |
bool | isPointWithinOctoMap (const float x, const float y, const float z) const |
Check whether the given point lies within the volume covered by the octomap (that is, whether it is "mapped") More... | |
double | getResolution () const |
unsigned int | getTreeDepth () const |
size_t | size () const |
size_t | memoryUsage () const |
size_t | memoryUsageNode () const |
size_t | memoryFullGrid () const |
double | volume () |
void | getMetricSize (double &x, double &y, double &z) |
Size of OcTree (all known space) in meters for x, y and z dimension. More... | |
void | getMetricSize (double &x, double &y, double &z) const |
Size of OcTree (all known space) in meters for x, y and z dimension. More... | |
void | getMetricMin (double &x, double &y, double &z) |
minimum value of the bounding box of all known space in x, y, z More... | |
void | getMetricMin (double &x, double &y, double &z) const |
minimum value of the bounding box of all known space in x, y, z More... | |
void | getMetricMax (double &x, double &y, double &z) |
maximum value of the bounding box of all known space in x, y, z More... | |
void | getMetricMax (double &x, double &y, double &z) const |
maximum value of the bounding box of all known space in x, y, z More... | |
size_t | calcNumNodes () const |
Traverses the tree to calculate the total number of nodes. More... | |
size_t | getNumLeafNodes () const |
Traverses the tree to calculate the total number of leaf nodes. More... | |
void | setOccupancyThres (double prob) override |
void | setProbHit (double prob) override |
void | setProbMiss (double prob) override |
void | setClampingThresMin (double thresProb) override |
void | setClampingThresMax (double thresProb) override |
double | getOccupancyThres () const override |
float | getOccupancyThresLog () const override |
double | getProbHit () const override |
float | getProbHitLog () const override |
double | getProbMiss () const override |
float | getProbMissLog () const override |
double | getClampingThresMin () const override |
float | getClampingThresMinLog () const override |
double | getClampingThresMax () const override |
float | getClampingThresMaxLog () const override |
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... | |
Public Attributes | |
TInsertionOptions | insertionOptions |
The options used when inserting. More... | |
TLikelihoodOptions | likelihoodOptions |
TRenderingOptions | renderingOptions |
TMapGenericParams | genericMapParams |
Common params to all maps. More... | |
Protected Member Functions | |
void | internal_clear () override |
Internal method called by clear() More... | |
bool | internal_insertObservation (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose) override |
Internal method called by insertObservation() More... | |
bool | internal_build_PointCloud_for_observation (const mrpt::obs::CObservation &obs, const mrpt::poses::CPose3D *robotPose, octomap_point3d &sensorPt, octomap_pointcloud &scan) const |
Builds the list of 3D points in global coordinates for a generic observation. More... | |
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... | |
Protected Attributes | |
TColourUpdate | m_colour_method |
mrpt::pimpl< Impl > | m_impl |
RTTI stuff | |
using | Ptr = std::shared_ptr< mrpt::maps ::CColouredOctoMap > |
using | ConstPtr = std::shared_ptr< const mrpt::maps ::CColouredOctoMap > |
using | UniquePtr = std::unique_ptr< mrpt::maps ::CColouredOctoMap > |
using | ConstUniquePtr = std::unique_ptr< const mrpt::maps ::CColouredOctoMap > |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "mrpt::maps" "::" "CColouredOctoMap" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static std::shared_ptr< CObject > | CreateObject () |
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::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::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( "mrpt::maps::CColouredOctoMap,colourOctoMap,colorOctoMap" , & mrpt::maps::CColouredOctoMap ::MapDefinition, & mrpt::maps::CColouredOctoMap ::internal_CreateFromMapDefinition) |
ID used to initialize class registration (just ignore it) More... | |
static mrpt::maps::TMetricMapInitializer * | MapDefinition () |
Returns default map definition initializer. More... | |
static CColouredOctoMap * | 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::CColouredOctoMap::ConstPtr = std::shared_ptr<const mrpt::maps :: CColouredOctoMap > |
Definition at line 40 of file CColouredOctoMap.h.
using mrpt::maps::CColouredOctoMap::ConstUniquePtr = std::unique_ptr<const mrpt::maps :: CColouredOctoMap > |
Definition at line 40 of file CColouredOctoMap.h.
|
inherited |
Definition at line 48 of file COctoMapBase.h.
using mrpt::maps::CColouredOctoMap::Ptr = std::shared_ptr< mrpt::maps :: CColouredOctoMap > |
A type for the associated smart pointer
Definition at line 40 of file CColouredOctoMap.h.
using mrpt::maps::CColouredOctoMap::UniquePtr = std::unique_ptr< mrpt::maps :: CColouredOctoMap > |
Definition at line 40 of file CColouredOctoMap.h.
This allows the user to select the desired method to update voxels colour.
SET = Set the colour of the voxel at (x,y,z) directly AVERAGE = Set the colour of the voxel at (x,y,z) as the mean of its previous colour and the new observed one. INTEGRATE = Calculate the new colour of the voxel at (x,y,z) using this formula: prev_color*node_prob + new_color*(0.99-node_prob) If there isn't any previous color, any method is equivalent to SET. INTEGRATE is the default option
Enumerator | |
---|---|
INTEGRATE | |
SET | |
AVERAGE |
Definition at line 56 of file CColouredOctoMap.h.
CColouredOctoMap::CColouredOctoMap | ( | const double | resolution = 0.10 | ) |
Default constructor.
Definition at line 87 of file CColouredOctoMap.cpp.
|
overridedefault |
Destructor.
|
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 282 of file CMetricMap.h.
size_t CColouredOctoMap::calcNumNodes | ( | ) | const |
Traverses the tree to calculate the total number of nodes.
Definition at line 475 of file CColouredOctoMap.cpp.
|
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 161 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 85 of file CMetricMap.cpp.
References mrpt::obs::CSensoryFrame::begin(), and mrpt::obs::CSensoryFrame::end().
|
inherited |
Performs raycasting in 3d, similar to computeRay().
A ray is cast from origin with a given direction, the first occupied cell is returned (as center coordinate). If the starting coordinate is already occupied in the tree, this coordinate will be returned as a hit.
origin | starting coordinate of ray |
direction | A vector pointing in the direction of the raycast. Does not need to be normalized. |
end | returns the center of the cell that was hit by the ray, if successful |
ignoreUnknownCells | whether unknown cells are ignored. If false (default), the raycast aborts when an unkown cell is hit. |
maxRange | Maximum range after which the raycast is aborted (<= 0: no limit, default) |
Definition at line 276 of file COctoMapBase_impl.h.
|
inherited |
Erase all the contents of the map.
Definition at line 30 of file CMetricMap.cpp.
Referenced by mrpt::maps::CHeightGridMap2D_MRF::CHeightGridMap2D_MRF(), mrpt::maps::CReflectivityGridMap2D::clear(), mrpt::maps::CHeightGridMap2D::clear(), mrpt::maps::CRandomFieldGridMap2D::clear(), mrpt::apps::MonteCarloLocalization_Base::do_pf_localization(), mrpt::maps::CPointsMap::extractCylinder(), mrpt::maps::CPointsMap::extractPoints(), mrpt::ros1bridge::fromROS(), mrpt::opengl::CAngularObservationMesh::generatePointCloud(), mrpt::maps::COccupancyGridMap2D::getAsPointCloud(), mrpt::nav::CReactiveNavigationSystem3D::loggingGetWSObstaclesAndShape(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::vision::projectMatchedFeatures(), run_rnav_test(), mrpt::maps::CPointsMap::setFromPCLPointCloud(), mrpt::maps::CColouredPointsMap::setFromPCLPointCloudRGB(), mrpt::maps::CPointsMapXYZI::setFromPCLPointCloudXYZI(), mrpt::maps::CRandomFieldGridMap2D::setSize(), and mrpt::nav::PlannerTPS_VirtualBase::transformPointcloudWithSquareClipping().
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
|
virtualinherited |
Computes the ratio in [0,1] of correspondences between "this" and the "otherMap" map, whose 6D pose relative to "this" is "otherMapPose" In the case of a multi-metric map, this returns the average between the maps.
This method always return 0 for grid maps.
otherMap | [IN] The other map to compute the matching with. |
otherMapPose | [IN] The 6D pose of the other map as seen from "this". |
params | [IN] Matching parameters |
Reimplemented in mrpt::maps::COccupancyGridMap2D, mrpt::maps::CPointsMap, mrpt::maps::COccupancyGridMap3D, mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CLandmarksMap, mrpt::maps::CMultiMetricMap, mrpt::maps::CHeightGridMap2D, mrpt::maps::CBeaconMap, and mrpt::maps::CReflectivityGridMap2D.
Definition at line 143 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::maps::CMultiMetricMap::compute3DMatchingRatio().
|
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 170 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 76 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 66 of file CMetricMap.cpp.
Referenced by mrpt::hmtslam::CLSLAM_RBPF_2DLASER::auxiliarComputeObservationLikelihood().
|
inlinestatic |
Definition at line 40 of file CColouredOctoMap.h.
|
inlinestatic |
Definition at line 40 of file CColouredOctoMap.h.
|
static |
Constructor from a map definition structure: initializes the map and * its parameters accordingly.
Definition at line 46 of file CColouredOctoMap.cpp.
|
static |
|
inlinestatic |
Definition at line 40 of file CColouredOctoMap.h.
|
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::COccupancyGridMap3D, mrpt::maps::CBeaconMap, and mrpt::maps::CMultiMetricMap.
Definition at line 119 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, 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 131 of file CMetricMap.cpp.
References MRPT_END, MRPT_START, and THROW_EXCEPTION.
Referenced by mrpt::slam::CICP::ICP3D_Method_Classic().
|
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().
|
inlineoverridevirtualinherited |
Returns a 3D object representing the map.
Implements mrpt::maps::CMetricMap.
Definition at line 295 of file COctoMapBase.h.
|
overridevirtual |
Builds a renderizable representation of the octomap as a mrpt::opengl::COctoMapVoxels object.
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 322 of file CColouredOctoMap.cpp.
References mrpt::img::TColorf::A, mrpt::img::TColorf::B, mrpt::opengl::COctoMapVoxels::clear(), mrpt::img::TColorf::G, mrpt::opengl::CRenderizable::getColor(), mrpt::opengl::COctoMapVoxels::isCubeTransparencyEnabled(), mrpt::opengl::COctoMapVoxels::push_back_GridCube(), mrpt::opengl::COctoMapVoxels::push_back_Voxel(), mrpt::img::TColorf::R, mrpt::opengl::COctoMapVoxels::reserveGridCubes(), mrpt::opengl::COctoMapVoxels::reserveVoxels(), mrpt::opengl::COctoMapVoxels::resizeVoxelSets(), mrpt::opengl::COctoMapVoxels::setBoundingBox(), mrpt::opengl::COctoMapVoxels::showVoxels(), mrpt::opengl::COctoMapVoxels::sort_voxels_by_z(), mrpt::opengl::VOXEL_SET_FREESPACE, mrpt::opengl::VOXEL_SET_OCCUPIED, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.
|
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().
|
inlineinherited |
Definition at line 299 of file CMetricMap.h.
References mrpt::maps::CMetricMap::getAsSimplePointsMap().
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 535 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 539 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 527 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 531 of file CColouredOctoMap.cpp.
|
inlinestatic |
Definition at line 40 of file CColouredOctoMap.h.
void CColouredOctoMap::getMetricMax | ( | double & | x, |
double & | y, | ||
double & | z | ||
) |
maximum value of the bounding box of all known space in x, y, z
Definition at line 467 of file CColouredOctoMap.cpp.
void CColouredOctoMap::getMetricMax | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
maximum value of the bounding box of all known space in x, y, z
Definition at line 471 of file CColouredOctoMap.cpp.
void CColouredOctoMap::getMetricMin | ( | double & | x, |
double & | y, | ||
double & | z | ||
) |
minimum value of the bounding box of all known space in x, y, z
Definition at line 459 of file CColouredOctoMap.cpp.
void CColouredOctoMap::getMetricMin | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
minimum value of the bounding box of all known space in x, y, z
Definition at line 463 of file CColouredOctoMap.cpp.
void CColouredOctoMap::getMetricSize | ( | double & | x, |
double & | y, | ||
double & | z | ||
) |
Size of OcTree (all known space) in meters for x, y and z dimension.
Definition at line 451 of file CColouredOctoMap.cpp.
void CColouredOctoMap::getMetricSize | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
Size of OcTree (all known space) in meters for x, y and z dimension.
Definition at line 455 of file CColouredOctoMap.cpp.
size_t CColouredOctoMap::getNumLeafNodes | ( | ) | const |
Traverses the tree to calculate the total number of leaf nodes.
Definition at line 479 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 503 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 507 of file CColouredOctoMap.cpp.
|
inlineinherited |
Get a reference to the internal octomap object.
Example:
Definition at line 61 of file COctoMapBase.h.
bool CColouredOctoMap::getPointColour | ( | const float | x, |
const float | y, | ||
const float | z, | ||
uint8_t & | r, | ||
uint8_t & | g, | ||
uint8_t & | b | ||
) | const |
Get the RGB colour of a point.
Definition at line 278 of file CColouredOctoMap.cpp.
|
inherited |
Get the occupancy probability [0,1] of a point.
Definition at line 242 of file COctoMapBase_impl.h.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 511 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 515 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 519 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 523 of file CColouredOctoMap.cpp.
double CColouredOctoMap::getResolution | ( | ) | const |
Definition at line 429 of file CColouredOctoMap.cpp.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::maps::CMetricMap.
|
static |
unsigned int CColouredOctoMap::getTreeDepth | ( | ) | const |
Definition at line 433 of file CColouredOctoMap.cpp.
|
inline |
Get the method used to update voxels colour.
Definition at line 82 of file CColouredOctoMap.h.
References m_colour_method.
|
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().
|
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 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().
|
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().
|
inherited |
Update the octomap with a 2D or 3D scan, given directly as a point cloud and the 3D location of the sensor (the origin of the rays) in this map's frame of reference.
Insertion parameters can be found in insertionOptions.
Definition at line 259 of file COctoMapBase_impl.h.
void CColouredOctoMap::insertRay | ( | const float | end_x, |
const float | end_y, | ||
const float | end_z, | ||
const float | sensor_x, | ||
const float | sensor_y, | ||
const float | sensor_z | ||
) |
Just like insertPointCloud but with a single ray.
Definition at line 408 of file CColouredOctoMap.cpp.
|
protectedinherited |
Builds the list of 3D points in global coordinates for a generic observation.
Used for both, insertObservation() and computeLikelihood().
[out] | point3d_sensorPt | Is a pointer to a "point3D". |
[out] | ptr_scan | Is in fact a pointer to "octomap::Pointcloud". Not declared as such to avoid headers dependencies in user code. |
Definition at line 36 of file COctoMapBase_impl.h.
|
overrideprotectedvirtual |
Internal method called by clear()
Implements mrpt::maps::CMetricMap.
Definition at line 543 of file CColouredOctoMap.cpp.
|
static |
Definition at line 73 of file CColouredOctoMap.cpp.
References mrpt::maps::CColouredOctoMap::TMapDefinition::insertionOpts, mrpt::maps::CColouredOctoMap::TMapDefinition::likelihoodOpts, and mrpt::maps::CColouredOctoMap::TMapDefinition::resolution.
|
overrideprotectedvirtual |
Internal method called by insertObservation()
Implements mrpt::maps::CMetricMap.
Definition at line 150 of file CColouredOctoMap.cpp.
References mrpt::poses::CPose3D::composeFrom(), mrpt::poses::CPose3D::composePoint(), mrpt::opengl::CPointCloudColoured::Create(), IS_CLASS, mrpt::obs::CObservation3DRangeScan::load(), mrpt::obs::T3DPointsProjectionParams::robotPoseInTheWorld, mrpt::maps::CPointsMap::size(), mrpt::poses::UNINITIALIZED_POSE, mrpt::obs::detail::unprojectInto(), mrpt::math::TPoint3D_data< T >::x, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), mrpt::math::TPoint3D_data< T >::y, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y(), and mrpt::math::TPoint3D_data< T >::z.
|
inlineoverridevirtual |
Returns true if the map is empty/no observation has been inserted.
Implements mrpt::maps::CMetricMap.
Definition at line 97 of file CColouredOctoMap.h.
References size().
bool CColouredOctoMap::isPointWithinOctoMap | ( | const float | x, |
const float | y, | ||
const float | z | ||
) | const |
Check whether the given point lies within the volume covered by the octomap (that is, whether it is "mapped")
Definition at line 422 of file CColouredOctoMap.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 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().
|
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().
|
static |
Returns default map definition initializer.
See * mrpt::maps::TMetricMapInitializer
Definition at line 46 of file CColouredOctoMap.cpp.
size_t CColouredOctoMap::memoryFullGrid | ( | ) | const |
Definition at line 446 of file CColouredOctoMap.cpp.
size_t CColouredOctoMap::memoryUsage | ( | ) | const |
Definition at line 438 of file CColouredOctoMap.cpp.
size_t CColouredOctoMap::memoryUsageNode | ( | ) | const |
Definition at line 442 of file CColouredOctoMap.cpp.
|
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().
|
overridevirtualinherited |
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 187 of file COctoMapBase_impl.h.
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
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 I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 108 of file CColouredOctoMap.cpp.
References mrpt::containers::clear(), MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and THROW_EXCEPTION.
|
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.
|
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 94 of file CColouredOctoMap.cpp.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 95 of file CColouredOctoMap.cpp.
References out.
|
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.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 499 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 495 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 483 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 487 of file CColouredOctoMap.cpp.
|
overridevirtual |
Implements mrpt::maps::COctoMapBase< octomap::ColorOcTree, octomap::ColorOcTreeNode >.
Definition at line 491 of file CColouredOctoMap.cpp.
|
inline |
Set the method used to update voxels colour.
Definition at line 76 of file CColouredOctoMap.h.
References m_colour_method.
size_t CColouredOctoMap::size | ( | ) | const |
Definition at line 437 of file CColouredOctoMap.cpp.
Referenced by isEmpty().
|
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.
void CColouredOctoMap::updateVoxel | ( | const double | x, |
const double | y, | ||
const double | z, | ||
bool | occupied | ||
) |
Manually updates the occupancy of the voxel at (x,y,z) as being occupied (true) or free (false), using the log-odds parameters in insertionOptions.
Definition at line 417 of file CColouredOctoMap.cpp.
void CColouredOctoMap::updateVoxelColour | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const uint8_t | r, | ||
const uint8_t | g, | ||
const uint8_t | b | ||
) |
Manually update the colour of the voxel at (x,y,z)
Definition at line 300 of file CColouredOctoMap.cpp.
References THROW_EXCEPTION.
double CColouredOctoMap::volume | ( | ) |
Definition at line 450 of file CColouredOctoMap.cpp.
|
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 90 of file CSerializable.h.
|
static |
Definition at line 40 of file CColouredOctoMap.h.
|
inherited |
Common params to all maps.
Definition at line 274 of file CMetricMap.h.
Referenced by mrpt::maps::internal::TMetricMapTypesRegistry::factoryMapObjectFromDefinition(), mrpt::maps::CWirelessPowerGridMap2D::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::getAs3DObject(), mrpt::maps::CReflectivityGridMap2D::getAs3DObject(), mrpt::maps::CHeightGridMap2D::getAs3DObject(), mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), mrpt::maps::CLandmarksMap::getAs3DObject(), mrpt::maps::CPointsMap::getAs3DObject(), mrpt::maps::CGasConcentrationGridMap2D::serializeFrom(), mrpt::maps::CWirelessPowerGridMap2D::serializeFrom(), mrpt::maps::CReflectivityGridMap2D::serializeFrom(), mrpt::maps::CHeightGridMap2D::serializeFrom(), mrpt::maps::CWirelessPowerGridMap2D::serializeTo(), mrpt::maps::CGasConcentrationGridMap2D::serializeTo(), mrpt::maps::CReflectivityGridMap2D::serializeTo(), and mrpt::maps::CHeightGridMap2D::serializeTo().
|
inherited |
The options used when inserting.
Definition at line 227 of file COctoMapBase.h.
|
inherited |
Definition at line 254 of file COctoMapBase.h.
|
protected |
Definition at line 168 of file CColouredOctoMap.h.
Referenced by getVoxelColourMethod(), and setVoxelColourMethod().
|
protectedinherited |
Definition at line 380 of file COctoMapBase.h.
|
static |
ID used to initialize class registration (just ignore it)
Definition at line 94 of file CColouredOctoMap.h.
|
inherited |
Definition at line 290 of file COctoMapBase.h.
|
staticprotected |
Definition at line 40 of file CColouredOctoMap.h.
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |