Visualizing non-scalar data – 2D/3D images
There are several robotic applications that deal with 2D and 3D data, usually in the form of images or point cloud. ROS provides interfaces that are built upon the OpenCV library to solve computer vision problems for complex robotics applications.
Getting ready
There are several extremely useful tools available in ROS to visualize these types of data, such as image_view
and rqt_image_view
for 2D data. Similarly, in ROS, we have rviz
and rqt_rviz
, which integrates an OpenGL interface with a 3D world that represents sensor data in a world representation.
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...