Hi Patrick,

Thanks for the thorough tests. Some replies inline.

On Sun, Dec 19, 2010 at 12:18 PM, Patrick Goebel <patrick@casbs.stanford.edu> wrote:
Hi Ken and Eric,

I've been doing some more testing and this is what I have found.

First, my camera is a Logitech Quickcam Pro 9000 according to lsusb.

Regarding uvc_camera, I uninstalled the entire umd-ros-pkg and reinstall it and this time I *do* get control of frame resolution and frame rate in my launch file when using uvc_camera.  So false alarm on that one!

Turning now to Eric's uvc_cam and dynamic_reconfigure.  The guvcview utility is very nice and indicates that I should have the following valid setting values for the Logitech camera:

Brightness: 0-255 (which goes from completely dark to completely washed out)

Contrast: 0-255 (also works as expected across the range).

Saturation: 0-255 (also works--black and white at 0 and false-color like at 255; normal seems to be about 38)

White Balance Temperature Auto checkbox: seems to have no effect

Gain: 0-255 (works as expected)

Sharpness: 0-255 (works as expected)

Backlight Compensation: 0, 1, 2 (has no effect)

Exposure, Auto pull down:
       Manual Mode: (Exposure absolute slider): 0-10000 (0 is highest exposure, 10000 is lowest, possibly inverse of shutter speed)
       Auto Mode: works the same as Manual Mode with slider control
       Shutter Priority Mode: works the same as Manual Mode with slider control
       Aperture Priority Mode: works truly as an auto exposure with the slider bar locked.

Were there any errors in the terminal you started guvcview from when changing to auto or shutter priority? They definitely shouldn't work the same as manual mode. If I recall correctly, when guvcview fails to set a control to a certain value, the webcam keeps the previous setting. You may have just been still in manual mode if there were errors setting the control.
 

Exposure, Auto Priority checkbox: Turns Aperture Priority Mode on or off.

Next I launched the uvc_cam node using the following launch file:

<launch>
   <node name="uvc_cam_node" pkg="uvc_cam" type="uvc_cam_node" output="screen">
       <param name="device" value="/dev/video3" />
       <param name="exposure" type="int" value="0" />
       <param name="absolute_exposure" type="int" value="20" />
       <param name="brightness" value="128" />
       <param name="saturation" value="38" />
       <param name="contrast" value="32" />
       <param name="gain" value="100" />
       <param name="sharpness" value="100" />  
   </node>
</launch>

Even thought the initial output complains about a lot of the settings, they seem to be getting set anyway when I try different values and relaunch the node.

I've not debugged it, but often on the first launch, it will throw errors about failing to set most all of the controls. If I then close and relaunch, it should only fail to set one of them... "gamma" perhaps... since the Webcam 9000 I use doesn't support that control.
 
 Very often though, when relaunching the node, I get the error: 

[ WARN] [1292778385.643706002]: Reconfigure callback failed with exception couldn't set format:

And I have to unplug the camera and plug it in again to get past it and unfreeze the image in image_view.  This is the same warning and freezing issue I have when trying to set a different resolution in dynamic_reconfigure even though I am setting one of the supported resolutions.

Hrm... that's odd... I don't usually see that as long as the default format is correct (it should default to MODE_RGB). I'll have to look into this one as well.
 

Finally, in case it isn't obvious to others interested in this thread, the "exposure" settings in the launch file above or in dynamic_reconfigure for this Logitech camera are:

0, 1 or 2 gives you "manual exposure" and then you can set the absolute exposure and/or gain values

3 means auto exposure and the absolute exposure and gain settings have no effect.

Finally, the slider controls in dynamic_reconfigure have a rather huge range when connecting to uvc_cam_node, namely -2147483648 to 2147483648.  Not sure if this is intentional.

It is intentional right now, as I don't have any idea what the valid ranges for the different controls actually are. They also seem to vary from camera model to camera model when I load things up in guvcview. The best case would be some sort of way for a node using a dynamic reconfigure to set whether a control is supported and it's ranges dynamically at runtime.

Again, thanks for the report. This will definitely be useful info to keep in mind while working towards "the one, true USB camera ROS driver" :)

- Eric
 

--patrick


On 12/18/2010 08:19 PM, Eric Perko wrote:
On Sat, Dec 18, 2010 at 10:53 PM, Patrick Goebel
<patrick@casbs.stanford.edu <mailto:patrick@casbs.stanford.edu>> wrote:

   Thanks Eric--this is great!  Using dynamic_reconfigure with the
   Logitech 9000, I see the expected effect with all parameters except
   exposure which generates the error:

   setting control 9a0901
   current value of 9a0901 is 3

   unable to set control
   : Input/output error
   [ERROR] [1292729915.173487152]: Problem setting exposure. Exception
   was unable to set control


What value did you attempt to set? Not all values that are possible for
controls such as automatic exposure are actually valid for all cameras.
Currently, there is no way for a driver to tell dynamic_reconfigure
which values are valid or not (at least not that I know of). You can
check the guvcview tool (install it with apt-get) to see if a value
should or should not be supported. Better behavior when somebody tries
to set a control that isn't supported is on the todo list, but, since
the driver works "good enough" for what we've been using it for, it
hasn't really been high on the list of things to do.


   but setting absolute exposure works fine so no problem there.  The
   one glitch I ran into was in setting the width and/or height in
   dynamic_reconfigure; because you can only set one at a time, as soon
   as one is set, uvc_cam warns:

   [ WARN] [1292730153.471431256]: Reconfigure callback failed with
   exception pixel format unavailable:

   and then image_view freezes.  If you then continue to set the other
   dimension in dynamic_reconfigure, it does not unfreeze the image.
   Restarting the uvc_cam node *does* unfreeze image_view and picks up
   the new resolution, as long as you don't have width and height hard
   coded in the launch file.


Really? Hmm... that's a bit odd, because all of the settings (including
height/width) should be causing the driver to close and reopen the
camera. I'm surprised it just completely crashes (unless the camera
itself is crashing, which I have seen a few times before). I guess this
could be fixed by moving from selecting individual width/heights to
something closer to what camera1394 does and just giving you a
"video_mode" setting that has valid pairs of width and height.


   Will test more tomorrow.


Thanks for reporting these issues. Let me know if you have any other
issues (and what specific settings you tried to generate the above and
any further errors) and I'll see about figuring out why they happen.
Also, a little specifics, is that a Webcam 9000 or Quickcam 9000? They
are pretty similar, but might have slight differences if we don't have
the same model.

- Eric


   --patrick



------------------------------------------------------------------------
If this email is spam, report it to www.OnlyMyEmail.com
<https://support.onlymyemail.com/view/report_spam/NDE2OTM6MTIwMzEyNTUzNjpwYXRyaWNrQGNhc2JzLnN0YW5mb3JkLmVkdTpkZWxpdmVyZWQ>