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?
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 ..
.. 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, ..
.. 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.
@gvdhoorn Oh I didn't know that there is a version 2 on ROS. Maybe I should take a look at it. Thank you!
Even with ROS2, the comparison against raw sockets is not going to be fair.