Pointcloud2 vs PointCloud2Ptr
Hi, the message i am subscribing to from a topic is PointCloud2, whereas my subscriber callback routine looks like this
void cloud_callback (const sensor_msgs::PointCloud2ConstPtr& cloud_msg){
ROS_INFO("inside callback");
}
int main (int argc, char** argv) {
ros::init (argc, argv, "cloud_sub");
ros::NodeHandle nh;
ros::Rate loop_rate(10);
ros::Subscriber sub;
while (nh.ok()) {
sub = nh.subscribe ("input_cloud", 1, cloud_callback);
ros::spinOnce ();
loop_rate.sleep ();
}
}
Will the fact that the callback type is a Ptr affect the message? How should i take in a Ptr in my callback with the fact that my message subscribed to is PointCloud2 datatype?