ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi Simon, I'm not 100% sure why this code isn't removing the points, but I can suggest a tidier and faster way of achieving the same thing:

A couple of points, the distance you're calculating is actually the squared distance not the Euclidean distance is this what you were expecting? Right now you're filtering for points further than 3.16m away.

Why are you calling pcl::removeNaNFromPointCloud twice?

I would recommend directly removing the near points from the cloud this will be faster, and will be cleaner and easier to read code. Using a remove_if then erase sequence as described here would be a fast solution if you're expecting to remove a reasonable percentage of the cloud.

It should be noted that if you're input cloud is structured, it will not be structured after filtering so you should change this flag if you're working with the point values directly.