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

How to implement conditional euclidean clustering in ROS?

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

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

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

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



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 image blackmamba591  ( 2016-01-26 12:25:54 -0500 )edit

I am happy that helped :)

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

Question Tools

1 follower


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

Seen: 1,340 times

Last updated: Jan 26 '16