AravisProject / aravis

A vision library for genicam based cameras
GNU Lesser General Public License v2.1
892 stars 331 forks source link

Receive images continuously using ArvStream in software trigger mode #628

Closed GJChen919 closed 2 years ago

GJChen919 commented 2 years ago

Describe the bug Receive images continuously using ArvStream in software trigger mode

To Reproduce I receives images with ArvStream based on the sample code - arvexample.c and I try to change the trigger source - software in the below codes:

arv_device_set_string_feature_value(dev, "AcquisitionMode", "Continuous", nullptr);
arv_device_set_string_feature_value(dev, "TriggerSelector", "AcquisitionStart", nullptr);
arv_device_set_string_feature_value(dev, "TriggerMode", "Off", nullptr);
arv_device_set_string_feature_value(dev, "TriggerSelector", "FrameStart", nullptr);
arv_device_set_string_feature_value(dev, "TriggerSource", "Software", nullptr);
arv_device_set_string_feature_value(dev, "TriggerActivation", "RisingEdge", nullptr);
arv_device_set_string_feature_value(dev, "TriggerMode", "On", nullptr);
std::cout << arv_device_get_string_feature_value(dev, "TriggerSelector", nullptr) << std::endl;
std::cout << arv_device_get_string_feature_value(dev, "TriggerSource", nullptr) << std::endl;
std::cout << arv_device_get_string_feature_value(dev, "TriggerMode", nullptr) << std::endl;
arv_camera_set_frame_rate(camera, 4.0, NULL);

The output of features are fine, but I still receives many images after AcquisitionStart with no other operation.

Expected behavior Unless I call arv_camera_software_trigger or arv_device_execute_command(TriggerSoftware), it shouldn't comes any image generally.

Camera description:

Platform description:

Additional context My code is main_isu.zip in the attatched

EmmanuelP commented 2 years ago

Hi,

...
arv_camera_set_frame_rate(camera, 4.0, NULL);

This function actually changes the trigger settings, and makes the camera emit 4 images per second. You should remove this call if you want to trigger the image acquisition using arv_camera_software_trigger().

Cheers.

GJChen919 commented 2 years ago

@EmmanuelP Very thanks, it solved.