ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Generally, mutlicast adresses are a special type of IP addresses as they don't address devices directly. This means, that a network stack does not know on which network segment the multicast packets are supposed to go out.

As an example: you might have two interfaces:

eth0 on subnet 192.168.1.0/24
wlan0 on subnet 172.16.1.0/24

So if you want to publish a message to a multicast address, e.g. 239.140.0.1, the network stack does not know on which interface to publish. It might even be, that some multicast adresses go on one interface, and others on the other interface. It will just choose one (your default route).

You need to tell your stack which one to use. In your case, it might work to just set a route for all multicast traffic on the interface were your remote ROS PC is located, using the route command like this

route add 224.0.0.0 netmask 240.0.0.0 dev eth0

(assuming the ROS peer is on eth0). This adds a routing entry, that multicast is always routed via eth0. You have to make sure the routes are correct on both machines.

As a very quick solution: you can disable all but interfaces but the one over which ROS is communicating. Do this on both PCs. Then the network stack will chose the only interface that is up for multicast traffic