64 enum OccupancyType {kTypeUnknown=-1, kTypeEmpty=0, kTypeGround=1, kTypeObstacle=100};
72 void setNodeRefId(
int nodeRefId) {nodeRefId_ = nodeRefId;}
73 void setOccupancyType(
char type) {type_=type;}
74 void setPointRef(
const octomap::point3d & point) {pointRef_ = point;}
75 int getNodeRefId()
const {
return nodeRefId_;}
76 int getOccupancyType()
const {
return type_;}
77 const octomap::point3d & getPointRef()
const {
return pointRef_;}
84 bool createChild(
unsigned int i);
86 void updateOccupancyTypeChildren();
91 octomap::point3d pointRef_;
106 std::string getTreeType()
const {
return "ColorOcTree";}
120 uint8_t g, uint8_t b);
124 uint8_t g, uint8_t b) {
125 octomap::OcTreeKey key;
126 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
127 return setNodeColor(key,r,g,b);
132 uint8_t g, uint8_t b);
136 uint8_t g, uint8_t b) {
137 octomap:: OcTreeKey key;
138 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
139 return averageNodeColor(key,r,g,b);
143 RtabmapColorOcTreeNode* integrateNodeColor(
const octomap::OcTreeKey& key, uint8_t r,
144 uint8_t g, uint8_t b);
146 RtabmapColorOcTreeNode* integrateNodeColor(
float x,
float y,
148 uint8_t g, uint8_t b) {
149 octomap::OcTreeKey key;
150 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
151 return integrateNodeColor(key,r,g,b);
155 void updateInnerOccupancy();
158 void updateInnerOccupancyRecurs(RtabmapColorOcTreeNode* node,
unsigned int depth);
189 pcl::PointCloud<pcl::PointXYZRGB>::Ptr createCloud(
190 unsigned int treeDepth = 0,
191 std::vector<int> * obstacleIndices = 0,
192 std::vector<int> * emptyIndices = 0,
193 std::vector<int> * groundIndices = 0,
194 bool originalRefPoints =
true,
195 std::vector<int> * frontierIndices = 0,
196 std::vector<double> * cloudProb = 0)
const;
198 cv::Mat createProjectionMap(
201 float & gridCellSize,
202 float minGridSize = 0.0f,
203 unsigned int treeDepth = 0);
205 bool writeBinary(
const std::string & path);
211 bool hasColor()
const {
return hasColor_;}
213 static std::unordered_set<octomap::OcTreeKey, octomap::OcTreeKey::KeyHash> findEmptyNode(
RtabmapColorOcTree* octree_,
unsigned int treeDepth, octomap::point3d startPosition);
214 static void floodFill(
RtabmapColorOcTree* octree_,
unsigned int treeDepth,octomap::point3d startPosition, std::unordered_set<octomap::OcTreeKey, octomap::OcTreeKey::KeyHash> & EmptyNodes,std::queue<octomap::point3d>& positionToExplore);
215 static bool isNodeVisited(std::unordered_set<octomap::OcTreeKey,octomap::OcTreeKey::KeyHash>
const & EmptyNodes,octomap::OcTreeKey
const key);
216 static octomap::point3d findCloseEmpty(
RtabmapColorOcTree* octree_,
unsigned int treeDepth,octomap::point3d startPosition);
217 static bool isValidEmpty(
RtabmapColorOcTree* octree_,
unsigned int treeDepth,octomap::point3d startPosition);
220 virtual void assemble(
const std::list<std::pair<int, Transform> > & newPoses);
223 void updateMinMax(
const octomap::point3d & point);
230 unsigned int emptyFloodFillDepth_;
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).