ROS2 prioritize Wifi over Ethernet by default? (Whitelist Interface)
- Ubuntu 20.04, ROS2 Foxy
- Binary installation, FastRTPS (Default)
I was setting up multiple machines using ROS2 Foxy.
PC 1 and PC 2:
- Ethernet with static IP address
- Wifi with DHCP
PC 1 and PC 2 are able to ping each other via Wifi DHCP and the static Ethernet IP address.
When running a publisher in PC 1, subscriber in PC 2, by default, it was observed that it uses the Wifi interface which results in a very high latency in receiving the message.
How can I make the default to prioritize the Ethernet over Wifi network interface?
Expected behavior Communicate via Ethernet interface (lower latency)
Actual behavior Communicate via Wifi interface (very high latency)
My current workaround is to disconnect the Wifi on PC 2, which would force it to use the Ethernet to communicate. However this is not desirable in a long run.