ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
81 stars 97 forks source link

ros libuvc_camera stopped working #33

Open neeveecomm opened 7 years ago

neeveecomm commented 7 years ago

I am using the rosrun on Nvidia Ubuntu 14.04 platform and i have USB Camera ( UVC Complaint ), i ran the following,

roscore rosrun libuvc_camera camera_node

It worked fine, then i started installing the other components like kinect, stereo camera drivers ( some more components )

after that it stopped working,

root@tegra-ubuntu:/home/ubuntu# rosrun --debug libuvc_camera camera_node

[rosrun] Looking in catkin libexec dirs: /opt/ros/indigo/lib/libuvc_camera

[rosrun] Looking in rospack dir: /opt/ros/indigo/share/libuvc_camera

[rosrun] Searching for camera_node with permissions /111

[rosrun] Running /opt/ros/indigo/lib/libuvc_camera/camera_node

uvc_start_iso_streaming: Busy (-6)

before running this command, i have two video nodes video0 & video1 and i could able to see both videos using luvcview.

After i ran this command, i got only the video0 only ( also it seems that earlier video1 node becomes video0 )

Please share your inputs

mintar commented 7 years ago

This happens for me too after I installed ros-indigo-image-transport-plugins via apt-get. And there's at least one other person with the same problem: http://answers.ros.org/question/243950/ros-libuvc_camera-stopped-working/

After removing all image transport plugins, libuvc_ros works again. The following command must list only the "raw" transport: rosrun image_transport list_transports.

This is a bug and should be fixed.

mintar commented 7 years ago

Actually, it turned out that this bug had a different cause in my case. I had written a syntactically invalid udev rule (forgot a comma), and this caused my webcam not to be recognized as a video4linux device. (This can easily be checked: There was no /dev/video0 symlink, and v4l2-ctl --list-formats-ext didn't work any more.) After fixing the udev rule, libuvc_ros works again, also in combination with image_transport_plugins.

I still have no idea why removing image_transport_plugins made the error message (uvc_start_iso_streaming: Busy (-6)) go away, but I was too focused on that error message and haven't checked whether actually any images were published while the video4linux device was missing (probably not).

mintar commented 7 years ago

Correction: It wasn't my malformed udev rule; it's actually running libuvc_ros with ros-indigo-image-transport-plugins installed that removes the video4linux device! WTF?

With ros-indigo-image-transport-plugins installed:

ROS log:

[ INFO] [1484749169.134982418]: Opening camera with vendor=0x2bc5, product=0x501, serial="", index=0
uvc_start_iso_streaming: Busy (-6)
[camera/libuvc_camera-2] process has died [pid 2455, exit code 255, cmd /opt/ros/indigo/lib/libuvc_camera/camera_node __name:=libuvc_camera __log:=/home/orbbec/.ros/log/1e4cebbe-dd89-11e6-983f-5414fd0102ea/camera-libuvc_camera-2.log].
log file: /home/orbbec/.ros/log/1e4cebbe-dd89-11e6-983f-5414fd0102ea/camera-libuvc_camera-2*.log

/var/log/syslog:

Jan 18 15:02:11 localhost kernel: [   54.168152] usb 1-1.1: usbfs: process 1667 (camera_node) did not claim interface 1 before use
Jan 18 15:02:12 localhost kernel: [   54.531394] uvcvideo: Found UVC 1.00 device Astra Pro HD Camera (2bc5:0501)
Jan 18 15:02:12 localhost kernel: [   54.531769] uvcvideo: No streaming interface found for terminal 5.
Jan 18 15:02:12 localhost kernel: [   54.532005] input: Astra Pro HD Camera as /devices/ff500000.usb/usb1/1-1/1-1.1/1-1.1:1.0/input/input6

/dev/video0 disappears!

Without ros-indigo-image-transport-plugins installed:

ROS log:

[ INFO] [1484748882.388277588]: Opening camera with vendor=0x2bc5, product=0x501, serial="", index=0
[ WARN] [1484748883.219512724]: Unable to set auto_exposure to 1
[ INFO] [1484748883.514328579]: using default calibration URL
[ INFO] [1484748883.514963481]: camera calibration URL: file:///home/orbbec/.ros/camera_info/camera.yaml
[ INFO] [1484748883.515773366]: Unable to open camera calibration file [/home/orbbec/.ros/camera_info/camera.yaml]
[ WARN] [1484748883.516207619]: Camera calibration file /home/orbbec/.ros/camera_info/camera.yaml not found.

/var/log/syslog:

Jan 18 15:16:17 localhost kernel: [  728.655397] uvcvideo: Found UVC 1.00 device Astra Pro HD Camera (2bc5:0501)
Jan 18 15:16:18 localhost kernel: [  728.695291] input: Astra Pro HD Camera as /devices/ff500000.usb/usb1/1-1/1-1.1/1-1.1:1.0/input/input6

... and I have verified that now it produces perfectly good images. Perhaps I should add that this is on an ARM computer (Orbbec Persee) running Ubuntu 14.04 and ROS Indigo, with the latest released version of libuvc_ros (0.0.7).

Anyway, the usb_cam package doesn't have this problem and works fine with the image transport plugins.