Visualization of images

In ROS, we have a node that allows us to show images coming from a camera on the fly. You only need a camera to do this. It is also possible to reproduce a video with a simple node in ROS but here we are going to use your laptop's webcam. The example6 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 upcoming chapters, we will cover how to work with cameras and images in ROS so that we can come back to this node and understand ...

Get Learning ROS for Robotics Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.