10 #ifndef MRPT_COctoMapBase_H
11 #define MRPT_COctoMapBase_H
45 template <
class octree_t,
class octree_node_t>
61 template <
class OCTOMAP_CLASS>
85 const bool o_has_parent = o.
m_parent.get() != NULL;
101 std::ostream& out)
const override;
145 return m_parent->getOccupancyThres();
152 return m_parent->getOccupancyThresLog();
180 return m_parent->getClampingThresMin();
188 return m_parent->getClampingThresMinLog();
195 return m_parent->getClampingThresMax();
203 return m_parent->getClampingThresMaxLog();
239 std::ostream& out)
const override;
300 outObj->insert(gl_obj);
314 const float x,
const float y,
const float z,
315 double& prob_occupancy)
const;
325 const CPointsMap& ptMap,
const float sensor_x,
const float sensor_y,
326 const float sensor_z);
349 bool ignoreUnknownCells =
false,
double maxRange = -1.0)
const;
375 template <
class octomap_po
int3d,
class octomap_po
intcloud>
379 octomap_pointcloud& scan)
const;
This class allows loading and storing values and vectors of different types from a configuration text...
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Declares a virtual base class for all metric maps storage classes.
A three-dimensional probabilistic occupancy grid, implemented as an octo-tree with the "octomap" C++ ...
virtual double getOccupancyThres() const =0
virtual double getProbHit() const =0
virtual void saveMetricMapRepresentationToFile(const std::string &filNamePrefix) const override
This virtual method saves the map to a file "filNamePrefix"+< some_file_extension >,...
mrpt::pimpl< Impl > m_impl
TRenderingOptions renderingOptions
virtual double getProbMiss() const =0
virtual double internal_computeObservationLikelihood(const mrpt::obs::CObservation *obs, const mrpt::poses::CPose3D &takenFrom) override
Internal method called by computeObservationLikelihood()
virtual void setClampingThresMax(double thresProb)=0
virtual void setProbMiss(double prob)=0
virtual float getClampingThresMaxLog() const =0
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.
virtual double getClampingThresMax() const =0
COctoMapBase(double resolution)
Constructor, defines the resolution of the octomap (length of each voxel side)
virtual void setProbHit(double prob)=0
virtual float getOccupancyThresLog() const =0
TLikelihoodOptions likelihoodOptions
virtual float getProbMissLog() const =0
virtual float getProbHitLog() const =0
virtual void setClampingThresMin(double thresProb)=0
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 setOccupancyThres(double prob)=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...
virtual float getClampingThresMinLog() const =0
virtual void getAsOctoMapVoxels(mrpt::opengl::COctoMapVoxels &gl_obj) const =0
Builds a renderizable representation of the octomap as a mrpt::opengl::COctoMapVoxels object.
TInsertionOptions insertionOptions
The options used when inserting.
virtual void getAs3DObject(mrpt::opengl::CSetOfObjects::Ptr &outObj) const override
Returns a 3D object representing the map.
virtual double getClampingThresMin() const =0
OCTOMAP_CLASS & getOctomap()
Get a reference to the internal octomap object.
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().
A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.
Declares a class that represents any robot's observation.
A flexible renderer of voxels, typically from a 3D octo map (see mrpt::maps::COctoMap).
static Ptr Create(Args &&... args)
std::shared_ptr< CSetOfObjects > Ptr
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Virtual base class for "archives": classes abstracting I/O streams.
GLsizei const GLchar ** string
GLsizei GLsizei GLchar * source
spimpl::impl_ptr< T > pimpl
unsigned __int32 uint32_t
A wrapper class for pointers whose copy operations from other objects of the same type are ignored,...
With this struct options are provided to the observation insertion process.
double getClampingThresMax() const
TInsertionOptions(myself_t &parent)
Initilization of default parameters.
void setOccupancyThres(double prob)
insertion (default: true)
double getProbHit() const
double getProbMiss() const
float getClampingThresMaxLog() const
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
double maxrange
maximum range for how long individual beams are
TInsertionOptions & operator=(const TInsertionOptions &o)
COctoMap object: used only in limited situations, since get*() methods don't work,...
TInsertionOptions()
Especial constructor, not attached to a real.
float getProbMissLog() const
double getClampingThresMin() const
bool pruning
inserted (default -1: complete beam)
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
float getProbHitLog() const
void setProbMiss(double prob)
(key name in .ini files: "probMiss")sets the probablility for a "miss" (will be converted to logodds)...
float getClampingThresMinLog() const
void setClampingThresMin(double thresProb)
(key name in .ini files: "clampingThresMin")sets the minimum threshold for occupancy clamping (sensor...
mrpt::ignored_copy_ptr< myself_t > m_parent
void setProbHit(double prob)
(key name in .ini files: "probHit")sets the probablility for a "hit" (will be converted to logodds) -...
double getOccupancyThres() const
void setClampingThresMax(double thresProb)
(key name in .ini files: "clampingThresMax")sets the maximum threshold for occupancy clamping (sensor...
float getOccupancyThresLog() const
virtual ~TLikelihoodOptions()
TLikelihoodOptions()
Initilization of default parameters.
void readFromStream(mrpt::serialization::CArchive &in)
Binary dump to stream.
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
void dumpToTextStream(std::ostream &out) const override
This method should clearly display all the contents of the structure in textual form,...
uint32_t decimation
Speed up the likelihood computation by.
void writeToStream(mrpt::serialization::CArchive &out) const
Binary dump to stream.
Options for the conversion of a mrpt::maps::COctoMap into a mrpt::opengl::COctoMapVoxels.
bool generateGridLines
Generate grid lines for all octree nodes,.
void writeToStream(mrpt::serialization::CArchive &out) const
Binary dump to stream.
bool visibleOccupiedVoxels
volumes (Default=true)
TRenderingOptions()
generateFreeVoxels=true) (Default=true)
void readFromStream(mrpt::serialization::CArchive &in)
Binary dump to stream.
bool generateOccupiedVoxels
useful to draw the "structure" of the octree, but computationally costly (Default: false)
bool visibleFreeVoxels
(Default=true)
bool generateFreeVoxels
generateOccupiedVoxels=true) (Default=true)