- This topic has 3 replies, 3 voices, and was last updated 3 years, 2 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SoftRobots › Programming with SoftRobots › [SOLVED] CommunicationController data exchange format
Tagged: #communicationcontroller, Linux_ubuntu, SOFA_2106, softrobots
Hello everyone,
I am trying to integrate CommunicationController from SoftRobots in simulation. I can send and receive values from one simulation to another simulation.
I wanted to exchange position data from sender to receiver so if an object moves in sender side, the same object could simulate (move) in receiver side. The position data is in vector type but the data is always exchanged in double data type (single value). Is there any way so the simulation could exchange data in vector format and act accordingly.
Thanks
Hi @arsalan
Sorry I never did such a communication setup. However, regarding the data format maybe @damien-marchaluniv-lille1-fr would be able to provide more insight than I do..
Damien any idea?
Best
Hugo
I never used CommunicationController so I looked a bit in its c++ source code.
It seems is possible to communication more data by specify the *template* attribute.
`
node.addObject(‘CommunicationController’, name=”sub”, listening=’1′, job=”receiver”, port=”5558″, nbDataField=”4″, pattern=”0″, template=’Vec3d’)
`
That’s said, I see the convention for this template is just inconsistant with what are using in sofa.
Currently it is mapping the following templates to theses data types:
`
double -> double
float -> float
int -> int
Vec3d -> vector<Vec3d>
Vec3f -> vector<Vec3f>
`
While it should be:
`
double -> double
float -> float
int -> int
vector<double> -> vector<double>
vector<float> -> vector<float>
vector<int> -> vector<int>
Vec3d -> Vec3d
Vec3f -> Vec3f
vector<Vec3d> -> vector<Vec3d>
vector<Vec3f> -> vector<Vec3f>
`
Hello @damien-marchaluniv-lille1-fr
I am really very thankful to you 🙂 It works now as expected.
Thanks again and best regards,
Arsalan
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.