octomap
1.9.7
|
Interface class for all octree types that store occupancy. More...
Public Member Functions | |
AbstractOccupancyOcTree () | |
virtual void | clear ()=0 |
virtual AbstractOcTree * | create () const =0 |
virtual constructor: creates a new object of same type More... | |
virtual void | expand ()=0 |
double | getClampingThresMax () const |
float | getClampingThresMaxLog () const |
double | getClampingThresMin () const |
float | getClampingThresMinLog () const |
virtual void | getMetricMax (double &x, double &y, double &z) const =0 |
virtual void | getMetricMax (double &x, double &y, double &z)=0 |
virtual void | getMetricMin (double &x, double &y, double &z) const =0 |
virtual void | getMetricMin (double &x, double &y, double &z)=0 |
virtual void | getMetricSize (double &x, double &y, double &z)=0 |
double | getOccupancyThres () const |
float | getOccupancyThresLog () const |
double | getProbHit () const |
float | getProbHitLog () const |
double | getProbMiss () const |
float | getProbMissLog () const |
virtual double | getResolution () const =0 |
virtual std::string | getTreeType () const =0 |
returns actual class name as string for identification More... | |
bool | isNodeAtThreshold (const OcTreeNode &occupancyNode) const |
queries whether a node is at the clamping threshold according to the tree's parameter More... | |
bool | isNodeAtThreshold (const OcTreeNode *occupancyNode) const |
queries whether a node is at the clamping threshold according to the tree's parameter More... | |
bool | isNodeOccupied (const OcTreeNode &occupancyNode) const |
queries whether a node is occupied according to the tree's parameter for "occupancy" More... | |
bool | isNodeOccupied (const OcTreeNode *occupancyNode) const |
queries whether a node is occupied according to the tree's parameter for "occupancy" More... | |
virtual size_t | memoryUsage () const =0 |
virtual size_t | memoryUsageNode () const =0 |
virtual void | prune ()=0 |
bool | readBinary (const std::string &filename) |
Reads OcTree from a binary file. More... | |
bool | readBinary (std::istream &s) |
Reads an OcTree from an input stream. More... | |
virtual std::istream & | readBinaryData (std::istream &s)=0 |
Reads the actual data, implemented in OccupancyOcTreeBase::readBinaryData() More... | |
virtual std::istream & | readData (std::istream &s)=0 |
Read all nodes from the input stream (without file header), for this the tree needs to be already created. More... | |
void | setClampingThresMax (double thresProb) |
sets the maximum threshold for occupancy clamping (sensor model) More... | |
void | setClampingThresMin (double thresProb) |
sets the minimum threshold for occupancy clamping (sensor model) More... | |
void | setOccupancyThres (double prob) |
sets the threshold for occupancy (sensor model) More... | |
void | setProbHit (double prob) |
sets the probability for a "hit" (will be converted to logodds) - sensor model More... | |
void | setProbMiss (double prob) |
sets the probability for a "miss" (will be converted to logodds) - sensor model More... | |
virtual void | setResolution (double res)=0 |
virtual size_t | size () const =0 |
virtual void | toMaxLikelihood ()=0 |
virtual OcTreeNode * | updateNode (const OcTreeKey &key, bool occupied, bool lazy_eval=false)=0 |
Integrate occupancy measurement. More... | |
virtual OcTreeNode * | updateNode (const OcTreeKey &key, float log_odds_update, bool lazy_eval=false)=0 |
Manipulate log_odds value of voxel directly. More... | |
virtual OcTreeNode * | updateNode (const point3d &value, bool occupied, bool lazy_eval=false)=0 |
Integrate occupancy measurement. More... | |
virtual OcTreeNode * | updateNode (const point3d &value, float log_odds_update, bool lazy_eval=false)=0 |
Manipulate log_odds value of voxel directly. More... | |
bool | write (const std::string &filename) const |
Write file header and complete tree to file (serialization) More... | |
bool | write (std::ostream &s) const |
Write file header and complete tree to stream (serialization) More... | |
bool | writeBinary (const std::string &filename) |
Writes OcTree to a binary file using writeBinary(). More... | |
bool | writeBinary (std::ostream &s) |
Writes compressed maximum likelihood OcTree to a binary stream. More... | |
bool | writeBinaryConst (const std::string &filename) const |
Writes OcTree to a binary file using writeBinaryConst(). More... | |
bool | writeBinaryConst (std::ostream &s) const |
Writes the maximum likelihood OcTree to a binary stream (const variant). More... | |
virtual std::ostream & | writeBinaryData (std::ostream &s) const =0 |
Writes the actual data, implemented in OccupancyOcTreeBase::writeBinaryData() More... | |
virtual std::ostream & | writeData (std::ostream &s) const =0 |
Write complete state of tree to stream (without file header) unmodified. Pruning the tree first produces smaller files (lossless compression) More... | |
virtual | ~AbstractOccupancyOcTree () |
Static Public Member Functions | |
static AbstractOcTree * | createTree (const std::string id, double res) |
Creates a certain OcTree (factory pattern) More... | |
static AbstractOcTree * | read (const std::string &filename) |
Read the file header, create the appropriate class and deserialize. More... | |
static AbstractOcTree * | read (std::istream &s) |
Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself. More... | |
Protected Member Functions | |
bool | readBinaryLegacyHeader (std::istream &s, unsigned int &size, double &res) |
Try to read the old binary format for conversion, will be removed in the future. More... | |
Static Protected Member Functions | |
static bool | readHeader (std::istream &s, std::string &id, unsigned &size, double &res) |
static void | registerTreeType (AbstractOcTree *tree) |
Protected Attributes | |
float | clamping_thres_max |
float | clamping_thres_min |
float | occ_prob_thres_log |
float | prob_hit_log |
float | prob_miss_log |
Static Protected Attributes | |
static const std::string | binaryFileHeader = "# Octomap OcTree binary file" |
static const std::string | fileHeader = "# Octomap OcTree file" |
Interface class for all octree types that store occupancy.
This serves as a common base class e.g. for polymorphism and contains common code for reading and writing binary trees.
octomap::AbstractOccupancyOcTree::AbstractOccupancyOcTree | ( | ) |
References setClampingThresMax(), setClampingThresMin(), setOccupancyThres(), setProbHit(), and setProbMiss().
|
inlinevirtual |
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
Referenced by readBinary(), and readBinaryLegacyHeader().
|
pure virtualinherited |
virtual constructor: creates a new object of same type
Implemented in octomap::ColorOcTree, octomap::OcTreeStamped, octomap::OcTree, and octomap::OcTreeBase< NODE >.
|
staticinherited |
Creates a certain OcTree (factory pattern)
References OCTOMAP_ERROR, and octomap::AbstractOcTree::setResolution().
Referenced by octomap::AbstractOcTree::read().
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
inline |
References clamping_thres_max, and octomap::probability().
Referenced by main().
|
inline |
References clamping_thres_max.
|
inline |
References clamping_thres_min, and octomap::probability().
Referenced by main().
|
inline |
References clamping_thres_min.
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
|
inline |
References occ_prob_thres_log, and octomap::probability().
|
inline |
References occ_prob_thres_log.
|
inline |
References prob_hit_log, and octomap::probability().
Referenced by main().
|
inline |
References prob_hit_log.
|
inline |
References prob_miss_log, and octomap::probability().
Referenced by main().
|
inline |
References prob_miss_log.
|
pure virtualinherited |
Referenced by main(), octomap::AbstractOcTree::write(), and writeBinaryConst().
|
pure virtualinherited |
returns actual class name as string for identification
Implemented in octomap::ColorOcTree, octomap::OcTreeStamped, octomap::OcTree, and octomap::OcTreeBase< NODE >.
Referenced by main(), octomap::AbstractOcTree::registerTreeType(), octomap::AbstractOcTree::write(), and writeBinaryConst().
|
inline |
queries whether a node is at the clamping threshold according to the tree's parameter
References octomap::OcTreeNode::getLogOdds().
|
inline |
queries whether a node is at the clamping threshold according to the tree's parameter
References octomap::OcTreeNode::getLogOdds().
Referenced by calcThresholdedNodes().
|
inline |
queries whether a node is occupied according to the tree's parameter for "occupancy"
References octomap::OcTreeNode::getLogOdds().
|
inline |
queries whether a node is occupied according to the tree's parameter for "occupancy"
References octomap::OcTreeNode::getLogOdds().
Referenced by octomap::OcTreeStamped::degradeOutdatedNodes(), getLeafNodesRecurs(), main(), and printChanges().
|
pure virtualinherited |
|
pure virtualinherited |
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
Referenced by writeBinary().
|
staticinherited |
Read the file header, create the appropriate class and deserialize.
This creates a new octree which you need to delete yourself. If you expect or requre a specific kind of octree, use dynamic_cast afterwards:
References OCTOMAP_ERROR_STR.
|
staticinherited |
Read the file header, create the appropriate class and deserialize. This creates a new octree which you need to delete yourself.
References octomap::AbstractOcTree::createTree(), octomap::AbstractOcTree::fileHeader, OCTOMAP_DEBUG_STR, OCTOMAP_ERROR_STR, octomap::AbstractOcTree::readData(), octomap::AbstractOcTree::readHeader(), and octomap::AbstractOcTree::size().
bool octomap::AbstractOccupancyOcTree::readBinary | ( | const std::string & | filename | ) |
Reads OcTree from a binary file.
Existing nodes of the tree are deleted before the tree is read.
References OCTOMAP_ERROR_STR, and readBinary().
bool octomap::AbstractOccupancyOcTree::readBinary | ( | std::istream & | s | ) |
Reads an OcTree from an input stream.
Existing nodes of the tree are deleted before the tree is read.
References binaryFileHeader, octomap::AbstractOcTree::clear(), OCTOMAP_DEBUG_STR, OCTOMAP_ERROR, OCTOMAP_ERROR_STR, OCTOMAP_WARNING_STR, readBinaryData(), readBinaryLegacyHeader(), octomap::AbstractOcTree::readHeader(), octomap::AbstractOcTree::setResolution(), and octomap::AbstractOcTree::size().
Referenced by main(), octomap::OcTree::OcTree(), and readBinary().
|
pure virtual |
Reads the actual data, implemented in OccupancyOcTreeBase::readBinaryData()
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
Referenced by readBinary().
|
protected |
Try to read the old binary format for conversion, will be removed in the future.
References octomap::AbstractOcTree::clear(), OCTOMAP_ERROR, OCTOMAP_ERROR_STR, OCTOMAP_WARNING_STR, and octomap::AbstractOcTree::size().
Referenced by readBinary().
|
pure virtualinherited |
Read all nodes from the input stream (without file header), for this the tree needs to be already created.
For general file IO, you should probably use AbstractOcTree::read() instead.
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
Referenced by octomap::AbstractOcTree::read().
|
staticprotectedinherited |
References OCTOMAP_ERROR_STR, OCTOMAP_WARNING, OCTOMAP_WARNING_STR, and octomap::AbstractOcTree::size().
Referenced by octomap::AbstractOcTree::read(), and readBinary().
|
staticprotectedinherited |
References octomap::AbstractOcTree::getTreeType().
Referenced by octomap::OcTree::StaticMemberInitializer::StaticMemberInitializer(), octomap::CountingOcTree::StaticMemberInitializer::StaticMemberInitializer(), octomap::OcTreeStamped::StaticMemberInitializer::StaticMemberInitializer(), and octomap::ColorOcTree::StaticMemberInitializer::StaticMemberInitializer().
|
inline |
sets the maximum threshold for occupancy clamping (sensor model)
References clamping_thres_max, and octomap::logodds().
Referenced by AbstractOccupancyOcTree(), and main().
|
inline |
sets the minimum threshold for occupancy clamping (sensor model)
References clamping_thres_min, and octomap::logodds().
Referenced by AbstractOccupancyOcTree(), and main().
|
inline |
sets the threshold for occupancy (sensor model)
References octomap::logodds(), and occ_prob_thres_log.
Referenced by AbstractOccupancyOcTree().
|
inline |
sets the probability for a "hit" (will be converted to logodds) - sensor model
References octomap::logodds(), and prob_hit_log.
Referenced by AbstractOccupancyOcTree(), and main().
|
inline |
sets the probability for a "miss" (will be converted to logodds) - sensor model
References octomap::logodds(), and prob_miss_log.
Referenced by AbstractOccupancyOcTree(), and main().
|
pure virtualinherited |
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
Referenced by octomap::AbstractOcTree::createTree(), and readBinary().
|
pure virtualinherited |
|
pure virtual |
|
pure virtual |
Integrate occupancy measurement.
key | of the NODE that is to be updated |
occupied | true if the node was measured occupied, else false |
lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
|
pure virtual |
Manipulate log_odds value of voxel directly.
key | of the NODE that is to be updated |
log_odds_update | value to be added (+) to log_odds value of node |
lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
|
pure virtual |
Integrate occupancy measurement.
Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.
value | 3d coordinate of the NODE that is to be updated |
occupied | true if the node was measured occupied, else false |
lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
|
pure virtual |
Manipulate log_odds value of voxel directly.
Looks up the OcTreeKey corresponding to the coordinate and then calls udpateNode() with it.
value | 3d coordinate of the NODE that is to be updated |
log_odds_update | value to be added (+) to log_odds value of node |
lazy_eval | whether update of inner nodes is omitted after the update (default: false). This speeds up the insertion, but you need to call updateInnerOccupancy() when done. |
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
|
inherited |
Write file header and complete tree to file (serialization)
References OCTOMAP_ERROR_STR.
Referenced by main().
|
inherited |
Write file header and complete tree to stream (serialization)
References octomap::AbstractOcTree::fileHeader, octomap::AbstractOcTree::getResolution(), octomap::AbstractOcTree::getTreeType(), octomap::AbstractOcTree::size(), and octomap::AbstractOcTree::writeData().
bool octomap::AbstractOccupancyOcTree::writeBinary | ( | const std::string & | filename | ) |
Writes OcTree to a binary file using writeBinary().
The OcTree is first converted to the maximum likelihood estimate and pruned.
References OCTOMAP_ERROR_STR.
Referenced by main().
bool octomap::AbstractOccupancyOcTree::writeBinary | ( | std::ostream & | s | ) |
Writes compressed maximum likelihood OcTree to a binary stream.
The OcTree is first converted to the maximum likelihood estimate and pruned for maximum compression.
References octomap::AbstractOcTree::prune(), toMaxLikelihood(), and writeBinaryConst().
bool octomap::AbstractOccupancyOcTree::writeBinaryConst | ( | const std::string & | filename | ) | const |
Writes OcTree to a binary file using writeBinaryConst().
The OcTree is not changed, in particular not pruned first. Files will be smaller when the tree is pruned first or by using writeBinary() instead.
References OCTOMAP_ERROR_STR.
Referenced by writeBinary().
bool octomap::AbstractOccupancyOcTree::writeBinaryConst | ( | std::ostream & | s | ) | const |
Writes the maximum likelihood OcTree to a binary stream (const variant).
Files will be smaller when the tree is pruned first or by using writeBinary() instead.
References binaryFileHeader, octomap::AbstractOcTree::getResolution(), octomap::AbstractOcTree::getTreeType(), OCTOMAP_DEBUG, OCTOMAP_WARNING_STR, octomap::AbstractOcTree::size(), and writeBinaryData().
|
pure virtual |
Writes the actual data, implemented in OccupancyOcTreeBase::writeBinaryData()
Implemented in octomap::OccupancyOcTreeBase< NODE >, octomap::OccupancyOcTreeBase< ColorOcTreeNode >, octomap::OccupancyOcTreeBase< OcTreeNode >, and octomap::OccupancyOcTreeBase< OcTreeNodeStamped >.
Referenced by writeBinaryConst().
|
pure virtualinherited |
Write complete state of tree to stream (without file header) unmodified. Pruning the tree first produces smaller files (lossless compression)
Implemented in octomap::OcTreeBaseImpl< OcTreeNode, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOccupancyOcTree >, octomap::OcTreeBaseImpl< CountingOcTreeNode, AbstractOcTree >, octomap::OcTreeBaseImpl< NODE, AbstractOcTree >, octomap::OcTreeBaseImpl< OcTreeNodeStamped, AbstractOccupancyOcTree >, and octomap::OcTreeBaseImpl< ColorOcTreeNode, AbstractOccupancyOcTree >.
Referenced by octomap::AbstractOcTree::write().
|
staticprotected |
Referenced by readBinary(), and writeBinaryConst().
|
protected |
|
protected |
|
staticprotectedinherited |
Referenced by octomap::AbstractOcTree::read(), and octomap::AbstractOcTree::write().
|
protected |
|
protected |
|
protected |