Robotics StackExchange | Archived questions

UVC_camera fails

I have a problem with uvc_camera. When I run:

rosrun uvc_camera uvc_camera_node

it just says:

[ INFO] [1481414376.278537346]: using default calibration URL
[ INFO] [1481414376.278608501]: camera calibration URL: file:///home/solmaz/.ros/camera_info/camera.yaml
Segmentation fault

When I run my launch file:

roslaunch work_space camera.launch

I get the following results:

[camera_1/uvc_camera_node_1-1] process has died [pid 4942, exit code -11, cmd /opt/ros/indigo/lib/uvc_camera/uvc_camera_node __name:=uvc_camera_node_1 __log:=/home/solmaz/.ros/log/5910aa52-bf33-11e6-bdb3-e03f494ac521/camera_1-uvc_camera_node_1-1.log].
log file: /home/solmaz/.ros/log/5910aa52-bf33-11e6-bdb3-e03f494ac521/camera_1-uvc_camera_node_1-1*.log

The log file is empty that makes it harder to find the problem.

My launch file this:

<?xml version="1.0"?>
<launch>
  <node ns="camera_1" pkg="uvc_camera" type="uvc_camera_node" name="uvc_camera_node_1">
    <param name="width" type="int" value="640" />
    <param name="height" type="int" value="480" />
    <param name="fps" type="int" value="30" />
    <param name="frame" type="string" value="webcam" />
    <param name="device" type="string" value="/dev/video0" />
    <param name="auto_focus" type="bool" value="0" />
  </node>
</launch>

This web camera works fine on another machine. And guvcview also works.

Asked by David_Zizu on 2016-12-10 19:06:35 UTC

Comments

One way to approach this would probably be to get uvc_camera_node to run in gdb (see How to Roslaunch Nodes in Valgrind or GDB). Preferably even a debug build of that node.

Asked by gvdhoorn on 2016-12-11 04:01:46 UTC

Also: please always include your OS, its version, the version of ROS you are using, how you installed it (from sources or binary pkgs), etc.

Asked by gvdhoorn on 2016-12-11 04:02:33 UTC

Finally: uvc_camera is deprecated (from the wiki page):

This package is no longer actively maintained. Please use another driver, such as libuvc_camera (github).

Asked by gvdhoorn on 2016-12-11 04:04:13 UTC

I use Linux Ubuntu 14.04; ROS Indigo; installed from packages. I tried to use libuvc_camera, but there was the same problem.

Asked by David_Zizu on 2016-12-11 04:18:37 UTC

I tried to use libuvc_camera, but there was the same problem.

that could point to a more general problem with drivers / sw-hw interaction then. Debugging using gdb (or any other tool) is probably the best course of action.

Asked by gvdhoorn on 2016-12-11 04:25:42 UTC

Does file:///home/solmaz/.ros/camera_info/camera.yaml exist?

Asked by gvdhoorn on 2016-12-11 05:06:52 UTC

yes, this file exists

Asked by David_Zizu on 2016-12-12 20:58:22 UTC

I am sure completely sure of how to debug with gdb. Could you help me with that?

Asked by David_Zizu on 2016-12-12 21:16:16 UTC

From the "How to Roslaunch Nodes in Valgrind or GDB" I linked above: add a launch-prefix="xterm -e gdb --args" to the libuvc_camera node tag in the launch file. That should start it in gdb. Then after the SEGFAULT, enter bt (for backtrace) and hit enter. Then copy/paste that.

Asked by gvdhoorn on 2016-12-13 03:42:14 UTC

Answers