simulating a delay over certain topics with a multi pc ros network
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.
Hey there, I am basically looking at the same setup where I want to delay messages sent over 2 machines which are synchronized using chrony. Roscore is running on the publishing machine 1 and I calculate the delay in the subscribing node on the other machine 2. The message is sent every 100 ms and I am using netimpair on machine 1 to delay outgoing packets. I am observing the following:
- With any delay <100 ms, everything is working as expected, the calculated delay equals the input of netimpair.
- For any delay above 100 ms, it seems like multiple messages are received at the same time and the calculated delay starts rolling up periodically, e.g. for 110 ms it increases by 10 ms until 200 ms and starts again from 110 ms.
- For a higher delay like 1000 ms, 9 msgs are received almost simultaneously, while a the tenth ...
(more)