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 ...