connextpy flat data array writer

2 posts / 0 new
Last post
Offline
Last seen: 2 years 4 months ago
Joined: 09/19/2021
Posts: 9
connextpy flat data array writer

hi,

I'm currently using connextpy, and trying to publish a topic that contains both FLAT_DATA language binding and SHMEM_REF transfer mode.
Through RTI Admin Console, I can see that I can write into basic fields of this message ("id" field below), however for some reason, the data I write in the arrays ("attribute.distance" field below) are not showing up.

The IDL file looks like below:
 
@final
@language_binding(FLAT_DATA)
@transfer_mode(SHMEM_REF)
struct attribute
{
float distance[100]; // [m]
};
 
@final
@language_binding(FLAT_DATA)
@transfer_mode(SHMEM_REF)
struct myData
{
unsigned short id;
attribute my_attribute;
};
 
And here's the code snippet where I do the assignment:
 
out_sample["id"] = 23
out_sample["my_attribute.distance"][0:100] = np.ones((100)),dtype=np.float32)
writer.write(out_sample)
 

Am I missing an obvious step here?
Thanks
 
 

 

Offline
Last seen: 2 years 4 months ago
Joined: 09/19/2021
Posts: 9

I would like to add that, making the sample assignment the following way works, 

out_sample["my_attribute.distance[0]"] = 1.0