mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
fixed compilation errors on octomap >=1.8 introduced by previous commit for octomap < 1.8
This commit is contained in:
@@ -66,19 +66,11 @@ public:
|
|||||||
const octomap::point3d & getPointRef() const {return pointRef_;}
|
const octomap::point3d & getPointRef() const {return pointRef_;}
|
||||||
|
|
||||||
// following methods defined for octomap < 1.8 compatibility
|
// following methods defined for octomap < 1.8 compatibility
|
||||||
inline RtabmapColorOcTreeNode* getChild(unsigned int i) {
|
RtabmapColorOcTreeNode* getChild(unsigned int i);
|
||||||
return static_cast<RtabmapColorOcTreeNode*> (OcTreeNode::getChild(i));
|
const RtabmapColorOcTreeNode* getChild(unsigned int i) const;
|
||||||
}
|
|
||||||
inline const RtabmapColorOcTreeNode* getChild(unsigned int i) const {
|
|
||||||
return static_cast<const RtabmapColorOcTreeNode*> (OcTreeNode::getChild(i));
|
|
||||||
}
|
|
||||||
bool pruneNode();
|
bool pruneNode();
|
||||||
void expandNode();
|
void expandNode();
|
||||||
bool createChild(unsigned int i) {
|
bool createChild(unsigned int i);
|
||||||
if (children == NULL) allocChildren();
|
|
||||||
children[i] = new RtabmapColorOcTreeNode();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int nodeRefId_;
|
int nodeRefId_;
|
||||||
|
|||||||
@@ -40,6 +40,23 @@ namespace rtabmap {
|
|||||||
// RtabmapColorOcTree
|
// RtabmapColorOcTree
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
|
|
||||||
|
RtabmapColorOcTreeNode* RtabmapColorOcTreeNode::getChild(unsigned int i) {
|
||||||
|
#ifdef OCTOMAP_PRE_18
|
||||||
|
return static_cast<RtabmapColorOcTreeNode*> (OcTreeNode::getChild(i));
|
||||||
|
#else
|
||||||
|
UFATAL("This function should not be used with octomap >= 1.8");
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
const RtabmapColorOcTreeNode* RtabmapColorOcTreeNode::getChild(unsigned int i) const {
|
||||||
|
#ifdef OCTOMAP_PRE_18
|
||||||
|
return static_cast<const RtabmapColorOcTreeNode*> (OcTreeNode::getChild(i));
|
||||||
|
#else
|
||||||
|
UFATAL("This function should not be used with octomap >= 1.8");
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
//octomap <1.8
|
//octomap <1.8
|
||||||
bool RtabmapColorOcTreeNode::pruneNode() {
|
bool RtabmapColorOcTreeNode::pruneNode() {
|
||||||
#ifdef OCTOMAP_PRE_18
|
#ifdef OCTOMAP_PRE_18
|
||||||
@@ -75,6 +92,18 @@ void RtabmapColorOcTreeNode::expandNode() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//octomap <1.8
|
||||||
|
bool RtabmapColorOcTreeNode::createChild(unsigned int i) {
|
||||||
|
#ifdef OCTOMAP_PRE_18
|
||||||
|
if (children == NULL) allocChildren();
|
||||||
|
children[i] = new RtabmapColorOcTreeNode();
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
UFATAL("This function should not be used with octomap >= 1.8");
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
RtabmapColorOcTree::RtabmapColorOcTree(double resolution)
|
RtabmapColorOcTree::RtabmapColorOcTree(double resolution)
|
||||||
: OccupancyOcTreeBase<RtabmapColorOcTreeNode>(resolution) {
|
: OccupancyOcTreeBase<RtabmapColorOcTreeNode>(resolution) {
|
||||||
RtabmapColorOcTreeMemberInit.ensureLinking();
|
RtabmapColorOcTreeMemberInit.ensureLinking();
|
||||||
|
|||||||
Reference in New Issue
Block a user