Robotics StackExchange | Archived questions

camera_umd "unable to set control: Invalid argument"

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, VIDIOCSCTRL, &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

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

uvccam.cpp:

void Cam::setcontrol(uint32t id, int val)

{

v4l2control c;

c.id = id;

if (ioctl(fd, VIDIOCGCTRL, &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, VIDIOCSCTRL, &c) < 0)

{

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

printf("ioctl() return %d\n",ioctl(fd, VIDIOCSCTRL, &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!!!!!

Asked by frog0705 on 2012-05-25 18:55:17 UTC

Comments

Answers

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

Asked by frog0705 on 2012-06-03 13:35:15 UTC

Comments

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 ignored process[uvc_camera-1]: started with pid [3419] [ INFO] [1365710067.498552059]: camera calibration URL: file:///home/siml/roswk/sandbox/camtobot/usbcam.yaml 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?

Asked by leothelion on 2013-04-11 10:06:22 UTC

Comments