ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

usb_cam installation on ubuntu and default launch file

asked 2016-03-01 14:21:39 -0500

wintermute gravatar image

Hello All,

I installed ros-jade-usb-cam with apt-get and then made a "sudo dpkg -L ros-jade-usb-cam" which generated the following files:

/opt /opt/ros /opt/ros/jade /opt/ros/jade/include /opt/ros/jade/include/usb_cam /opt/ros/jade/include/usb_cam/usb_cam.h /opt/ros/jade/lib /opt/ros/jade/lib/ /opt/ros/jade/lib/usb_cam /opt/ros/jade/lib/usb_cam/usb_cam_node /opt/ros/jade/lib/pkgconfig /opt/ros/jade/lib/pkgconfig/usb_cam.pc /opt/ros/jade/share /opt/ros/jade/share/usb_cam /opt/ros/jade/share/usb_cam/cmake /opt/ros/jade/share/usb_cam/cmake/usb_camConfig.cmake /opt/ros/jade/share/usb_cam/cmake/usb_camConfig-version.cmake /opt/ros/jade/share/usb_cam/launch /opt/ros/jade/share/usb_cam/launch/usb_cam-test.launch /opt/ros/jade/share/usb_cam/package.xml /usr /usr/share /usr/share/doc /usr/share/doc/ros-jade-usb-cam /usr/share/doc/ros-jade-usb-cam/changelog.Debian.gz

and then I launch

rosrun usb_cam usb_cam_node

and the image launches.

Where is the default .launch file, I created a usb_cam.launch file under ~/catkin_ws/devel/lib and I can launch roslaunch usb_cam.launch and it will work. (however when only I am in ~/catkin_ws/devel/lib directory.

I previously installed usb_cam on this computer from source, and everything was working fine - so the real question is:

when we install usb_cam tru ubuntu package system, where do we put the usb_cam.launch file?

Best regards, C.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-01 16:12:38 -0500

lucasw gravatar image

It would be ugly but you could drop another launch file alongside this one:


And then roslaunch usb_cam usb_cam.launch.

But really you should have a catkin package that contains your custom usb_cam.launch like catkin_ws/src/my_package/launch/usb_cam.launch, and then make sure to fill in the CMake commands to get it get installed if you are sourcing catkin_ws/install/setup.bash instead of devel/setup.bash, and then roslaunch my_package usb_cam.launch should work.

edit flag offensive delete link more


Hey Lukasw

I tried a similar command in order to achieve this result.

 source /opt/ros/kinetic/share/usb_cam/launch/usb_cam-test.launch

However, error message

 bash: /opt/ros/kinetic/share/usb_cam/launch/usb_cam-test.launch: line 1: syntax error near unexpected token 'newLine
aaditya_saraiya gravatar image aaditya_saraiya  ( 2017-08-24 07:57:18 -0500 )edit

I apologize if it is a silly doubt. I am a newbie in ROS. ROS- Kinetic, Ubuntu 16.04.

Thanks in advance

aaditya_saraiya gravatar image aaditya_saraiya  ( 2017-08-24 07:58:09 -0500 )edit

You can't source a launch file, use roslaunch instead.

lucasw gravatar image lucasw  ( 2017-08-24 10:24:22 -0500 )edit

Thank you so much, that works perfectly.

Just one more question. If I need to change the default camera to be an external USB camera and not my integrated webcam. what changes do I need to make?

<param name="video_device" value="/dev/video1" />

I changed the launch file this way, doesnt work.

aaditya_saraiya gravatar image aaditya_saraiya  ( 2017-08-25 02:21:36 -0500 )edit

edit. It works as per this link text

However then I need to cd into the launch directory and then run roslaunch. It doesn't work if I run the command you mentioned. Any idea what could be the reason.

Thanks in advance

aaditya_saraiya gravatar image aaditya_saraiya  ( 2017-08-25 02:35:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-03-01 14:21:39 -0500

Seen: 5,378 times

Last updated: Mar 01 '16