How to set a Chunk Selector node?

Dear all,

I’m trying to interface a Mechmind Nano 3d camera over genicam using aravis 0.8.30.

As documented here and looking at their Halcon-Genicam examples, in order to convert the received “Coord3d_ABC16” data to a pointcloud in metric [mm] one needs to get the buffers offset and scale values for all axis “ABC”.

This should be done by using “ChunkScan3dCoordinateSelector” together with querying “ChunkScan3dCoordinateScale”. I’m aware of the aravis chunk parser example 05-chunk-parser.c, but unsure how set the selector. I use a snippet like this to retrieve the data, but I get the exact same values for all scales/offsets for “Coordinate[A,B,C]”:

::std::pair<double, double> get_scale_and_offset(ArvCamera* camera, ArvChunkParser *parser, ArvBuffer *buffer, const char *coordinate){
    GError *error = NULL;
    arv_camera_set_string(camera, "ChunkScan3dCoordinateSelector", coordinate, &error);
    throw_on_error(error);
    auto scale = arv_chunk_parser_get_float_value(parser, buffer, "ChunkScan3dCoordinateScale", &error);
    throw_on_error(error);
    auto offset = arv_chunk_parser_get_float_value(parser, buffer, "ChunkScan3dCoordinateOffset", &error);
    throw_on_error(error);
    return ::std::make_pair(scale, offset);
}

An excerpt from arv-tool features output:

Category    : 'ChunkDataControl'
    Enumeration  : [RW] 'ChunkComponentSelector'
        EnumEntry   : 'Texture'
        EnumEntry   : 'Normal'
        EnumEntry   : 'Range'
    Boolean      : [RO] 'ChunkEnable'
    Boolean      : [RO] 'ChunkModeActive'
    Float        : [RO] 'ChunkScan3dCoordinateOffset'
    Float        : [RO] 'ChunkScan3dCoordinateScale'
    Enumeration  : [RW] 'ChunkScan3dCoordinateSelector'
        EnumEntry   : 'CoordinateC'
        EnumEntry   : 'CoordinateB'
        EnumEntry   : 'CoordinateA'

“ArvChunkParser” atm does not provide any setters, and my intuition says setting the selector using “arv_camera_set_string” might have no effect.

I’d be glad for some pointers in the right direction.

I am using VRmagic line scanners with Aravis, there is no need for chunk parser (I’ve never used it, so I might be wrong). I guess something like this would work (error handling omited):

ArvDevice* dev=arv_camera_get_device(cam);
// the usual setup for 3d data
arv_device_set_string_feature_value(dev,"DeviceScanType","Areascan3D",&err);
arv_device_set_string_feature_value(dev,"PixelFormat","Coord3D_C16",&err);
// select which offset and scale you want to read
arv_device_set_string_feature_value(dev,"ChunkScan3dCoordinateSelector","CoordinateA",&err);
// read the nodes, the value will change depending on the selector just set
float offsetA=arv_device_get_float_feature_value(dev,"ChunkScan3dCoordinateOffset",&err);
float scaleA=arv_device_get_float_feature_value(dev,"ChunkScan3dCoordinateScale",&err)

Hi,

It is possibly something not supported by aravis. Please open an issue on github, and attach there the genicam data of your camera.

Emmanuel.

I created a ticket and attached the arv-tool output there: chunk parser, setting of chunk selector nodes · Issue #911 · AravisProject/aravis · GitHub. I needed to switch to integrating with their SDK, but will follow-up on the git issue with more details, also double checking eudoxos suggestion.