template<typename T>
sensor_msgs::PointCloud2 cloud2msg(pcl::PointCloud<T> cloud, const ros::Time& stamp, std::string frame_id = "map") {
sensor_msgs::PointCloud2 cloud_ROS;
pcl::toROSMsg(cloud, cloud_ROS);
cloud_ROS.header.stamp = stamp;
cloud_ROS.header.frame_id = frame_id;
return cloud_ROS;
}
//引用
pub_orgin_cloud_.publish(cloud2msg(accumulated_origin_cloud, lidar_points->header.stamp, lidar_points->header.frame_id));
cloud to msg (pcl)
最新推荐文章于 2024-03-07 15:29:14 发布