Convert PointCloud2 without RGB into Imagen type.
I have a ToF depth image camera. The PointCloud2 topic Is named "/tof_cam635_node/points". I would like to convert this into an Image topic so I can work with it using OpenCV.
It appears this ToF cam doesn't have RGB, but I thought that wasn't important, until I ran this command:
rosrun pcl_ros convert_pointcloud_to_image input:=/tof_cam635_node/points output:=/tof_cam635_node/my_pcl_image
Note: /tof_cam635_node/my_pcl_image topic is made up by me, not sure if that can be causing the error.
The error that I get is:
Error in converting cloud to image message: No rgb field!!
Is there a way to bypass this so I can use that depth image in OpenCV?
Hi, maybe this post is usefull.
@Weasfas hi, thanks for suggesting it. Yes I saw that, but since I saw no practical reference on how to implement something like that I searched for other options. Do you happen to know a piece of code that uses what the approved answer is talking about? Thanks in advance. I'm trying to find it on my own but no luck.
Well the only reference I found is this, but implementing the idea is very straight forward in my opinion.
Thank you @Weasfas. If I implement it successfully, I'll let you know.