ATC5 with GenTL

Hello,

I am trying to integrate an ATC5 camera under GenTL (third cvb acq. stack) un C++ on windows.

I have enable CHUNKs on the camera to get timestamps and encoder values.

The problem after “std::tie(composite, waitStatus, enumerator) = this->m_datastream->WaitFor(TIMEOUT);” use.

My image type is Cvb::CompositePurpose::Custom !

How can I get the image pointer?

After I guess I will get chunks like I did it with VIN (atfer image buffer).

Thanks in advance,

Mikael.

Hello @Mikael
as far as I recall, C5 delivers multipart data. so you can access each of the parts with the following approach:

using namespace Cvb;
 
CompositePtr composite;
WaitStatus status;
NodeMapEnumerator nodeMaps;
std::tie(composite, status, nodeMaps) = stream->Wait();
 
for (int i = 0; i < composite->ItemCount(); i++)
{
  auto component = composite->ItemAt(i);
  if (auto image = get_if<ImagePtr>(&component))
  {      
    // Process image
  }
  else if (auto pointCloud = get_if<PointCloudPtr>(&component))
  {      
    // Process point cloud
  }
}

or, you iterate through the parts if you know what they are:

using namespace Cvb;
 
CompositePtr composite;
WaitStatus status;
NodeMapEnumerator nodeMaps;
std::tie(composite, status, nodeMaps) = stream->Wait();
 
auto part = composite->ItemAt(0);
if (auto image = get_if<ImagePtr>(&part ))
{
      // go on
}

if you started the device with AccessToken property “AttachChunk”, and did nothing else, (e.g. no manual set of ChunkModeActive node), the chunks are attached to the Device nodemap. There you find valid values for your current buffer.

Hello @so-woe,

Thanks for your answer.

If chuncks are disabled in the camera, the composite purpose is “CompositePurpose::Image”. There is one composite count.

if chunks are enabled in the camera, the composite purpose is “CompositePurpose::Custom”. There is one composite count. And I cannot get an image:

auto element = composite->ItemAt(indexComposite);
auto image = Cvb::get_if<Cvb::ImagePtr>(&element);  -> null

I don’t know what to do with composiye “Custom”. Maybe ATC5 + chunks it is not compatible with GenTL.

Hello @Mikael ,
No worries: ‘Custom’ just means: not a single Image, not an ImageCube, not an Image List, not a composed MultiAoi image, not a rangemap, and not a pointcloud. This is true, as the buffer contains an image and a chunk.

AT and chunk should be possible. Although, there are CVB versions which needed a fix. What version do you use?

Could you write to this email with your exact CVB version, AT C5 version, your program, a log and your device nodemap settings.