| 22 | |
| 23 | template<typename T> |
| 24 | inline sensor_msgs::PointCloud2 cloud2msg(pcl::PointCloud<T> cloud, std::string frame_id = "map") { |
| 25 | sensor_msgs::PointCloud2 cloud_ROS; |
| 26 | pcl::toROSMsg(cloud, cloud_ROS); |
| 27 | cloud_ROS.header.frame_id = frame_id; |
| 28 | return cloud_ROS; |
| 29 | } |
| 30 | |
| 31 | inline void xyzi2xyz(pcl::PointCloud<pcl::PointXYZI>::Ptr XYZI, pcl::PointCloud<pcl::PointXYZ>::Ptr XYZ) { |
| 32 | (*XYZ).points.resize((*XYZI).size()); |