ROS communication speed, and jitter

asked 2016-06-20 19:50:16 -0600

msurov gravatar image

updated 2016-06-21 01:50:09 -0600

gvdhoorn gravatar image

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.

edit retag flag offensive close merge delete

Comments

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

ahendrix gravatar imageahendrix ( 2016-06-20 21:27:46 -0600 )edit

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?

ahendrix gravatar imageahendrix ( 2016-06-20 22:17:19 -0600 )edit

@ahendrix: sorted out the url.

gvdhoorn gravatar imagegvdhoorn ( 2016-06-21 01:50:57 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2016-06-21 02:00:02 -0600 )edit

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

msurov gravatar imagemsurov ( 2016-06-21 03:42:01 -0600 )edit