Search code examples
javapythonc++pipelining

Pipelining or Otherwise Transferring Data Between Languages in Realtime


I'm working on a project, which I am not at liberty to discuss the core, but I have reached a stumbling block. I need data to be transferred from C++ to some other language, preferably Java or Python, in realtime (~10ms latency).

We have a sensor that HAS to be parsed in C++. We are planning on doing a data read/output through bluetooth, most likely Java or C# (I don't quite know C#, but it seems similar to Java). C++ will not fit the bill, since I do not feel advanced enough to use it for what we need. The sensor parsing is already finished. The data transferring will be happening on the same machine.

Here are the methods I've pondered:

  • We tried using MatLab with whatever the Mex stuff is (I don't do MatLab) to access functions from our C++ program, to retrieve the data as an array. Matlab will be too slow (we read somewhere that the TX/RX will be limited to 1-20 Hz.)
  • Writing the data to a text, or other equivalent raw data, file constantly, and opening it with the other language as necessary.

I attempted to look this up, but nothing of use showed in the results.


Solution

  • It seems like you are looking for a IPC (Inter-process communication). The easiest ones to implement are the socket and Pipes. I have added links which will help you decide which one to use. I have implemented named pipes and socket to transfer data at every 1ms. I did these implementations in python, c and pascal.

    Here is the descriptions of all the IPC types

    What's the difference between pipes and sockets