util3d::voxelize() added warning if cloud is not dense, indices empty but cloud not empty

This commit is contained in:
matlabbe
2017-12-15 15:25:37 -05:00
parent 35045aa9d7
commit 6a50b3f149

View File

@@ -201,6 +201,10 @@ pcl::PointCloud<pcl::PointXYZ>::Ptr voxelize(
} }
filter.filter(*output); filter.filter(*output);
} }
else if(cloud->size() && !cloud->is_dense && indices->size() == 0)
{
UWARN("Cannot voxelize a cloud not dense with empty indices! (input=%d pts)", (int)cloud->size());
}
return output; return output;
} }
pcl::PointCloud<pcl::PointNormal>::Ptr voxelize( pcl::PointCloud<pcl::PointNormal>::Ptr voxelize(
@@ -221,6 +225,10 @@ pcl::PointCloud<pcl::PointNormal>::Ptr voxelize(
} }
filter.filter(*output); filter.filter(*output);
} }
else if(cloud->size() && !cloud->is_dense && indices->size() == 0)
{
UWARN("Cannot voxelize a not dense (organized) cloud with empty indices! (input=%d pts). Returning empty cloud!", (int)cloud->size());
}
return output; return output;
} }
pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxelize( pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxelize(
@@ -241,6 +249,10 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr voxelize(
} }
filter.filter(*output); filter.filter(*output);
} }
else if(cloud->size() && !cloud->is_dense && indices->size() == 0)
{
UWARN("Cannot voxelize a not dense (organized) cloud with empty indices! (input=%d pts). Returning empty cloud!", (int)cloud->size());
}
return output; return output;
} }
pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr voxelize( pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr voxelize(
@@ -261,6 +273,10 @@ pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr voxelize(
} }
filter.filter(*output); filter.filter(*output);
} }
else if(cloud->size() && !cloud->is_dense && indices->size() == 0)
{
UWARN("Cannot voxelize a not dense (organized) cloud with empty indices! (input=%d pts). Returning empty cloud!", (int)cloud->size());
}
return output; return output;
} }