10 #ifndef MRPT_COctoMapBase_H 11 #define MRPT_COctoMapBase_H 42 template <
class octree_t,
class octree_node_t>
58 template <
class OCTOMAP_CLASS>
59 inline OCTOMAP_CLASS &
getOctomap() {
return *m_octomap.ptr.get(); }
75 const bool o_has_parent = o.
m_parent.get()!=NULL;
191 outObj->insert(gl_obj);
201 bool getPointOccupancy(
const float x,
const float y,
const float z,
double &prob_occupancy)
const;
226 bool ignoreUnknownCells=
false,
227 double maxRange=-1.0)
const;
251 template <
class octomap_po
int3d,
class octomap_po
intcloud>
bool getPointOccupancy(const float x, const float y, const float z, double &prob_occupancy) const
Get the occupancy probability [0,1] of a point.
virtual void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const MRPT_OVERRIDE
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >...
Options for the conversion of a mrpt::maps::COctoMap into a mrpt::opengl::COctoMapVoxels.
virtual void setProbMiss(double prob)=0
uint32_t decimation
Speed up the likelihood computation by considering only one out of N rays (default=1) ...
bool generateGridLines
Generate grid lines for all octree nodes, useful to draw the "structure" of the octree, but computationally costly (Default: false)
virtual double getOccupancyThres() const =0
virtual double getClampingThresMin() const =0
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
TRenderingOptions renderingOptions
PIMPL_DECLARE_TYPE(octree_t, m_octomap)
The actual octo-map object.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
void writeToStream(mrpt::utils::CStream &out) const
Binary dump to stream.
COctoMapBase()
Constructor, defines the resolution of the octomap (length of each voxel side)
float getClampingThresMaxLog() const
void setClampingThresMax(double thresProb)
(key name in .ini files: "clampingThresMax")sets the maximum threshold for occupancy clamping (sensor...
void setClampingThresMin(double thresProb)
(key name in .ini files: "clampingThresMin")sets the minimum threshold for occupancy clamping (sensor...
virtual void setProbHit(double prob)=0
virtual double getClampingThresMax() const =0
void setOccupancyThres(double prob)
(key name in .ini files: "occupancyThres") sets the threshold for occupancy (sensor model) (Default=0...
bool generateOccupiedVoxels
Generate voxels for the occupied volumes (Default=true)
virtual float getProbHitLog() const =0
virtual double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) MRPT_OVERRIDE
Internal method called by computeObservationLikelihood()
TInsertionOptions & operator=(const TInsertionOptions &o)
double maxrange
maximum range for how long individual beams are inserted (default -1: complete beam) ...
TInsertionOptions insertionOptions
The options used when inserting observations in the map.
This class allows loading and storing values and vectors of different types from a configuration text...
double getClampingThresMax() const
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
A flexible renderer of voxels, typically from a 3D octo map (see mrpt::maps::COctoMap).
virtual void setClampingThresMin(double thresProb)=0
TLikelihoodOptions()
Initilization of default parameters.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...
void writeToStream(mrpt::utils::CStream &out) const
Binary dump to stream.
TLikelihoodOptions likelihoodOptions
virtual ~TLikelihoodOptions()
double getProbHit() const
OCTOMAP_CLASS & getOctomap()
Get a reference to the internal octomap object.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
bool visibleOccupiedVoxels
Set occupied voxels visible (requires generateOccupiedVoxels=true) (Default=true) ...
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.
COctoMapBase< octree_t, octree_node_t > myself_t
The type of this MRPT class.
float getProbHitLog() const
TInsertionOptions()
Especial constructor, not attached to a real COctoMap object: used only in limited situations...
void readFromStream(mrpt::utils::CStream &in)
Binary dump to stream.
bool visibleFreeVoxels
Set free voxels visible (requires generateFreeVoxels=true) (Default=true)
GLsizei const GLchar ** string
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().
mrpt::utils::ignored_copy_ptr< myself_t > m_parent
double getProbMiss() const
bool pruning
whether the tree is (losslessly) pruned after insertion (default: true)
virtual float getProbMissLog() const =0
void setProbMiss(double prob)
(key name in .ini files: "probMiss")sets the probablility for a "miss" (will be converted to logodds)...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
virtual float getClampingThresMaxLog() const =0
float getClampingThresMinLog() const
double getOccupancyThres() const
Declares a virtual base class for all metric maps storage classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string §ion) MRPT_OVERRIDE
This method load the options from a ".ini"-like file or memory-stored string list.
Declares a class that represents any robot's observation.
virtual double getProbMiss() const =0
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 s...
void readFromStream(mrpt::utils::CStream &in)
Binary dump to stream.
GLsizei GLsizei GLchar * source
virtual void setOccupancyThres(double prob)=0
virtual float getClampingThresMinLog() const =0
virtual void getAs3DObject(mrpt::opengl::CSetOfObjectsPtr &outObj) const MRPT_OVERRIDE
Returns a 3D object representing the map.
void setProbHit(double prob)
(key name in .ini files: "probHit")sets the probablility for a "hit" (will be converted to logodds) -...
virtual double getProbHit() const =0
virtual float getOccupancyThresLog() const =0
With this struct options are provided to the observation insertion process.
void dumpToTextStream(mrpt::utils::CStream &out) const MRPT_OVERRIDE
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
bool generateFreeVoxels
Generate voxels for the freespace (Default=true)
static COctoMapVoxelsPtr Create()
float getOccupancyThresLog() const
Options used when evaluating "computeObservationLikelihood".
virtual void setClampingThresMax(double thresProb)=0
unsigned __int32 uint32_t
A wrapper class for pointers whose copy operations from other objects of the same type are ignored...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
float getProbMissLog() const
virtual void getAsOctoMapVoxels(mrpt::opengl::COctoMapVoxels &gl_obj) const =0
Builds a renderizable representation of the octomap as a mrpt::opengl::COctoMapVoxels object...
double getClampingThresMin() const