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

Revision history [back]

I think that you misunderstood the role of the environment variable ROS_MASTER_URI. If you have the ROS MASTER and a ROS NODE, the variable will be used by the ROS NODE to know where to look for the MASTER. It's not setting the master URI to a specific value.

In your example, you should just run roscore in the Docker, without setting any environment variable. roscore will print to screen the URI where the master can be reached.

In the terminal where you want to run your nodes, you will have to run export ROS_MASTER_URI=XX.X.X.X with the URI that has been previously printed.

I think that you misunderstood the role of the environment variable ROS_MASTER_URI. If you have the ROS MASTER and a ROS NODE, the variable will be used by the ROS NODE to know where to look for the MASTER. It's not setting the master URI to a specific value.

In your example, you should just run roscore in the Docker, without setting any environment variable. roscore will print to screen the URI where the master can be reached.

In the terminal where you want to run your nodes, you will have to run export ROS_MASTER_URI=XX.X.X.X with the URI that has been previously printed.

Moreover, if using Docker, you should make sure that the Docker container has not been run in isolated mode.