ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

can't set any settings for uvc_camera

asked 2012-07-07 07:29:34 -0500

dinamex gravatar image

Hi guys,

I want to use a webcam with the uvc_camera Package. I'm using Ubuntu 11.10 server and compiled the package from source (because I use an ARM processor). It compiled without any problems but when I try to run the launchfile (camera_node.launch) I got the following failure message. I can see the video but its really slow and all settings (color, saturation, whitbalance etc.) are wrong and the picture looks almost crossprocessed.

camera_node.launch:

PARAMETERS
 * /uvc_camera/device
 * /rosdistro
 * /uvc_camera/fps
 * /uvc_camera/height
 * /uvc_camera/camera_info_url
 * /uvc_camera/frame
 * /rosversion
 * /uvc_camera/width

NODES
  /
    uvc_camera (uvc_camera/camera_node)

auto-starting new master
process[master]: started with pid [3736]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to c57a2f6c-b5ae-11e1-bd3e-2e607c264e01
process[rosout-1]: started with pid [3751]
started core service [/rosout]
process[uvc_camera-2]: started with pid [3754]
[ INFO] [1339629806.595916290]: using default calibration URL
[ INFO] [1339629806.597411651]: camera calibration URL: file:///home/panda/.ros/camera_info/camera.yaml
[ERROR] [1339629806.598754424]: Unable to open camera calibration file [/home/panda/.ros/camera_info/camera.yaml]
[ WARN] [1339629806.599486846]: Camera calibration file /home/panda/.ros/camera_info/camera.yaml not found.
[ INFO] [1339629806.612029571]: camera calibration URL: file:///home/panda/ros_workspace/camera_umd/uvc_camera/example.yaml
[ERROR] [1339629806.612853545]: Unable to open camera calibration file [/home/panda/ros_workspace/camera_umd/uvc_camera/example.yaml]
[ WARN] [1339629806.613372344]: Camera calibration file /home/panda/ros_workspace/camera_umd/uvc_camera/example.yaml not found.
opening /dev/video2
pixfmt 0 = 'YUYV' desc = 'YUV 4:2:2 (YUYV)'
  discrete: 640x480:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 160x90:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 160x120:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 176x144:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 320x180:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 320x240:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 352x288:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 432x240:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 640x360:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 800x448:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 800x600:   1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 864x480:   1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 960x720:   1/15 1/10 2/15 1/5
  discrete: 1024x576:   1/15 1/10 2/15 1/5
  discrete: 1280x720:   1/10 2/15 1/5
  discrete: 1600x896:   2/15 1/5
  discrete: 1920x1080:   1/5
  discrete: 2304x1296:   1/2
  discrete: 2304x1536:   1/2
pixfmt 1 = '    ' desc = '34363248-0000-0010-8000-00aa003'
  discrete: 640x480:   1/30 1/24 1/20 1/15 1/10 2/15 1/5
  discrete: 160x90:   1/30 1/24 1/20 1/15 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-07-08 09:22:42 -0500

The uvc_camera wiki page states that dynamic control of the parameters is still on the TODO list (see here). A quick run through the code reveals that the parameters are being set starting at line 158 in src/uvc_cam.cpp.

The best way to change these parameters would be to set them up these calls through dynamic reconfigure. The driver already prints out the available controls and their ranges, and you can use these as a guide to set the appropriate values in the dynamic reconfigure gui.

edit flag offensive delete link more

Comments

I've been having a similar issue. I have gone in and changed the control ranges in the area specified but it hasn't had an effect. According to the camera specs, I should not be setting the White Balance Temperature (Auto is there and set). The line is commented out but it's shown in the output.

DocSmiley gravatar image DocSmiley  ( 2012-08-17 09:01:39 -0500 )edit

I also looked at the line suggested by @piyushk. The set_control() function calls a different id than the one printed: 9963776 would be brightness, while printed says brightness is 980900. However, my output suggests that the value set in the code is used, not the one printed. Very confusing.

RafBerkvens gravatar image RafBerkvens  ( 2013-04-12 03:21:44 -0500 )edit

https://github.com/ericperko/uvc_cam/... (a fork) has some commented out lines like

set_control(V4L2_CID_BRIGHTNESS, 135);

Also from the command line: uvcdynctrl -d /dev/video0 -s 'Brightness' 135

lucasw gravatar image lucasw  ( 2014-08-20 10:44:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2012-07-07 07:29:34 -0500

Seen: 3,585 times

Last updated: Jul 08 '12