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

The lack of data means that your client can see the ROS master, but cannot connect to the topics on the remote machine. The cause is that the services on the remote machine are not accepting remote connections, only local. This is determined by the ROS_IP variable.

So, to use ROS over network, you need do two two things:

On the machine running roscore, you need to make sure that your services listen on any port. When no port is set, localhost (127.0.0.1) is used. So, you should select the IP of your machine on the internal network, or listen on any interface:

export ROS_IP=0.0.0.0 # Listen on any interface

OR

export ROS_IP=192.168.0.1 # Listen on 192.168.0.1

On the machine running roscore, you needn't worry about ROS_MASTER_URI or ROS_HOSTNAME.

On the client machine, not running roscore, there's two things you need to do. First, you need to make sure that ROS nodes are able to connect to the master by specifying ROS_MASTER_URI:

export ROS_MASTER_URI=192.168.0.1

Second, you need to make sure that nodes running on the remote machine can also access topics published on the local machine, by setting ROS_IP to something different than 127.0.0.1, so:

export ROS_IP=0.0.0.0

The lack of data means that your client can see the ROS master, but cannot connect to the topics on the remote machine. The cause is that the services on the remote machine are not accepting remote connections, only local. This is determined by the ROS_IP variable.

So, to use ROS over network, you need do two two things:

On the machine running roscore, you need to make sure that your services listen on any port. When no port is set, localhost (127.0.0.1) is used. So, you should select the IP of your machine on the internal network, or listen on any interface:

export ROS_IP=0.0.0.0 # Listen on any interface

OR

export ROS_IP=192.168.0.1 ROS_IP=192.168.1.1 # Listen on 192.168.0.1

On the machine running roscore, you needn't worry about ROS_MASTER_URI or ROS_HOSTNAME.

On the client machine, not running roscore, there's two things you need to do. First, you need to make sure that ROS nodes are able to connect to the master by specifying ROS_MASTER_URI:

export ROS_MASTER_URI=192.168.0.1ROS_MASTER_URI=192.168.1.1:11311

Second, you need to make sure that nodes running on the remote machine can also access topics published on the local machine, by setting ROS_IP to something different than 127.0.0.1, so:

export ROS_IP=0.0.0.0

ROS_IP=0.0.0.0 # To listen on any interface

The lack of data means that your client can see the ROS master, but cannot connect to the topics on the remote machine. The cause is that the services on the remote machine are not accepting remote connections, only local. This is determined by the ROS_IP variable.

So, to use ROS over network, you need do two two things:

On the machine running roscore, you need to make sure that your services listen on any port. When no port is set, localhost (127.0.0.1) is used. So, you should select the IP of your machine on the internal network, or listen on any interface:

export ROS_IP=0.0.0.0 # Listen on any interface

OR

export ROS_IP=192.168.1.1 # Listen on 192.168.0.1192.168.1.1

On the machine running roscore, you needn't worry about ROS_MASTER_URI or ROS_HOSTNAME.

On the client machine, not running roscore, there's two things you need to do. First, you need to make sure that ROS nodes are able to connect to the master by specifying ROS_MASTER_URI:

export ROS_MASTER_URI=192.168.1.1:11311

Second, you need to make sure that nodes running on the remote machine can also access topics published on the local machine, by setting ROS_IP to something different than 127.0.0.1, so:

export ROS_IP=0.0.0.0 # To listen on any interface