O'Reilly logo

Robot Operating System Cookbook by Kumar Bipin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works…

In this section, we will discuss program8 (refer to chapter4_tutorials/src/program8.cpp on GitHub), which implements a basic camera capture program using OpenCV and ROS binding to convert cv::Mat images into ROS image messages. This node publishes the image messages from camera frames in the /camera topic and enables us to display images coming from a camera on-the-fly. We will discuss more about source code and implementation in the upcoming chapter, or interested readers could refer to the online resources (https://docs.opencv.org/3.0-beta/modules/videoio/doc/reading_and_writing_video.html).

However, we can run the node using the launch file:

$ roslaunch chapter4_tutorials program8.launch

We can't use rostopic echo /camera ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required