56 enum OccupancyType {kTypeUnknown=-1, kTypeEmpty=0, kTypeGround=1, kTypeObstacle=100};
64 void setNodeRefId(
int nodeRefId) {nodeRefId_ = nodeRefId;}
65 void setOccupancyType(
char type) {type_=type;}
66 void setPointRef(
const octomap::point3d & point) {pointRef_ = point;}
67 int getNodeRefId()
const {
return nodeRefId_;}
68 int getOccupancyType()
const {
return type_;}
69 const octomap::point3d & getPointRef()
const {
return pointRef_;}
76 bool createChild(
unsigned int i);
78 void updateOccupancyTypeChildren();
83 octomap::point3d pointRef_;
98 std::string getTreeType()
const {
return "ColorOcTree";}
112 uint8_t g, uint8_t b);
116 uint8_t g, uint8_t b) {
117 octomap::OcTreeKey key;
118 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
119 return setNodeColor(key,r,g,b);
124 uint8_t g, uint8_t b);
128 uint8_t g, uint8_t b) {
129 octomap:: OcTreeKey key;
130 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
131 return averageNodeColor(key,r,g,b);
135 RtabmapColorOcTreeNode* integrateNodeColor(
const octomap::OcTreeKey& key, uint8_t r,
136 uint8_t g, uint8_t b);
138 RtabmapColorOcTreeNode* integrateNodeColor(
float x,
float y,
140 uint8_t g, uint8_t b) {
141 octomap::OcTreeKey key;
142 if (!this->coordToKeyChecked(octomap::point3d(x,y,z), key))
return NULL;
143 return integrateNodeColor(key,r,g,b);
147 void updateInnerOccupancy();
150 void updateInnerOccupancyRecurs(RtabmapColorOcTreeNode* node,
unsigned int depth);
181 pcl::PointCloud<pcl::PointXYZRGB>::Ptr createCloud(
182 unsigned int treeDepth = 0,
183 std::vector<int> * obstacleIndices = 0,
184 std::vector<int> * emptyIndices = 0,
185 std::vector<int> * groundIndices = 0,
186 bool originalRefPoints =
true,
187 std::vector<int> * frontierIndices = 0,
188 std::vector<double> * cloudProb = 0)
const;
190 cv::Mat createProjectionMap(
193 float & gridCellSize,
194 float minGridSize = 0.0f,
195 unsigned int treeDepth = 0);
197 bool writeBinary(
const std::string & path);
203 bool hasColor()
const {
return hasColor_;}
205 static std::unordered_set<octomap::OcTreeKey, octomap::OcTreeKey::KeyHash> findEmptyNode(
RtabmapColorOcTree* octree_,
unsigned int treeDepth, octomap::point3d startPosition);
206 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);
207 static bool isNodeVisited(std::unordered_set<octomap::OcTreeKey,octomap::OcTreeKey::KeyHash>
const & EmptyNodes,octomap::OcTreeKey
const key);
208 static octomap::point3d findCloseEmpty(
RtabmapColorOcTree* octree_,
unsigned int treeDepth,octomap::point3d startPosition);
209 static bool isValidEmpty(
RtabmapColorOcTree* octree_,
unsigned int treeDepth,octomap::point3d startPosition);
212 virtual void assemble(
const std::list<std::pair<int, Transform> > & newPoses);
215 void updateMinMax(
const octomap::point3d & point);
222 unsigned int emptyFloodFillDepth_;
std::map< std::string, std::string > ParametersMap
Parameter keys mapped to their values, as used by every configurable class (see Parameters).