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

Revision history [back]

Hi there and welcome to ROS

You should check out the tutorial Writting a simple image subscriber, there you have a clear explanation on how to subscribe to an image topic and transform that to an OpenCV-compatible data structure using cv_bridge.

Then on the image subscriber callback you execute the routine that you implemented to detect HoughLines.

Avoid using cv::imshow and cv::waitKey inside the callback or be really careful using it. If you want to visualise the results I would recommend you to publish the result of your processing (cdst in the code that you posetd) into its own topic and use the package image_view to visualize it.

Then to start the Asus Xtion Pro run the command:

roslaunch openni2_launch openni2.launch

This will publish the topic /camera/rgb/image_raw (among others)

Then run the node that you will implement following the tutorial that I mentioned before, remapping the topic camera/image to /camera/rgb/image_raw.