mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Fixed pcl::voxelGrid filtering crash on Windows (latest PCL, eigen allocation issue)
This commit is contained in:
@@ -582,6 +582,10 @@ typename pcl::PointCloud<PointT>::Ptr voxelizeImpl(
|
|||||||
pcl::VoxelGrid<PointT> filter;
|
pcl::VoxelGrid<PointT> filter;
|
||||||
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
||||||
filter.setInputCloud(cloud);
|
filter.setInputCloud(cloud);
|
||||||
|
#ifdef WIN32
|
||||||
|
// Pre-allocating the cloud helps to avoid crash when freeing memory allocated inside pcl library
|
||||||
|
output->resize(cloud->size());
|
||||||
|
#endif
|
||||||
if(!indices->empty())
|
if(!indices->empty())
|
||||||
{
|
{
|
||||||
filter.setIndices(indices);
|
filter.setIndices(indices);
|
||||||
|
|||||||
Reference in New Issue
Block a user