diff --git a/corelib/include/rtabmap/core/impl/OccupancyGrid.hpp b/corelib/include/rtabmap/core/impl/OccupancyGrid.hpp index 1a9e3eff..a9358586 100644 --- a/corelib/include/rtabmap/core/impl/OccupancyGrid.hpp +++ b/corelib/include/rtabmap/core/impl/OccupancyGrid.hpp @@ -44,6 +44,13 @@ typename pcl::PointCloud::Ptr OccupancyGrid::segmentCloud( pcl::IndicesPtr & obstaclesIndices, pcl::IndicesPtr * flatObstacles) const { + groundIndices.reset(new std::vector); + obstaclesIndices.reset(new std::vector); + if(flatObstacles) + { + flatObstacles->reset(new std::vector); + } + typename pcl::PointCloud::Ptr cloud(new pcl::PointCloud); pcl::IndicesPtr indices(new std::vector);