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

Revision history [back]

The error message you're getting is because the output point cloud is the wrong type. It is a concrete XYZ point cloud, you would need to convert it firstly to a color point cloud i.e. an XYZRGB point cloud then create a shared pointer to this point cloud and pass this shared pointer.

However looking at the code of the function you've shown above, it doesn't use the color information in the point cloud at all (it must have been that type just to work with some other code) so you can simply change the type of the point cloud parameter to pcl::PointCloud<pcl::PointXYZ>::Ptr and the function will do the same job and work with your code.

Finally to get a shared pointer to your output cloud you can use the MakeShared function as below:

mark_cluster(output.makeShared(), "marker_name_space", 1, 255, 0, 0);

Hopefully this should get it working.