ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Visualize pointcloud in ros

asked 2016-10-27 08:28:48 -0600

jtim gravatar image

Hello I have now used gpu::reprojectImageTo3D on a found disparity image and received cv::Mat of the pointcloud. I would now like to display this pointcloud.

I could not find any method inside OpenCV, I therefore found RViz and/or pcl.

#I see two ways: Method 1:

Convert the found pointcloud from OpenCV to sensor_msgs/PointCloud2 and then publish this topic. Allowing me to view it through RViz.

Issues: I am running this on embedded platform Jetson TX1 and I have read that RViz is not performing that well on the board. Furhtermore I cannot find any explanation for the conversion between the two types.

Method 2:

Use pcl to display the pointcloud from inside the node just for debug purposes.

Issues: I am however unsure if this is even possible.

#Question How do I display a pointcloud found in OpenCV?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-10-28 03:33:55 -0600

mpjansen gravatar image

Hey jtim,

I have little experience with this, but from a couple of years ago I remember looking at: http://wiki.ros.org/cv_bridge/Tutoria...

the cv_bridge can cast image back and forth between opencv and ROS types, visualizing then becomes as simple as creating a publisher and rviz node. Although you indicate that RViz might not work properly, in which case you might be able to try to offload visualization to a normal PC running ROS?

Good luck!

edit flag offensive delete link more

Comments

Hey you are right. I allready use the cv_bridge for converting image messages. I however have not found the usecase of converting them to pointcloud2 messages. The offloading does not seem possible since the company is normally focussed on windows pcs and the lenovo pc is locked for installing linux

jtim gravatar image jtim  ( 2016-10-28 05:54:14 -0600 )edit
0

answered 2017-03-01 21:39:16 -0600

nhanph gravatar image

In the source code of stereo_image_proc from ROS, you can see the part that converts from cv::Mat to pointCloud2 message. You can refer to that part and modify as you see fit.

https://github.com/ros-perception/ima...

Best!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-10-27 08:28:48 -0600

Seen: 1,721 times

Last updated: Oct 27 '16