Using Vectorizer with blocks that output Custom Structs

We’re trying to connect outputs from multiple C++ blocks (“block1”) into a vector that a separate block (“Final”) takes as input.

Block1 outputs a vector of the custom struct, and the Final block takes a vector of the custom struct as inputs, so connecting them normally works just fine.

However, when we take multiple Block1 and connect their outputs to a Vectorizer, the Final block rejects the Vectorizer.

Is there a flaw in how we are setting up these blocks when using the Vectorizer?

My initial guess is that the Vectorizer is adding another “vector tag” to the structure (making it a vector of vectors), and so B rejects it due to that. But if that is the case, how can we make this setup work?

The top input of your Final block seems to be able to accept the data vectorizer output. What is the difference between the two Final block input filters? Can you post a screenshot of those inports’ type filters?

The top input is the old version, taking RealObjects as inputs


The bottom one is the new input


Here’s the output of Block1


My suggestion would be to use the MAPS::FilterStructure filter for your MAPS_INPUT macro in your Final block. This will accept any user structures as input.

It is important to know that these type filters are regex string filters on the name of the type and don’t filter based on anything contained in the data structure. They are meant to prevent users of the diagram from giving data to inputs which cannot handle that data type.

Your current filter only accepts input of Type Name SensorMeasurement type which the data vectorizer outputs in data but not in name. So the FilterStructure filter will be more flexible for you.

Thank you very much! That resolved the issue

1 Like