diff --git a/src/preprocess.cpp b/src/preprocess.cpp index 3f0cb62..61cb94a 100644 --- a/src/preprocess.cpp +++ b/src/preprocess.cpp @@ -267,6 +267,7 @@ void Preprocess::velodyne_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) pcl::PointCloud pl_orig; pcl::fromROSMsg(*msg, pl_orig); int plsize = pl_orig.points.size(); + if (plsize == 0) return; pl_surf.reserve(plsize); /*** These variables only works when no point timestamps given ***/