mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Nodelets point_cloud_xyz[rgb]: fixed NaN error when no prior filtering is done before radius filtering
This commit is contained in:
@@ -256,9 +256,17 @@ private:
|
|||||||
|
|
||||||
void processAndPublish(pcl::PointCloud<pcl::PointXYZ>::Ptr & pclCloud, const std_msgs::Header & header)
|
void processAndPublish(pcl::PointCloud<pcl::PointXYZ>::Ptr & pclCloud, const std_msgs::Header & header)
|
||||||
{
|
{
|
||||||
if(pclCloud->size() && (minDepth_ != 0.0 || maxDepth_ > minDepth_))
|
if(pclCloud->size())
|
||||||
{
|
{
|
||||||
pclCloud = rtabmap::util3d::passThrough(pclCloud, "z", minDepth_, maxDepth_>minDepth_?maxDepth_:std::numeric_limits<float>::max());
|
if(minDepth_ != 0.0 || maxDepth_ > minDepth_)
|
||||||
|
{
|
||||||
|
pclCloud = rtabmap::util3d::passThrough(pclCloud, "z", minDepth_, maxDepth_>minDepth_?maxDepth_:std::numeric_limits<float>::max());
|
||||||
|
}
|
||||||
|
else if(noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
|
{
|
||||||
|
// remvoe NaN values
|
||||||
|
pclCloud = rtabmap::util3d::removeNaNFromPointCloud(pclCloud);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
|
|||||||
@@ -259,9 +259,17 @@ private:
|
|||||||
|
|
||||||
void processAndPublish(pcl::PointCloud<pcl::PointXYZRGB>::Ptr & pclCloud, const std_msgs::Header & header)
|
void processAndPublish(pcl::PointCloud<pcl::PointXYZRGB>::Ptr & pclCloud, const std_msgs::Header & header)
|
||||||
{
|
{
|
||||||
if(pclCloud->size() && (minDepth_ != 0.0 || maxDepth_ > minDepth_))
|
if(pclCloud->size())
|
||||||
{
|
{
|
||||||
pclCloud = rtabmap::util3d::passThrough(pclCloud, "z", minDepth_, maxDepth_>minDepth_?maxDepth_:std::numeric_limits<float>::max());
|
if(minDepth_ != 0.0 || maxDepth_ > minDepth_)
|
||||||
|
{
|
||||||
|
pclCloud = rtabmap::util3d::passThrough(pclCloud, "z", minDepth_, maxDepth_>minDepth_?maxDepth_:std::numeric_limits<float>::max());
|
||||||
|
}
|
||||||
|
else if(noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
|
{
|
||||||
|
// remvoe NaN values
|
||||||
|
pclCloud = rtabmap::util3d::removeNaNFromPointCloud(pclCloud);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
if(pclCloud->size() && noiseFilterRadius_ > 0.0 && noiseFilterMinNeighbors_ > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user