diff --git a/src/preprocess.cpp b/src/preprocess.cpp index 09a39596..571c22ff 100644 --- a/src/preprocess.cpp +++ b/src/preprocess.cpp @@ -206,6 +206,7 @@ void Preprocess::oust64_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) for (uint i = 0; i < plsize; i++) { + if(isnan(pl_orig.points[i].x) || isnan(pl_orig.points[i].y) || isnan(pl_orig.points[i].z)) continue; double range = pl_orig.points[i].x * pl_orig.points[i].x + pl_orig.points[i].y * pl_orig.points[i].y + pl_orig.points[i].z * pl_orig.points[i].z; if (range < (blind * blind)) continue; Eigen::Vector3d pt_vec; @@ -258,6 +259,7 @@ void Preprocess::oust64_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) for (int i = 0; i < pl_orig.points.size(); i++) { if (i % point_filter_num != 0) continue; + if(isnan(pl_orig.points[i].x) || isnan(pl_orig.points[i].y) || isnan(pl_orig.points[i].z)) continue; double range = pl_orig.points[i].x * pl_orig.points[i].x + pl_orig.points[i].y * pl_orig.points[i].y + pl_orig.points[i].z * pl_orig.points[i].z; @@ -331,6 +333,7 @@ void Preprocess::velodyne_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) for (int i = 0; i < plsize; i++) { + if(isnan(pl_orig.points[i].x) || isnan(pl_orig.points[i].y) || isnan(pl_orig.points[i].z)) continue; PointType added_pt; added_pt.normal_x = 0; added_pt.normal_y = 0; @@ -400,6 +403,7 @@ void Preprocess::velodyne_handler(const sensor_msgs::PointCloud2::ConstPtr &msg) { for (int i = 0; i < plsize; i++) { + if(isnan(pl_orig.points[i].x) || isnan(pl_orig.points[i].y) || isnan(pl_orig.points[i].z)) continue; PointType added_pt; // cout<<"!!!!!!"<