Communication Speed via ROS
Hello everyone.
I'm working with multiple terminals to communicate each other. Our goal is to have them communicate as fast as possible, so that they can work in cooperative manner.
So I'm wondering whether ROS would be fast & reliable enough to accomplish it, or I could accomplish faster & more reliable communication using bare socket programming in cpp.
So far, I have written a simple program (with roscpp) to check a round trip time between two ROS nodes (each of them has publisher & subscriber object, are on separate machine, and are connected wirelessly in a local network). I saw that the round trip could be done in 1ms, but the average round trip time was about 50ms (which means, sometimes the round trip time skyrocketed than usual)
Is there anyone experienced communication speed & reliability between ROS (roscpp) and cpp socket programming?
Asked by Lawrence Kay on 2017-07-06 19:53:39 UTC
Comments
I think comparing ROS and "bare socket programming" is rather unfair: the former adds layers of abstraction (location agnosticity, type checking, runtime rewiring, discovery, etc), semantics and convenience, while the latter is basically a pipe for raw bytes between two, a priori known ..
Asked by gvdhoorn on 2017-07-07 01:47:10 UTC
.. participants with none of that. Obviously performance is important, but any infrastructure with this amount of added functionality will incur some overhead.
In general I think if you're looking for guaranteed delivery times and kHz sampling periods, ROS1 is not for you.
In that case, ..
Asked by gvdhoorn on 2017-07-07 01:49:15 UTC
.. I suggest you look at ROS2. The design has been approached with such use-cases in mind and should be much more amenable to them.
Having said that: highly performant applications can be created in ROS1, even with real-time parts in them.
Asked by gvdhoorn on 2017-07-07 01:52:00 UTC
@gvdhoorn Oh I didn't know that there is a version 2 on ROS. Maybe I should take a look at it. Thank you!
Asked by Lawrence Kay on 2017-07-07 22:07:41 UTC
Even with ROS2, the comparison against raw sockets is not going to be fair.
Asked by gvdhoorn on 2017-07-08 05:08:42 UTC