Hello,
I am currently encountering some issues with 3D data acquisition and hope to get your assistance. I am using Windows 10, Visual Studio 2019, and aravis-0.8.31, attempting to acquire data from a 3D camera (hik MV-DP3060-01P)(Chunk Data) with the following code.
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <arv.h>
/*
* 尝试获取 chunk data
*/
int main(int argc, char** argv)
{
ArvCamera* camera;
ArvBuffer* buffer;
ArvStream* stream;
ArvChunkParser* parser;
ArvDevice* device;
GError* error = NULL;
device = arv_open_device(NULL, &error);
if (ARV_IS_DEVICE(device)) {
printf("Found camera '%s'\n", arv_device_get_string_feature_value(device, "DeviceVersion", &error));
stream = arv_device_create_stream(device, NULL, NULL, &error);
gint64 payload_size = arv_device_get_integer_feature_value(device, "PayloadSize", &error);
arv_stream_push_buffer(stream, arv_buffer_new(payload_size, NULL));
arv_device_execute_command(device, "AcquisitionStart", &error);
buffer = arv_stream_timeout_pop_buffer(stream, 2000000);
if (ARV_IS_BUFFER(buffer)) {
/* Display some informations about the retrieved buffer */
printf("Acquired buffer -- Sucessful");
g_clear_object(&buffer);
}
else
{
printf("Acquired buffer -- Failed");
g_clear_object(&buffer);
}
/* Destroy the camera instance */
g_clear_object(&device);
}
if (error != NULL) {
/* An error happened, display the correspdonding message */
printf("Error: %s\n", error->message);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
It turned out that the buffer is always NULL. I used a packet capture tool and found that there is data from the 3D camera in the GVSP packets, but I am unable to access this data by aravis.
The result is shown in the image below.
At first, I thought the issue was with the code, so I tested it using a 2D camera. The 2D camera I used was hik(MV-CS060-10GC). In the manufacturer’s software (MVS), I enabled Chunk mode and added watermark information to switch the data to Chunk Data mode.
The result is shown in the image below.
It can be observed that when using the 2D camera, the same Chunk Data and the same code can successfully retrieve the buffer.
This has left me very confused. I am unsure whether the issue lies with my code for retrieving the buffer or if there are differences between the 3D camera and the 2D camera that I am not aware of.
I sincerely look forward to receiving your response.