[ros-users] Autofocus for Logitech QC Pro 9000
Eric Perko
wisesage5001 at gmail.com
Tue Aug 31 00:39:20 UTC 2010
Dejan,
That sounds about what I expected after I looked more closely at your gdb
info and saw the errors related to setting controls. It does seem a bit
weird that it isn't saving your guvcview settings though. Basically, the
trick was that we needed to not reopen the camera and only set controls we
were interested in in order to keep settings from guvcview around while the
driver is running. Perhaps it is no longer doing this or this was the plan
and hasn't happened yet?
In other news, it looks like the Logitech cameras (at least my Webcam Pro
9000, which is extremely similar to the Quickcam Pro 9000) don't support
setting Gamma and that is the cause of the failure. I added a number of
try/catch blocks to the node and it no longer crashes with my camera. Grab
the latest from github and see if it works for you.
- Eric
On Mon, Aug 30, 2010 at 7:47 PM, Dejan Pangercic
<dejan.pangercic at gmail.com>wrote:
> Hi Eric,
>
> after a bit of debugging I found the cause of my problem but not the
> remedy (yet).
> So the problem is that the calls to "cam_->set_control()" function in
> the "reconfig()" callback
> fail in a rather random fashion which leads to the exceptions being
> thrown and which prevents the following line to be
> executed:
> "config_ = newconfig; // save new parameters"
> Because of this cvCreateImageHeader got initialized with some bogus
> width and height values and thus also seg. faulted.
>
> For now I just commented all the calls to the above mentioned
> "set_control()" function and this way the driver seems to behave, that
> is outputs images. Though it for some reason does not preserve
> settings left from guvcview.
>
> cheers, D.
> On Mon, Aug 30, 2010 at 8:12 PM, Eric Perko <wisesage5001 at gmail.com>
> wrote:
> > Hi Dejan,
> > Not sure. We've not seen that before and it seems pretty weird that it
> would
> > be segfaulting in the creation of the OpenCV header unless config_.width
> or
> > config_.height are wrong.
> > What version of opencv is that building against? And what are the values
> for
> > config_.height and config_.width that are causing it to fail? I'm
> assuming
> > you can get those from gdb when it crashes?
> > - Eric
> >
> > On Mon, Aug 30, 2010 at 1:43 PM, Dejan Pangercic <
> dejan.pangercic at gmail.com>
> > wrote:
> >>
> >> Hi Eric,
> >>
> >> as always a really great hint and it would've worked out perfectly but
> >> I could not get the camera to run using the forked version of the
> >> driver (github.com/ericperko/uvc_cam).
> >> It segfaults in the line 178 of the uvc_cam/src/uvc_cam_node.cpp file
> >> while creating the image header:
> >> IplImage *imageIpl =
> >> cvCreateImageHeader(cvSize(config_.width,config_.height), 8, 3);
> >>
> >> See also my backtrace:
> >> http://pastie.org/1127043
> >>
> >> Any idea why this might happen?
> >>
> >> cheers,D.
> >>
> >> On Mon, Aug 30, 2010 at 10:27 AM, Eric Perko <wisesage5001 at gmail.com>
> >> wrote:
> >> > Dejan,
> >> > Did you take a look at the uvc_cam driver
> >> > (http://www.ros.org/browse/details.php?name=uvc_cam)? I don't
> remember
> >> > if it
> >> > or the fork my group was doing some work on
> >> > (github.com/ericperko/uvc_cam)
> >> > supports autofocus at the moment, but I do recall that adding features
> >> > to
> >> > the dynamic reconfigure settings was pretty easy if it works in
> >> > guvcview.
> >> > Since both use the same uvc driver interface, code that works in
> >> > guvcview
> >> > should be easily portable to the uvc_cam driver. I've CC'd my
> >> > collaborator
> >> > that has been using it regularly for a while and did most of the
> driver
> >> > side
> >> > stuff, so he may be able to give some more info if I'm totally wrong
> in
> >> > any
> >> > of this (It has been a while since I did any serious work on the
> >> > driver).
> >> > I'm pretty sure that, at the very least, if you save your settings
> with
> >> > guvcview and then do not change them with a uvc based camera driver on
> >> > startup, the cameras should maintain the settings from guvcview.
> >> > Also, I hadn't noticed that there are more options when guvcview is
> run
> >> > as
> >> > root vs. a regular user. We've been having some issues with parameters
> >> > acting weirdly on some cheap webcams that we have and perhaps running
> as
> >> > root may expose some more parameters that might allow us to solve the
> >> > weirdness. Luckily, better cameras such as the Logitech Webcam Pro
> 9000
> >> > haven't given us any trouble so far.
> >> > I can't really say for how easy it would be to add that feature to the
> >> > other
> >> > drivers compared to adding it to a uvc based driver. If you do hack on
> >> > this
> >> > based on our fork, patches are welcome :)
> >> > - Eric
> >> > On Mon, Aug 30, 2010 at 3:55 AM, Dejan Pangercic
> >> > <dejan.pangercic at gmail.com>
> >> > wrote:
> >> >>
> >> >> Dear ROS-istas,
> >> >>
> >> >> I got a Logitech QC Pro 9000 camera which came with an autofocus
> >> >> property and which I can set in e.g. guvcview (though only as su
> >> >> user). It is set to false by default and it would be nice to be able
> >> >> to enable it within any of the ROS drivers. I did not find this
> >> >> feature in any of the existing drivers I tried out (gscam,
> >> >> logitech_web_cam, logitech_usb_webcam, usb_cam).
> >> >> Said that, does anyone know which driver would be the simplest to
> >> >> bring this feature in?
> >> >>
> >> >> thx and cheers, D.
> >> >> --
> >> >> MSc. Dejan Pangercic
> >> >> PhD Student/Researcher
> >> >> Intelligent Autonomous Systems Group
> >> >> Technische Universität München
> >> >> Telephone: +49 (89) 289-26908
> >> >> E-Mail: dejan.pangercic at cs.tum.edu
> >> >> WWW: http://ias.cs.tum.edu/people/pangercic
> >> >> _______________________________________________
> >> >> ros-users mailing list
> >> >> ros-users at code.ros.org
> >> >> https://code.ros.org/mailman/listinfo/ros-users
> >> >
> >> >
> >> > _______________________________________________
> >> > ros-users mailing list
> >> > ros-users at code.ros.org
> >> > https://code.ros.org/mailman/listinfo/ros-users
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> MSc. Dejan Pangercic
> >> PhD Student/Researcher
> >> Intelligent Autonomous Systems Group
> >> Technische Universität München
> >> Telephone: +49 (89) 289-26908
> >> E-Mail: dejan.pangercic at cs.tum.edu
> >> WWW: http://ias.cs.tum.edu/people/pangercic
> >> _______________________________________________
> >> ros-users mailing list
> >> ros-users at code.ros.org
> >> https://code.ros.org/mailman/listinfo/ros-users
> >
> >
> > _______________________________________________
> > ros-users mailing list
> > ros-users at code.ros.org
> > https://code.ros.org/mailman/listinfo/ros-users
> >
> >
>
>
>
> --
> MSc. Dejan Pangercic
> PhD Student/Researcher
> Intelligent Autonomous Systems Group
> Technische Universität München
> Telephone: +49 (89) 289-26908
> E-Mail: dejan.pangercic at cs.tum.edu
> WWW: http://ias.cs.tum.edu/people/pangercic
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100830/0a568389/attachment-0003.html>
More information about the ros-users
mailing list