Robotics StackExchange | Archived questions

ROS communication speed, and jitter

I measured the time needed for transferring a message in ROS. For this I created 2 simple packages (u can find at gitlab.com/Maksim/ROS-Sample ). The first one generates messages and publishes them each 10ms. The second returns the messages back. So, after the first package receives a message, it evaluates time elapsed since publishing. All the subscribers and publishers work asynchronously (I created an AsyncSpinner for this).

If I run both packages on the same PC the total time for re-sending of one message is about 400 +- 160 usec. If I run the first package on PC, and the second on beaglebone (there is ethernet over USB connection between them), it requires about 2ms with huge jitter: image description

I conducted the similar experiments on beaglebone using TCP client-server using usual sockets. The message re-sending in this case required about 150usec for this. So, ROS is more than 10x slower than usual TCP connection. Furthermore I don't like the huge deviation of the transferring time. I understand that this is not RT system, but sockets work much more stable.

Question: is there a way how to decrease transferring time? or at least make it more stable? P.S.: I use ubuntu 16.04 on the both computers, and the latest ROS kinetic.

Asked by msurov on 2016-06-20 19:49:25 UTC

Comments

When comparing ROS and TCP, are both connections using the Ethernet over USB connection between your PC and the BeagleBone Black?

Asked by ahendrix on 2016-06-20 21:27:46 UTC

The link you've posted doesn't work for me. Can you host your sample somewhere that doesn't require an account to access it?

Asked by ahendrix on 2016-06-20 22:17:19 UTC

@ahendrix: sorted out the url.

Asked by gvdhoorn on 2016-06-21 01:50:57 UTC

@msurov: try disabling Nagle first. See tcpNoDelay() under wiki/roscpp/Overview/Publishers and Subscribers - Transport Hints. Your msgs are small, so it shouldn't matter, but I've seen stranger things.

Asked by gvdhoorn on 2016-06-21 02:00:02 UTC

@ahendrix , yes, the experiments have the same hw configuration.

Asked by msurov on 2016-06-21 03:42:01 UTC

Answers