USB Camera error (exit code -6)


I installed openag_brain on my pi, and now I’m testing the different components. I decided to start with the camera since it’s the only one that connects directly to the pi and not to the arduino. Whenever I try to run the camera using roslaunch usb_cam usb_cam-test.launch a window opens for a second then it closes and gives me an error. This is the output I’m getting:

pi@raspberrypi:~ $ roslaunch usb_cam usb_cam-test.launch
... logging to /home/pi/.ros/log/8e9c79ca-f6c9-11e7-9ee9-b827ebb79259/roslaunch-raspberrypi-6501.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://raspberrypi:33105/


* /image_view/autosize: True
* /rosdistro: indigo
* /rosversion: 1.11.21
* /usb_cam/camera_frame_id: usb_cam
* /usb_cam/image_height: 480
* /usb_cam/image_width: 640
* /usb_cam/io_method: mmap
* /usb_cam/pixel_format: yuyv
* /usb_cam/video_device: /dev/video0

image_view (image_view/image_view)
usb_cam (usb_cam/usb_cam_node)


core service [/rosout] found
process[usb_cam-1]: started with pid [6524]
process[image_view-2]: started with pid [6525]
[ INFO] [1515679567.126301031]: using default calibration URL
[ INFO] [1515679567.129493557]: camera calibration URL: file:///home/pi/.ros/camera_info/head_camera.yaml
[ INFO] [1515679567.131939631]: Unable to open camera calibration file [/home/pi/.ros/camera_info/head_camera.yaml]
[ WARN] [1515679567.132943268]: Camera calibration file /home/pi/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1515679567.134252841]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ INFO] [1515679567.247578994]: Using transport "raw"
Attempt to unlock mutex that was not locked
[image_view-2] process has died [pid 6525, exit code -6, cmd /home/pi/catkin_ws/devel/lib/image_view/image_view image:=/usb_cam/image_raw __name:=image_view __log:=/home/pi/.ros/log/8e9c79ca-f6c9-11e7-9ee9-b827ebb79259/image_view-2.log].
log file: /home/pi/.ros/log/8e9c79ca-f6c9-11e7-9ee9-b827ebb79259/image_view-2*.log

What does this mean? At first I thought that the calibration file might be the issue, but apparently it should work even with that warning. :persevere:


you can use and copy a file and place to path/home/pi/.ros/camera_info/head_camera.yaml

try to find usb cam file start from the post above


I did find the calibration file and now I have no warnings, but the same error is still there, plus an empty window.


My PFC testing station come with the AM2315, give error 255 and lock up sensors from give reading form "rostopic echo " .
and I did have USB CAM 2 fail and not plug in for long time The camera view suddenly give out images form USB CAM 1.
USB CAM1 is a 30M 640x480 webcam I am going to use another 720p webcam as USB CAM1 and change setting to two files


change them to “1280x960” or “1600x896” which is the 720p webcam supported resolution.