Publishing Point Cloud pcl::PointXYZ
Hi,
I'm already using a variable of the type pcl::PointCloud<pcl::pointxyz>::Ptr called grasp_points that I'd like to publish. I tried to follow this example: answers.ros.org/question/35368/pointcloud-library-publishing/
Here's what I have for code:
typedef pcl::PointCloud<pcl::PointXYZ> PCLCloud;
ros::Publisher graspub = n.advertise<PCLCloud> ("grasp_points", 100);
ros::Rate loop_rate(10);
graspub.publish(grasp_points);
I also initialize ROS and the node n, and the code compiles fine. I can tell that the delay is working. But when I check rostopic list, only rosout and rosout_agg are listed. There must be something I didn't include in my code. Does anyone know what it is? Thanks!
EDIT: It might be a problem with the type. grasp_points is acutally a pcl::PointCloud<pcl::pointxyz>::Ptr {aka boost::shared_ptr<pcl::pointcloud<pcl::pointxyz> >}
I also have a variables of the types std::vector<pcl::pointxyz> and pcl::visualization::PointCloudColorHandlerCustom<pcl::pointxyz>. Would I be able to publish either of those?
EDIT 2: Okay, I found the data stored as floats, so I can just publish those.
what is data type of grasp_points ?