0
$\begingroup$

Rosanswers logo

I am interfacing with a Sick LMS100 laser scanner and I am having problems filtering small objects (such as grass clippings). Are there any tools built into ROS that I could use to filter these objects out easily? If not, what would be the best method for filtering the objects out of the scans?


Originally posted by rplankenhorn on ROS Answers with karma: 48 on 2012-02-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I've had some success doing this by using PointCloud Library's built-in functions, namely Statistical Outlier Removal. It really depends where the majority of your points lie. If there's a lot of grass, this won't work as well. If the grass is sparse, this method could definitely improve your performance. Radial Outlier Removal might also work.

EDIT:

In order to get a ROS sensor_msgs/PointCloud2 to a pcl cloud, use the following code:

sensor_msgs::PointCloud2 cloud_in;
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
pcl::fromROSMsg(cloud_in, *cloud);

The cloud variable will now contain a pcl cloud that you can use with the PCL built-in functions.


Originally posted by DimitriProsser with karma: 11163 on 2012-02-23

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by rplankenhorn on 2012-02-23:
This looks like it could work. How do you suggest I implement it? I looked at the PCL page for ROS and the functions to convert from an ROS PointCloud to a PCL PointCloud and back are deprecated. Am I missing something?

Comment by DimitriProsser on 2012-02-23:
Use the fuction pcl::fromROSMsg(). The docs might be misleading. This function is not deprecated. The fuction point_cloud::fromMsg() is, but not pcl::fromROSMsg().

Comment by rplankenhorn on 2012-02-23:
Thanks again. If the fromMsg is deprecated, how do I convert the pcl::PointCloud back to a PointCloud2?

Comment by DimitriProsser on 2012-02-23:
pcl::toROSMsg() does the opposite of pcl::fromROSMsg()

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.