Add attributes to sl.ObjectData

Hello,
I have a need to add an attribute to the sl.ObjectData class. Apparently the ability to add attributes is blocked (or I am doing something wrong).

In what way could I solve it?

SDK version 4.0.8

Thanks

Hi @icemanXVI ,
ObjectData is a structure defined by the ZED SDK and cannot be modified unless you include it in another structure where you add your attribute.

Can you show me the code you are using to add the attribute?

I don’t have a complete code yet but my intention is to color the bounding box of objects that are close to each other.

Therefore, I would like to calculate the position of each object and then calculate the distance of each object with the others. if the distance is small enough, I would like to color the bounding box green

The ZED SDK API allows you to write code that performs this task without modifying the existing data structures.
You must create your code and implement this feature.

My idea was to calculate the distances between objects and, if close enough, set a flag that I would then use to treat only certain objects differently.

It seemed to me to be the most efficient solution, but if it is not possible to add attributes I can live with that :sweat_smile:

Thank you very much for the quick response :blush: