mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40: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;
|
||||
filter.setLeafSize(voxelSize, voxelSize, voxelSize);
|
||||
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())
|
||||
{
|
||||
filter.setIndices(indices);
|
||||
|
||||
Reference in New Issue
Block a user