anqixu / ueye_cam

A ROS nodelet and node that wraps the driver API for UEye cameras by IDS Imaging Development Systems GMBH.
Other
60 stars 102 forks source link

Check if camera supports sensor scaling before trying to set it #89

Open nullket opened 3 years ago

nullket commented 3 years ago

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.

jmackay2 commented 3 years ago

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.

nullket commented 3 years ago

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?