Closed InguChoi closed 1 month ago
removeNAN for the input clouds first?
removeNAN for the input clouds first?
Your comment is right.
The point cloud data from my bag file is needed to pre-processing such as NAN
, INFINITE
.
inline void removeNaNAndInfinitePoints(pcl::PointCloud<pcl::PointXYZ>::Ptr& cloud)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr filtered_cloud(new pcl::PointCloud<pcl::PointXYZ>());
int valid_points = 0;
for (const auto& point : cloud->points) {
if (std::isfinite(point.x) && std::isfinite(point.y) && std::isfinite(point.z)) {
filtered_cloud->points.push_back(point);
valid_points++;
}
}
cloud.swap(filtered_cloud);
}
FYI: pcl::removeNaNFromPointCloud
would be useful for this purpose.
https://pointclouds.org/documentation/group__filters.html#ga9de762e05951938f074479c3bf8ae084
Describe the bug I used the function
getFitnessScore();
in thesmall_gicp::RegistrationPCL<pcl::PointXYZ, pcl::PointXYZ> reg;
. It can be builded successfully, but It can not be operated..The error results is below in the terminal.
Environment (please complete the following information):