Skip to content

Instantly share code, notes, and snippets.

@Kyungpyo-Kim
Created April 30, 2018 11:34
Show Gist options
  • Save Kyungpyo-Kim/8e2b3b34334fa956c5bac26fc60bdb7c to your computer and use it in GitHub Desktop.
Save Kyungpyo-Kim/8e2b3b34334fa956c5bac26fc60bdb7c to your computer and use it in GitHub Desktop.
PCL, ROS, pcl to ros msg
void loam_wrapper::publishInput(pcl::PointCloud<pcl::PointXYZHSV>::Ptr pc)
{
sensor_msgs::PointCloud2 pc2;
pcl::toROSMsg(*pc, pc2);
pc2.header.stamp = ros::Time().now();
pc2.header.frame_id = "/world";
publishInput(pc2);
}
/* Reference
/* https://github.com/adrelino/loam_velodyne-1/blob/master/src/loam/loam_wrapper.cpp
*/
@Kyungpyo-Kim
Copy link
Author

pcl::toROSMsg(*pc, pc2); 를 하면 header 값이 초기화 된다.
The header is initialized after the transform pcl::toROSMsg().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment