Merge pull request #579 from chameau5050/addFloodFill

add a flood fill filter
This commit is contained in:
matlabbe
2021-05-07 18:26:24 -04:00
committed by GitHub
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -128,6 +128,7 @@ private:
rtabmap::OctoMap * octomap_; rtabmap::OctoMap * octomap_;
int octomapTreeDepth_; int octomapTreeDepth_;
bool octomap_frontier_flood_fill_;
bool octomapUpdated_; bool octomapUpdated_;
rtabmap::ParametersMap parameters_; rtabmap::ParametersMap parameters_;
+3 -1
View File
@@ -133,6 +133,8 @@ void MapsManager::init(ros::NodeHandle & nh, ros::NodeHandle & pnh, const std::s
#ifdef RTABMAP_OCTOMAP #ifdef RTABMAP_OCTOMAP
octomap_ = new OctoMap(occupancyGrid_->getCellSize(), 0.5, occupancyGrid_->isFullUpdate(), occupancyGrid_->getUpdateError()); octomap_ = new OctoMap(occupancyGrid_->getCellSize(), 0.5, occupancyGrid_->isFullUpdate(), occupancyGrid_->getUpdateError());
pnh.param("octomap_tree_depth", octomapTreeDepth_, octomapTreeDepth_); pnh.param("octomap_tree_depth", octomapTreeDepth_, octomapTreeDepth_);
pnh.param("octomap_frontier_flood_fill", octomap_frontier_flood_fill_, false);
if(octomapTreeDepth_ > 16) if(octomapTreeDepth_ > 16)
{ {
ROS_WARN("octomap_tree_depth maximum is 16"); ROS_WARN("octomap_tree_depth maximum is 16");
@@ -1239,7 +1241,7 @@ void MapsManager::publishMaps(
pcl::IndicesPtr frontierIndices(new std::vector<int>); pcl::IndicesPtr frontierIndices(new std::vector<int>);
pcl::IndicesPtr emptyIndices(new std::vector<int>); pcl::IndicesPtr emptyIndices(new std::vector<int>);
pcl::IndicesPtr groundIndices(new std::vector<int>); pcl::IndicesPtr groundIndices(new std::vector<int>);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud = octomap_->createCloud(octomapTreeDepth_, obstacleIndices.get(), emptyIndices.get(), groundIndices.get(), true, frontierIndices.get()); pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud = octomap_->createCloud(octomapTreeDepth_, obstacleIndices.get(), emptyIndices.get(), groundIndices.get(), true, frontierIndices.get(),0,octomap_frontier_flood_fill_);
if(octoMapCloud_.getNumSubscribers()) if(octoMapCloud_.getNumSubscribers())
{ {