I came up with an idea to establish connection between my Raspberry Pi 4 and Windows host machine. I did it successfully by utilizing MQTT protocol, but got interested in Data Distribution Service concept (DDS). My Pi needs to send captured images (publish) to windows machine (subscriber) as byte array. How to do this easily for prototyping and testing purposes? I don't have a problem with doing this on same machine, but cannot wrap my head around connectivity between nodes on same LAN network, I know for sure that DDS supports TCP and UDP. Is there just an config file where I have to put IP addresses of second machine for both applications and that's it? I want to use RTI Connector for Python, can it work on its own for both devices that communicate? Sorry for lame question, but I just want to test DDS utility as fast as possible. Can anyone point me to some sources that would help solve my case? I've seen some articles, but none were clear to me.
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jan 14 '22 at 17:40
2 Answers
Most of the answers that you're looking for can be found on community.rti.com.
But fundamentally, you should be able to run DDS between your Raspberry Pi and Windows box easily...and the helloworld should run with no configuration required (Connext DDS uses multicast for discovery by default)...as long as you have disabled the firewalls on your Linux (assuming you're running Linux on the Raspberry Pi) and on Windows (usually not needed if the network type is configured to be private).
If you want to use Python as the programming language you can either use the new Python API for RTI Connext DDS,
or as you mentioned, RTI Connector for Python (although this will be deprecated since RTI has released the Python API).
Examples are provided in the distributions of both the Python API for Connext as well as RTI Connector (with documentation).
You will need to understand a bit about DDS to modify the examples to use your own data type. Basically it means defining your data type in IDL and then using rtiddsgen to generate the XML definition of the datatype from IDL...or you can directly create your datatype definition in XML.
[I tried to add a bunch of links to the documentation, examples, etc., on github/rti.com/community.rti.com, but it got flagged as SPAM]

- 21
- 1
-
Thank you for your response, I managed to establish communication between those two devices without need of using discovery peers (coding ip addresses of the machines by hand), as doc said that networks with multicast over UDP will handle that by its own. Could you help me with sending image over DDS from one machine to another using RTI Connector for Python? In MQTT I sended it as bytearray, but in DDS I cannot find coresponding datatype. I just want to send basic jpg file as bytearray. I want to declare it straightforward in xml, because I cannot make rti ddsgen to work for me. – Jqb Frnzs Jan 17 '22 at 18:09
If your datatype is a fixed size array, then you should use the IDL fundamental datatype of octet[]. If it's variable sized, then you need to use sequence, either
struct MyImageType {
octet imageFrame[1048576];
};
or
struct MyImageType {
sequence<octet, 1048576> imageFrame;
};
using the above in an IDL file and then using rtiddsgen will be easier than typing the equivalent XML definition into a file.

- 21
- 1