<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.6082" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>Hi Alexander,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>1. How to get your camera to be publishing
rostopics:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>The documentation for gscam can be found
here:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2><A
href="http://www.ros.org/wiki/gscam">http://www.ros.org/wiki/gscam</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>And you can download it using apt-get install
ros-diamondback-brown-perception</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>If your camera was attached to /dev/video2 then you coul
ddo the vollowing commands</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=3><PRE>roscd gscam
cd bin
export GSCAM_CONFIG="v4l2src device=/dev/video2 ! video/x-raw-rgb ! ffmpegcolorspace"
rosrun gscam gscam</PRE></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>Now gscam will be publishing the images on gscam/image_raw
topic</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=378470022-08062011><FONT face=Arial
color=#0000ff size=2>2. How to get the rostopics that your camera publishes to
be viewed on the website:</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=378470022-08062011></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Y<SPAN class=378470022-08062011>ou 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.</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=378470022-08062011></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=378470022-08062011>There is another node, mjpeg_server <A
href="http://www.ros.org/wiki/mjpeg_server">http://www.ros.org/wiki/mjpeg_server</A> that
will let you stream the videos and take advantage of built in optimizations in
the browser</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>To use
this node you can install it via the following command:</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2>apt-get install ros-diamondback-remote-lab</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>then
just rosrun mjpeg_server mjpeg_server</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>To see
the image you can just type the address into your web
browser:</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV><PRE><A href="http://localhost:8080/stream?topic=/gscam/image_raw">http://localhost:8080/stream?topic=/<SPAN class=378470022-08062011>gscam/image_raw</A></SPAN></PRE>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>I hope
this helps. Let us know if you have any questions.</FONT></SPAN></DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=378470022-08062011><FONT face=Arial color=#0000ff size=2>Sarah
Osentoski</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ros-users-bounces@code.ros.org
[mailto:ros-users-bounces@code.ros.org] <B>On Behalf Of </B>Alexander
Shavykin<BR><B>Sent:</B> Wednesday, June 08, 2011 1:43 PM<BR><B>To:</B>
ros-users@code.ros.org<BR><B>Subject:</B> [ros-users] show video from robot in
the web interface (based on rosjs tutoirial)<BR></FONT><BR></DIV>
<DIV></DIV>Hello.
<DIV><BR></DIV>
<DIV>I have an Irobot Create and netbook with web camera on it.</DIV>
<DIV>The system on netbook is Ubuntu 10.04</DIV>
<DIV>I try to make control the robot with ROS via web interface from offboard
computer using wi-fi.</DIV>
<DIV>So there is very good tutorial with rosjs.</DIV>
<DIV><BR></DIV>
<DIV>All examples work.</DIV>
<DIV>But i am a little confused how to show video from web camera on the robot
in my web interface.</DIV>
<DIV><BR></DIV>
<DIV>So as i understand there are some methods for this task</DIV>
<DIV><BR></DIV>
<DIV>To use service /imagetopic</DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">connection.callService('/rosjs/subscribe',json(['/imagetopic',0,'jpeg',128,96,100]),function(rsp)
{});</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">or</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">to use
gstreamer </SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">and also
others.</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">I don't understand how
to realize these methods.</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">Could you give some
examples how to show the video from the robot in the web interface on off board
computer?</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace"><BR></SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace"><BR></SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace">Thank you.</SPAN></DIV>
<DIV><SPAN class=Apple-style-span
style="FONT-SIZE: 15px; FONT-FAMILY: courier, monospace"><BR></SPAN></DIV></BODY></HTML>