ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
From the CloudToImage
page:
Given a dense cloud, you can efficiently grab the rgb image from it as a sensor_msgs::Image
The CloudToImage example is expecting a colored point cloud, and is trying to extract the RGB image from it; not the depth image. This is why you're getting an RGB image.
It looks like the missing frame and timestamp is a separate issue. Perhaps pcl::toROSMsg()
isn't preserving header information as it should. This is probably a bug in pcl_conversions, but you can work around it by copying the header from your input point cloud to the final image before you publish it.