Monday, September 8, 2014

Getting data from camera in Robot Operating System

I have used webcams in OpenCV before.

However, I came across a situation where I had to stream the webcam data to a ROS (Robot Operating System) topic.

There are bunch of ROS packages on website. However, when I did a

it gave me errors saying there was no such package found.

All I want to do is grab the data from a webcam and post it to a topic (so that other ROS nodes can read from that topic). I knew it had to be simple

So, I came across this deb package in Ubuntu

Once, I did the above installation all I had to do was

Then, it started publishing data onto /image_raw topic.

Then I could do a

To read the data from the camera published on the topic.

To get a list of topics published to, do a

If you ran the above command, you could infer that the published image stream is of type /sensor_msgs/Image