Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connextpy flat data array writer #44

Open
goksanisil23 opened this issue Mar 2, 2022 · 0 comments
Open

connextpy flat data array writer #44

goksanisil23 opened this issue Mar 2, 2022 · 0 comments

Comments

@goksanisil23
Copy link

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)

Additionally, making the sample assignment the following way works,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant