HCCY
HCCY

Reputation: 91

Running ROS in docker container and echo/pub from another docker container within same docker network (non-host network)

I am working on running ROS in one docker container and trying to rosnode list to check the information from another container which both of them are under same customize docker network (non host).

From the docker side, I am pretty sure that two of the containers could talk with each other because I've tried to ping container1 from container2 without loss any packet.

The container1 IP is 172.22.0.2 and the container2 IP is 172.22.0.3

I've setup the config of both of container as following:

container1 export ROS_IP=172.22.0.2 export ROS_MASTER_URL=http://172.22.0.2:11311/

container2 export ROS_IP=172.22.0.3 export ROS_MASTER_URL=http://172.22.0.2:11311/

After that, I start to run roscore on container1 and input command rosnode list on container2, however the container2 showing error message: Unable to communicate with master!

It seems like even I setup ros master url for both of the container, I am still not able to share the same roscore between containers.

Is there anything might be missing or something I did is incorrect?

Upvotes: 2

Views: 1475

Answers (1)

BTables
BTables

Reputation: 4823

The environmental variable you need is ROS_MASTER_URI not ROS_MASTER_URL. Set the former to the master IP.

Upvotes: 2

Related Questions