magazino / pylon_camera

ROS-Driver for Basler Cameras
BSD 3-Clause "New" or "Revised" License
78 stars 108 forks source link

fix gamma handling for GigE cameras #9

Closed beetleskin closed 7 years ago

beetleskin commented 7 years ago

When connecting to a GigE camera (e.g. aca1920-50gc), the node crashes with "Error while accessing Gamma in PylonCameraImpl": For some camera types, the Gamma settings might not be available to the interface on startup, as they are handled automatically by the camera itself (Auto Gamma). This was already partly handled for some gamma-related function calls, but not for all of them. This fix adds the missing checks. The behaviour is slightly changed: If the gamma is not set via user, gamma remains in auto mode (i.e. controlled by the camera). Once the user tries to set a gamma value, the gamma mode switches to user.

beetleskin commented 7 years ago

@mgrrx fixed style and squashed it to the commit.

marc-up commented 7 years ago

@beetleskin I reviewed your PR, made some adaptions and merged it. Could you please try this out with your GigE color camera and provide me feedback if this solution worked for your case?

beetleskin commented 7 years ago

@marceldebout Works like a charm, thanks a lot for the quick merge!