Communication Speed via ROS

asked 2017-07-06 19:53:39 -0500

Lawrence Kay gravatar image

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?

edit retag flag offensive close merge delete

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 ..

gvdhoorn gravatar image gvdhoorn  ( 2017-07-07 01:47:10 -0500 )edit

.. 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, ..

gvdhoorn gravatar image gvdhoorn  ( 2017-07-07 01:49:15 -0500 )edit

.. 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 gravatar image gvdhoorn  ( 2017-07-07 01:52:00 -0500 )edit

@gvdhoorn Oh I didn't know that there is a version 2 on ROS. Maybe I should take a look at it. Thank you!

Lawrence Kay gravatar image Lawrence Kay  ( 2017-07-07 22:07:41 -0500 )edit

Even with ROS2, the comparison against raw sockets is not going to be fair.

gvdhoorn gravatar image gvdhoorn  ( 2017-07-08 05:08:42 -0500 )edit