liorf icon indicating copy to clipboard operation
liorf copied to clipboard

Point cloud is not in dense format, please remove NaN points first!

Open liu-ry opened this issue 1 year ago • 3 comments

使用 robosense 雷达的时候,报错“Point cloud is not in dense format, please remove NaN points first!”,请问是不是 robosense 雷达录制的数据暂时还不支持lio-sam算法?

liu-ry avatar Oct 24 '24 07:10 liu-ry

你好,请问你知道报错的原因了吗?我的是ouster的雷达也有这个报错

wangxing124 avatar Feb 25 '25 08:02 wangxing124

I have the same error with a Velodyne VLP-16. Do we need to first filer our data? (i don't speak chinese)

ylenianistico avatar Mar 04 '25 16:03 ylenianistico

Not sure if anyone is still having this issue, but I fixed it by added simple code to just remove the NaNs instead of throwing the error.

In imageProjection.cpp in the cachePointCloud function, replace

        // check dense flag
        if (laserCloudIn->is_dense == false)
        {
            RCLCPP_ERROR_STREAM(get_logger(), "Point cloud is not in dense format, please remove NaN points first!");
            rclcpp::shutdown();
        }

with

        // check dense flag
        if (laserCloudIn->is_dense == false)
        {
            // Remove NaNs
            // RCLCPP_INFO(this->get_logger(), "Point cloud is not in dense format, removing NaN points");
            pcl::PointCloud<VelodynePointXYZIRT>::Ptr tmpCloud(new pcl::PointCloud<VelodynePointXYZIRT>);
            std::vector<int> indices;
            pcl::removeNaNFromPointCloud(*laserCloudIn, *tmpCloud, indices);
            laserCloudIn = tmpCloud;
        }

bboyack avatar Apr 22 '25 13:04 bboyack