robohouse-delft / aravis-rs

Rust bindings for Aravis, a vision library for genicam based cameras
Other
14 stars 5 forks source link

Failed to set trigger source to software: AcquisitionFrameRateEnable #13

Closed osiler closed 1 year ago

osiler commented 1 year ago

Hi,

Thanks for this set of crates, I have been working with your examples in the aravis-utils directory but am unable to run a test capture.

aravis-capture -c 10 --save test_images/ X.X.X.X
Connecting to camera X.X.X.X
Connected.
** (process:XXXX): CRITICAL **: 12:06:07.509: arv_gc_feature_node_is_available: assertion 'error == NULL || *error == NULL' failed
Error: Failed to set trigger source to software: [AcquisitionFrameRateEnable] [RegAcquisitionFrameRateEnable] GigEVision write_memory error (write-protect).

This feature is available on the camera, however I think it might be related to this, with patches for specific cameras here.

I am new to the FFI - C interopt world so i am unsure how could I use the binding in aravis-sys to accomplish a similar bit of logic as seen in the arivis function for specific camera quirks? In addition I was unable to find a wrapper for the arv_camera_set_frame_rate_enable, which I could potentially call prior to setting other camera features which may negate the error.

EDIT: Apologies, the patch is only two weeks old in main so unlikely to be in your 0.8.22 FFI binding is there a help file / readme that can point me in the direction of bumping this crate to a dev branch and trying out the patch in main?

hgaiser commented 1 year ago

My colleague worked on this mostly, but he's on sabbatical at the moment so he won't be able to help ;). I can maybe help, but my knowledge about this crate is limited. I know that the procedure of updating the bindings is convoluted, and that there's no documentation as of yet unfortunately. The best I can do is direct you to this book.

However I'm not sure that will solve your problem. It seems that Aravis is setting AcquisitionFrameRateEnable, which is a write-protected setting in your case. Can you try a similar example with Aravis directly? I'd be surprised if you don't get an error there (make sure it is calling arv_camera_set_trigger).

osiler commented 1 year ago

Great thanks for the links. Yes from first pass it looks like it is write protected however the documentation specified that the value has read, write access. The other aspect that may be causing this issue is a parent / child relationship that is enforcing the read write access, like exposure. I will try with the aravis API and see how I go.

In terms of the gir documentation what would be the best way to start given that your colleague is on sabbatical, it would be great to get to a point where this set of crates can track aravis in a dev branch.

hgaiser commented 1 year ago

Great thanks for the links. Yes from first pass it looks like it is write protected however the documentation specified that the value has read, write access. The other aspect that may be causing this issue is a parent / child relationship that is enforcing the read write access, like exposure. I will try with the aravis API and see how I go.

Is it possible the documentation is wrong? Using Aravis directly is the best way to verify if the problem is resolved upstream. If it works on the main branch, please also try it on 0.8.22 as that is what we created the bindings for.

In terms of the gir documentation what would be the best way to start given that your colleague is on sabbatical, it would be great to get to a point where this set of crates can track aravis in a dev branch.

You mean in a way that this crate automatically builds the bindings for upstream aravis? I believe there was quite some manual labor involved, as the generated bindings had some flaws. I don't know the details for this I'm afraid..

osiler commented 1 year ago

As highlighted in post write permission errors can be encountered for some manufacturers. I had to include the device reset commands in the camera initialisation in the capture example.