ueye_cam icon indicating copy to clipboard operation
ueye_cam copied to clipboard

Check if camera supports sensor scaling before trying to set it

Open nullket opened this issue 4 years ago • 2 comments

Not all cameras support sensor scaling. This results in warnings as the driver fails to set the sensor scaling. I have added a simple check that figures out if the camera supports sensor scaling and only if so tries to set the value according to the parameter.

nullket avatar Oct 07 '20 05:10 nullket

I am a little hesitant on this one. If the camera doesn't support sensor scaling, it may be nice to have the error message that the sensor scaling wasn't able to be set. I think the error message could be helpful.

jmackay2 avatar Dec 22 '20 19:12 jmackay2

True. No I do not like my solution anymore either. But I also want to solve the issue that I get "warnings" whenever I launch the driver with my camera - even the setting is not specified in the launch file.

The issue is that scaling is also a ros parameter and those are getting parsed (what is okay) and set for all parameters (not okay) in parseROSParams(), which is called during the init connection process with the camera. In parseROSParams() the functions to set the parameters on the hardware are called as soon as one parameter is new (the whole hasNewParams thing.). So setSensorScaling() in L560 will be called even if it has not changed or was reconfigured.

One could create a whole construct of "has this particular parameter changed?" . If yes call the function to transfer the value to the hardware. This would blew up the code even further. Maybe some refactoring would help a lot with this issue. But this will be quite a lot of work to get rid of a warning which is not always true. Do you have another idea?

nullket avatar Dec 23 '20 15:12 nullket