blam icon indicating copy to clipboard operation
blam copied to clipboard

PCL error?

Open capaulson opened this issue 7 years ago • 4 comments

We're trying to run this code and encountered the following error as soon as the LIDAR started streaming data:

blam_slam_node: /build/pcl-6_P28C/pcl-1.7.2/kdtree/include/pcl/kdtree_flann.hpp:136: int pcl::KdTreeFLANN<PointT, Dist>::nearestKSearch(const PointT&, int, std::vector<int>&, std::vector<float>&) const [with PointT = pcl::PointXYZ: Dist = flann::L2simple<float>] Assertion 'point_representation_->isValid (point) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!"' failed.

Any ideas?

capaulson avatar Sep 29 '17 04:09 capaulson

hey, I met the same problam. Did you fix it ?

wzy0426 avatar Apr 08 '18 01:04 wzy0426

I have solved the problem

Probably because your point cloud data contains"is_dense:false",It means that your point cloud data contains nan

my solution is edit the “point_cloud_filter.cc”, add the following code at the end of the Filter function

if (!points->is_dense) { points_filtered->is_dense = false; std::vector indices; pcl::removeNaNFromPointCloud(*points_filtered,*points_filtered, indices); }

caylaXu avatar Jul 18 '18 03:07 caylaXu

I have solved the problem

Probably because your point cloud data contains"is_dense:false",It means that your point cloud data contains nan

my solution is edit the “point_cloud_filter.cc”, add the following code at the end of the Filter function

if (!points->is_dense) { points_filtered->is_dense = false; std::vector indices; pcl::removeNaNFromPointCloud(*points_filtered,*points_filtered, indices); }

I have tried your solution but it doesn't fix the issue.

shrr98 avatar Feb 01 '20 13:02 shrr98

I have solved the problem Probably because your point cloud data contains"is_dense:false",It means that your point cloud data contains nan my solution is edit the “point_cloud_filter.cc”, add the following code at the end of the Filter function if (!points->is_dense) { points_filtered->is_dense = false; std::vector indices; pcl::removeNaNFromPointCloud(*points_filtered,*points_filtered, indices); }

I have tried your solution but it doesn't fix the issue.


if (!points->is_dense) { points_filtered->is_dense = false; std::vector indices; pcl::removeNaNFromPointCloud(*points_filtered,*points_filtered, indices); }

Try by adding "int" after vector.

This solved the issue and I was able to run it.

nightlygeek12 avatar Oct 08 '20 03:10 nightlygeek12