I have 3D points from gpu::reprojectImageTo3D on a found disparity image. I would now like to display this pointcloud.
How do I Convert the found pointcloud from OpenCV
to sensor_msgs/PointCloud2
?
I do not need to publish the pointcloud this is only for debug visualization. Could it be possible to display it as is done with images from the node? e.g. using pcl
? This would be optimal since my device may not perform well with RViz
(based on readings online).
My best guess is to do like this, and just iterate through the
cv::mat
and insert in thepcl
to convert to msg, since I have not found anything that does directly.This code snippet was found at apprize.