ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Lucky for you, code to do this already exists in the pcl_ros package. Then, rather than having your callbacks take sensor_msgs::PointCloud2
objects (or, really, ConstPtrs
to sensor_msgs::PointCloud2
objects), your callbacks take in pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr
s; the conversion to the PCL point cloud is completely transparent, and you don't have to think about interpreting the ROS message yourself.