mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
add a flood fill filter
This commit is contained in:
@@ -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
@@ -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())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user