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

Alexander Shavykin alex at shavykin.ru
Thu Jun 9 21:55:15 UTC 2011

Thank you for the answer Sarah.
It works but not so as i want.

First of all i have problems with the setting params for mjpeg_server as it
has written in tutorial:


Now i see only 640*480 picture with very big delay in local network.
Also i tried to set params in gscam (using GSCAM_CONFIG) but it didn't help
(like *GSCAM_CONFIG*="v4l2src device=/dev/video0 ! videoscale !
video/x-raw-yuv,width=320,height=240 ! ffmpegcolorspace !

And also i have some other questions
Is gscam better for publish images then another image_transport modules?
Is combination gscam and mjpeg_server is the best decision for
decrease the delays between robot and
 offboard computer?

Also if you could put up a tutorial for another way to show video from
robot to web using rosjs
it will be very good.

And the last question: what is the best way to transmit audio from ROS
to offboard computer?

Thank you!

2011/6/9 Osentoski Sarah (CR/RTC1.1-NA) <Sarah.Osentoski at us.bosch.com>

>  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:
> http://www.ros.org/wiki/gscam
> 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:
> http://localhost:8080/stream?topic=/gscam/image_raw
> 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)
> Hello.
> 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)
> {});
> or
> 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.
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110610/3eca5130/attachment-0003.html>

More information about the ros-users mailing list