Setting a USB camera in ROS
Hello,
First of all i wanna say that i'm really really new at ROS, I basiclly just started and so I don't know even all the commands and functionalities that there is. So I apolagize if I make really stupid questions.
I'm trying to use a USB camera, i have a HP HD 4310. I installed 'cheese' and ran it and could see the output from the camera, so i know the camera is linked just fine. After that i tried to install it in ROS, and that's where the problems started. After some research i followed some steps, and this like this:
sudo apt-get install ros-indigo-uvc-camera
Afterwards also tried:
sudo apt-get install ros-indigo-cv-camera
sudo apt-get install ros-indigo-libuvc-camera
I also went to /dev and saw that my camera was in /dev/video1.
After that i tried to initialize the camera, by doing:
rosrun uvc_camera uvc_camera_node _device:=/dev/video1
But i get the following messages:
[ INFO] [1506553332.714160099]: using default calibration URL
[ INFO] [1506553332.714246140]: camera calibration URL: file:///home/cesar/.ros/camera_info/camera.yaml
[ INFO] [1506553332.714315848]: Unable to open camera calibration file [/home/cesar/.ros/camera_info/camera.yaml]
[ WARN] [1506553332.714344759]: Camera calibration file /home/cesar/.ros/camera_info/camera.yaml not found.
opening /dev/video1
pixfmt 0 = 'YUYV' desc = 'YUYV 4:2:2'
discrete: 640x480: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 160x120: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 176x144: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 320x240: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 352x288: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 424x240: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 640x360: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 800x448: 1/20 1/15 1/10 2/15
discrete: 800x600: 1/15 1/10 2/15
discrete: 848x480: 1/15 1/10 2/15
discrete: 960x540: 1/15 1/10 2/15
discrete: 960x720: 1/15 1/10 2/15
discrete: 1280x720: 2/15
discrete: 1920x1080: 1/5
discrete: 640x480: 1/30 1/25 1/20 1/15 1/10 2/15
pixfmt 1 = 'MJPG' desc = 'Motion-JPEG'
discrete: 640x480: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 160x120: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 176x144: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 320x240: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 352x288: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 416x240: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 640x360: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 800x448: 1/30 1/25 1/20 1/15 1/10 2/15
discrete: 800x600: 1 ...
Try
rosrun uvc_camera uvc_camera_node _device:=/dev/video1
(added_
before device, since it's a private parameter and not topic)Hi @ahendrix, thanks for that observation, in fact that was something i was doing wrong. Please re read my post as i edited it with the new result after I corrected that
@ahendrix, please check the new information that i added
It looks like you have the parameters right now, and the node is crashing. I don't know enough about the specifics of the uvc_camera node to know why it might be crashing.
Try out http://wiki.ros.org/usb_cam (
_video_device:=/dev/video1
, the parameters are named different)- it's possible with either package that the default pixel format doesn't work (perhaps to the point of crashing), and you should try the other ones. Does /dev/video0 (your laptop camera?) work?How can i install that package usb_cam @lucasw ? That website on wiki only has the code on github. How do i install it? If i try doing "rosrun uvc_camera uvc_camera_node _device.=/dev/video0" gives the exact same messages.
Another thing that i saw is that by doing "rosrun rqt_image_view rqt_image_view" it only gives me the image of the internal pc camera, and not my USB camera. Although when i do "cheese" wich is a program to see streaming output from a camera it gives me the image of the usb camera..
If you can see the image in rqt_image_view that means the node is working? Or does it only do a few frames then dies?
/dev/video0
is likely your internal camera, and/dev/video1
is what you plugged in - it is worth trying different cameras to see if the problem is with the camera or elsewhere.