File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 20
20
#include < pcl/filters/voxel_grid.h>
21
21
#include < pcl/search/kdtree.h>
22
22
#include < pcl/segmentation/extract_clusters.h>
23
+ #include < pcl/common/point_tests.h>
23
24
// ROS package
24
25
#include " lidar_cluster/marker.hpp"
25
26
// Benchmarking
@@ -280,6 +281,15 @@ class EuclideanGrid : public rclcpp::Node
280
281
RCLCPP_INFO_STREAM (this ->get_logger (), " PointCloud in: " << original_size << " reduced size before cluster: " << cloud->width * cloud->height );
281
282
}
282
283
284
+ // if any point in the pointcloud is not a proper number, modify that value to zero
285
+ for (auto &point : cloud_xyz->points ) {
286
+ if (!pcl::isFinite (point)) {
287
+ point.x = 0.0 ;
288
+ point.y = 0.0 ;
289
+ point.z = 0.0 ;
290
+ }
291
+ }
292
+
283
293
// Create voxel grid and project to 2D
284
294
pcl::PointCloud<pcl::PointXYZ>::Ptr voxel_map_ptr (new pcl::PointCloud<pcl::PointXYZ>);
285
295
pcl::VoxelGrid<pcl::PointXYZ> voxel_grid;
You can’t perform that action at this time.
0 commit comments