Search code examples
dockernetwork-programmingrosdocker-machine

ROS node inside docker not being listened to by external mchines on same LAN


In my setup, I have two PCs on a LAN. First PC has the ROS core(master) running. Second PC is the slave and the host for a docker container.

All topics are easily being listened to between the two PCs. And the docker container can listen to topics from its host(ROS slave) machine as well as the PC running the ROS master. But topics published from inside the docker can only be listened by the host(ROS slave) machine and no the machine running ROS master.

Thanks


Solution

  • You can pass --net=host parameter to the docker run command - this way your docker will share the network with its host - it will get the IP address of the host and you will be able to communicate both ways.