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

Negative flash delay not possible to set #39

Open rbrth opened 8 years ago

rbrth commented 8 years ago

I am trying to set the flash delay to a negative value. According to the documentation this should be possible from -1000000us to 1000000us

However, in the RQT GUI setting negative values is not possible.

Best, Ruud

anqixu commented 8 years ago

According to the cfg code, flash_delay should be able to accept negative values.

Here's 2 caveats from the actual source code: 1 - when setting to free-run mode, the flash delay/duration are hard-coded to 0/1000, to facilitate default compatibility with externally triggered slave cameras. Let me know if this is the cause of your issue, in which case we can find a better solution.

2 - when setting flash parameters, the requested delay/duration values are first saturated within the camera's min/max values. If your camera does not support negative flash delay, then rqt_reconfigure will automatically update to the capped value (=0).

rbrth commented 8 years ago

Thank you for the quick reply! :)

1 - We do not run the camera in free-run mode. It is software triggered.

2 - Our camera ( https://en.ids-imaging.com/store/ui-5250re-poe.html ) should support negative flash delay. We have tested this under the IDS camera manager under Windows.

What do you mean with "the requested delay/duration values are first saturated within the camera's min/max values." ?

Thanks! Ruud

anqixu commented 8 years ago

Before setting a user-requested flash delay value, the code first retrieves the camera's minimum and maximum delay values, and then checks+updates the requested delay value to be within the min-max range.

rbrth commented 8 years ago

Clear. Thanks.

I will double check if our camera supports negative flash delay and what the minimum and maximum delay values are.

rbrth commented 8 years ago

My colleague updated me on your first point:

1- when setting to free-run mode, the flash delay/duration are hard-coded to 0/1000, to facilitate default compatibility with externally triggered slave cameras. Let me know if this is the cause of your issue, in which case we can find a better solution.

We are running the camera in free-run mode! :-)

anqixu commented 8 years ago

In that case, the solution might be as easy as commenting out this line. Essentially, instead of manually forcing the flash parameters to hard-coded values each time entering free-run, we hope that the user chose sensible values, or used default dyncfg values of delay=0 and duration=1000.

If commenting out that one line causes other issues, then you might have to comment out that whole block, meant to generate a pulse signal on flash output pin.

Please test this fix out thoroughly, as I unfortunately don't have the cycles to address this till at least next week. Let me know if/which fix works, so I can make the change permanent.

rbrth commented 8 years ago

Thank you for the help.

I commented out the line, recompiled it with catkin_make and changed the flash parameter to a negative value.

However, when running and checking rostopic echo /ueye_gripper_cam_nodelet/parameter_updates , the flash_delay is set to 1.

I will further look into the code next week to see if I can force the delay in there somewhere :-)

Best, Ruud