Skip to content

Commit 2e944ec

Browse files
committed
added at least one pointcloud point to roi filter to prevent console output flooding with errors
1 parent b42c26a commit 2e944ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/roi_outlier_removal_nodelet.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ void RoiOutlierRemovalNodelet::cloudCb(const sensor_msgs::PointCloud2ConstPtr &c
158158
reduce_point_cloud_to_roi(pcl_cloud, reduced_pcl_cloud, T);
159159
NODELET_DEBUG_STREAM("cloud reduced");
160160

161+
//add at least one point so the pcl statistical outlier filter
162+
//gets an not empty point cloud. On empty points clouds the console
163+
//is flooded with error messages
164+
if(reduced_pcl_cloud->points.empty())
165+
{
166+
reduced_pcl_cloud->points.push_back(pcl::PointXYZ(0.0,0.0,0.0));
167+
}
168+
161169
// assign output message
162170
sensor_msgs::PointCloud2 output;
163171

0 commit comments

Comments
 (0)