Dejan,<div><br></div><div>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?</div>
<div><br></div><div>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.</div>
<div><br></div><div>- Eric</div>
<div><br><div class="gmail_quote">On Mon, Aug 30, 2010 at 7:47 PM, Dejan Pangercic <span dir="ltr"><<a href="mailto:dejan.pangercic@gmail.com" target="_blank">dejan.pangercic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

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