Ask Your Question
0

How to implement conditional euclidean clustering in ROS?

asked 2016-01-25 13:14:32 -0600

I am aware of the the conditional euclidean clustering is available on PCL website. But can someone please tell me how to implement this in ROS?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2016-01-26 02:11:23 -0600

Take a look at the PCL Ros tutorials. There is nothing special about PCL, it can be used as any third-party library.

You will get your potincloud messages in ROS as sensor_msgs::Pointcloud2. But in the tutorials they explain how to convert this to PCL pointcloud type:

pcl::PointCloud<pcl::PointXYZ> cloud;
pcl::fromROSMsg (*input, cloud);

You can find more information about how to convert types here. Note that an awesome feature is what is explained at the end of section 3.1:

// Need to include the pcl ros utilities
#include "pcl_ros/point_cloud.h"

// callback signature, assuming your points are pcl::PointXYZRGB type:
void callback(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&);

// create a templated subscriber
ros::Subscriber sub = nh.subscribe<pcl::PointCloud<pcl::PointXYZRGB> > (topic, queue_size, callback);

That is, ROS includes some hooks so that you can subscribe directly to the PCL pointcloud type and thus you do not need to carry out any conversion.

edit flag offensive delete link more

Comments

1

Thanks a lot, I implemented the SAC segmentation with some changes, and it works, I will give it a try. Thanks for your response Javier

blackmamba591 gravatar imageblackmamba591 ( 2016-01-26 12:25:54 -0600 )edit

I am happy that helped :)

Javier V. Gómez gravatar imageJavier V. Gómez ( 2016-01-26 16:13:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-25 13:14:32 -0600

Seen: 780 times

Last updated: Jan 26 '16