Image visualization

In ROS, we have a node that enables you to display images coming from a camera on-the-fly. This is an example of a topic with complex data, which is better visualized or analyzed with special tools. You only need a camera to do this, such as your laptop webcam. The example8 node implements a basic camera capture program using OpenCV and ROS bindings to convert cv::Mat images into ROS Image messages that can be published in a topic. This node publishes the camera frames in the /camera topic.

We are only going to run the node with a launch file created to do so. The code inside the node is still new for the reader, but in the followings chapters we will cover how to work with cameras and images in ROS, so we will be able to come back to this node and understand it:

    $ roslaunch chapter3_tutorials example8.launch
  

Once the node is running, we can list the topics (rostopic list) and see that the
/camera topic is there. A straightforward way to verify that we are actually capturing images is to see which frequency we are receiving images at in the topic with rostopic hz/camera. It should be something in the region of 30 Hz. This is shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.199.243