Ask Your Question
1

camera_umd "unable to set control: Invalid argument" [closed]

asked 2012-05-25 18:55:17 -0500

frog0705 gravatar image

hi,everybody!! I am a college student ,i get an error when i use uvc_camera package.The error tips:

#

opening /dev/video0 pixfmt 0 = 'JPEG' desc = 'JPEG' discrete: 320x240:
discrete: 640x480:

int (Brightness, 0, id = 980900): 0 to 255 (1)

int (Contrast, 0, id = 980901): 0 to 255 (1)

int (Gamma, 0, id = 980910): 1 to 6 (1)

int (Exposure, 16, id = 980911): 781 to 18750 (1)

bool (Auto Gain, 8, id = 980912): 0 to 1 (1)

menu (Light frequency filter, 0, id = 980918): 0 to 2 (1)

0: NoFliker

1: 50 Hz

2: 60 Hz

int (Sharpness, 0, id = 98091b): 0 to 3 (1)

fd is 10

ioctl(fd, VIDIOC_S_CTRL, &c) return -1

unable to set control: Invalid argument

ERROR: could not set some settings.

unable to set control

select timeout in grab

select timeout in grab

##############################################

uvc_cam.cpp:

void Cam::set_control(uint32_t id, int val)

{

v4l2_control c;

c.id = id;

if (ioctl(fd, VIDIOC_G_CTRL, &c) == 0)

{

printf("current value of %d is %d\n", id, c.value);

//perror("unable to get control");

//throw std::runtime_error("unable to get control");

}

c.value = val;

if (ioctl(fd, VIDIOC_S_CTRL, &c) < 0)

{

printf("fd is %d\n",fd);

printf("ioctl() return %d\n",ioctl(fd, VIDIOC_S_CTRL, &c));

perror("unable to set control");

throw std::runtime_error("unable to set control");

}

}

#####################################################

my system is,ubuntu 12.04 LTS,with ROS fuerte

It pullzed me for a long time ,great thanks!!!!!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by 130s
close date 2013-10-29 22:03:07

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-04-11 10:06:22 -0500

leothelion gravatar image

Hi!! If I comment out all of the set_control( param, param) calls, I get an error:

[uvc_camera-1] process has died [pid 3419, exit code -11, cmd /home/siml/roswk/uvc_camera_pkg/uvc_camera/bin/camera_node __name:=uvc_camera __log:=/home/siml/.ros/log/0cee0b5a-a2dc-11e2-9b3d-20cf3057401c/uvc_camera-1.log]. log file: /home/siml/.ros/log/0cee0b5a-a2dc-11e2-9b3d-20cf3057401c/uvc_camera-1*.log

more complete output:

..........

core service [/rosout] found Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading'="" from="" '="" usr="" lib="" python2.7="" threading.pyc'=""> ignored process[uvc_camera-1]: started with pid [3419] opening /dev/video0 pixfmt 0 = 'GRBG' desc = 'GRBG' discrete: 162x120:
discrete: 324x240:
int (Brightness, 0, id = 980900): 0 to 31 (1) int (Contrast, 0, id = 980901): 0 to 15 (1) int (Exposure, 0, id = 980911): 0 to 1023 (1) int (Gain, 0, id = 980913): 0 to 255 (1) [uvc_camera-1] process has died [pid 3419, exit code -11, cmd /home/siml/roswk/uvc_camera_pkg/uvc_camera/bin/camera_node __name:=uvc_camera __log:=/home/siml/.ros/log/0cee0b5a-a2dc-11e2-9b3d-20cf3057401c/uvc_camera-1.log]. log file: /home/siml/.ros/log/0cee0b5a-a2dc-11e2-9b3d-20cf3057401c/uvc_camera-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done

any ideas?

edit flag offensive delete link more
0

answered 2012-06-03 13:35:15 -0500

frog0705 gravatar image

maybe,some cameras don't support all the control settings,so you can comment out the settings code,it will work well.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-05-25 18:55:17 -0500

Seen: 1,336 times

Last updated: Apr 11 '13