Publishing PCL *Coefficients
I start the publisher
pub = nh.advertise<sensor_msgs::PointCloud2> ("projected_inliers", 1);
I run ransac using the cylinder model
.
pcl::ModelCoefficients::Ptr coefficients2 (new pcl::ModelCoefficients);
.
.
seg.segment (*inliers2, *coefficients2);
I print the coefficients fine to the terminal.
std::cerr << "Cylinder coefficients: " << *coefficients2 << std::endl;
pubCyl.publish (*coefficients2);
But I can't seem to publish the coefficients2 successfully. It doesn't throw any errors but when I run rostopic echo /Cylinder_coef it slows my computer down to a stall if I don't end it rather quickly... I'm not sure if this has to do with it being a pointer and it somehow breaks or if I'm missing something else.