[ros-users] show video from robot in the web interface (based on rosjs tutoirial)

Osentoski Sarah (CR/RTC1.1-NA) Sarah.Osentoski at us.bosch.com
Wed Jun 8 22:43:01 UTC 2011

Hi Alexander,

So, I'm a bit confused about getting the camera to publish topics to ros or getting those topics from ros into the website.  So I'll endeavour to answer both.

1. How to get your camera to be publishing rostopics:

The first thing to do is to make sure that you get your camera publishing images to ros.  There are a lot of different drivers/code you can use but since you mentioned gstreammer I'll explain how to use gscam to get the images from your camera into ROS.

The documentation for gscam can be found here:

And you can download it using apt-get install ros-diamondback-brown-perception

If your camera was attached to /dev/video2 then you coul ddo the vollowing commands

roscd gscam
cd bin
export GSCAM_CONFIG="v4l2src device=/dev/video2 ! video/x-raw-rgb ! ffmpegcolorspace"
rosrun gscam gscam

Now gscam will be publishing the images on gscam/image_raw topic

2. How to get the rostopics that your camera publishes to be viewed on the website:

You can stream the video to the website one of two ways.  The first is how you mentioned where you use rosjs to subscribe to the topic.  If you need help with what to do from here we can put up a tutorial.

There is another node, mjpeg_server http://www.ros.org/wiki/mjpeg_server that will let you stream the videos and take advantage of built in optimizations in the browser

To use this node you can install it via the following command:
apt-get install ros-diamondback-remote-lab

then just  rosrun mjpeg_server mjpeg_server

To see the image you can just type the address into your web browser:


You should see the image in your browser at this point.  The documentation on the mjpeg_server page will tell you parameters you can set to see the images at different quality/sizes.

I hope this helps.  Let us know if you have any questions.

Sarah Osentoski

From: ros-users-bounces at code.ros.org [mailto:ros-users-bounces at code.ros.org] On Behalf Of Alexander Shavykin
Sent: Wednesday, June 08, 2011 1:43 PM
To: ros-users at code.ros.org
Subject: [ros-users] show video from robot in the web interface (based on rosjs tutoirial)


I have an Irobot Create and netbook with web camera on it.
The system on netbook is Ubuntu 10.04
I try to make control the robot with ROS via web interface from offboard computer using wi-fi.
So there is very good tutorial with rosjs.

All examples work.
But i am a little confused how to show video from web camera on the robot in my web interface.

So as i understand there are some methods for this task

To use service /imagetopic
connection.callService('/rosjs/subscribe',json(['/imagetopic',0,'jpeg',128,96,100]),function(rsp) {});
to use gstreamer
and also others.
I don't understand how to realize these methods.
Could you give some examples how to show the video from the robot in the web interface on off board computer?

Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110609/12e10412/attachment-0002.html>

More information about the ros-users mailing list