ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Sending data to a single TCP connection from different nodes

asked 2015-06-23 07:45:00 -0500

francoisdtf gravatar image

updated 2015-06-23 09:12:52 -0500


So I have this DAQ card called Labjack link , that I used as an interface to real world for a whole system. It will then take measurements from different sets of sensors, output commands or analog voltages, etc...

And, in an endeavor to maintain a modular software architecture, I would have liked to have several nodes, each managing a specific "low-level" functionality (because yes, it's not that low since it has to go through the daq first). For example, one node would retrieve data from my distance sensor and publish it to a topic, another node would receive speed commands from a subscribed topic and output them on Labjack.

The problem is, the daq card is connected to my PC via ethernet, and having multiple nodes able to send commands over this single connection could easily imply packet interference if two nodes try to use it at the same time.

So my question is, what would be the best way to deal with that? I considered several options, but I'm still unsure of which would be the best, or if there is a better solution I didn't think of.

  • I could have another node providing specific services corresponding to the different labjack's commands I want to use, so all the communication would be kept in a single process and processed one at a time, the other nodes would then have to call this services to send commands. But this will lose a bit of the modular architecture I wanted.

  • I could also have a shared memory space with a semaphore, containing the TCP socket, so each node would have to wait for the other to finnish their tcp communication before beginning a new one. But I fear this would be too complicated compared to the performance improvement it would bring.

  • Similarly, I read about nodelet, so I thought about having all the "low-level" functionnality in a single nodelet, so they could share memory, but this time only between threads. But it might be needlessly complicated too.

If anyone has comments/suggestions about this issue they would all be welcome :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-23 12:55:51 -0500

duck-development gravatar image

I recommend you to take the First Type of Problem solver und programm an low level Proxy. witch
sherdmemory is not the fun to deal with.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-06-23 07:45:00 -0500

Seen: 292 times

Last updated: Jun 23 '15