ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

roslaunch gscam

asked 2011-11-10 17:51:43 -0600

Chrimo gravatar image

updated 2012-03-27 07:46:24 -0600

kwc gravatar image


is there any solution to launch gscam from launch file ? gscam needs to be started directly from bin dir, else it throws errors. I've found no working solution to changedir from roslauch. Any idea ? Thanks and cheers Christian

edit retag flag offensive close merge delete


Give us some details. What sort of errors? I'm pretty sure I've launched gscam automatically in the past...
Mac gravatar image Mac  ( 2011-11-13 09:14:01 -0600 )edit
As have I, perhaps your GSCAM_CONFIG environment variable is not set to an absolute path?
John Hoare gravatar image John Hoare  ( 2011-11-14 00:09:15 -0600 )edit
I bet it's because roslaunch doesn't use your environment variables, I'm having similar problems with PYTHONPATH. Did you find a solution?
Constantin S gravatar image Constantin S  ( 2011-11-28 04:40:37 -0600 )edit
There's a way to set environment variables in your launch file. This is how i've always set the GSCAM_CONFIG environment variable.
John Hoare gravatar image John Hoare  ( 2011-11-28 07:41:18 -0600 )edit
Yep, I ended up using the <env> tags as well.
Constantin S gravatar image Constantin S  ( 2011-11-28 07:49:36 -0600 )edit
Could you guys post your launch files showing how you set the environment variable. I am also having trouble figuring out how to launch gscam from a launch file .. Here is my launch file with the errors im getting..
Atom gravatar image Atom  ( 2011-12-12 23:00:02 -0600 )edit
<launch> <node pkg="gscam" type="gscam" name="gscam" GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"> </node> <node pkg="mjpeg_server" type="mjpeg_server" name="mjpeg_server" output="screen"> <param name="port" type="int" value="8080" /> </node> </launch>
Atom gravatar image Atom  ( 2011-12-12 23:01:58 -0600 )edit
WARNING: [/opt/ros/diamondback/stacks/web_apps/sample_app/webimage.launch] unknown <node> attribute 'device' WARNING: [/opt/ros/diamondback/stacks/web_apps/sample_app/webimage.launch] unknown <node> attribute 'video'
Atom gravatar image Atom  ( 2011-12-12 23:02:55 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-12-13 21:06:23 -0600

Atom gravatar image

updated 2012-03-27 09:07:29 -0600

Use this line of code in your launch file. Set this right after <launch> at the beginning of your launch file . <env name="GSCAM_CONFIG" value="v4l2src device=/dev/video2 ! video/x-raw-rgb ! ffmpegcolorspace"/>

Or instead of setting environment variables in the launch file, edit your bash file. So first in terminal " gedit ~/.bashrc" then add this line somewhere near the bottom of the file "GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace" . My web camera was set to video0. Now you should launch gscam without any problems.

edit flag offensive delete link more


how to view raw image from this? once i launched rosrun gscam gscam i'm getting success, processing...... what to do next?

nandhini gravatar image nandhini  ( 2012-03-26 02:13:48 -0600 )edit

You could use image view in order to view the image but if you are looking for something more you might write up a new question regarding your intentions.

Atom gravatar image Atom  ( 2012-03-27 07:34:34 -0600 )edit

Question Tools

1 follower


Asked: 2011-11-10 17:51:43 -0600

Seen: 1,752 times

Last updated: Mar 27 '12