Ask Your Question

simulating a delay over certain topics with a multi pc ros network

asked 2021-09-14 03:37:42 -0600

lieftinkrj gravatar image

Hello All,

For teleoperating purposes, I want to add a time delay to certain ros topics, to simulate distances between operator and robot. At the moment I am doing this using the message filters, the time sequencer to be exact, but this does more than desired.

So I know the tc command in linux to simulate delay on your network interface, by using for example the following line:

sh tc qdisc add dev eth0 root netem delay 97ms

My systems consists of some nodes running on 1 pc and some nodes running on the other pc. The nodes locally do not need to have their topics delayed. Only the topics send between the pc's have to be delayed.

I am not the greatest in networking(so could be making some mistakes in my reasoning here), so here I go

Now I know that when locally running your ros network everything goes over local host, meaning that you could delay every topic by using the tc command over your local host. But what happends when you have a multi pc network? Do the local nodes its topics go over your local host and the ones between the pc's via your other network interface, or does everything switch to that network interface when using a multi pc network?

So if locally everything goes over local host and the topics via the pc's go via another host, I could easily just use the tc command over that network interface, right?

I hope this is clear.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-09-14 06:39:59 -0600

updated 2021-09-14 06:43:38 -0600

Hi @lieftinkrj, your question is very interesting. When I read the, in the last section talks about timing issues. So one thing to consider is that not all your machines might have the same response time and a central delay might make it worse. On the other hand, you are right to assume all communication is bi-directional.

It looks with chrony you may be able to achieve what you are looking for:

edit flag offensive delete link more


Thanks for your answer! I do want to make it worse actually, I am trying to simulate time delays in such systems and check the stability. However I do not see how synchronizing(or applying an offset to the clock) will add a physical delay in the system. However, chrony could be used to test it myself(synchronizing clocks and checking the time stamps of different topics), but hoped that someone knew it.

lieftinkrj gravatar image lieftinkrj  ( 2021-09-14 08:43:07 -0600 )edit

Perhaps you may be able to run with and without offset at different nodes.

osilva gravatar image osilva  ( 2021-09-14 09:40:01 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-09-14 03:37:42 -0600

Seen: 19 times

Last updated: Sep 14 '21