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

0.0.0.0 is almost certainly not a valid value for ROS_IP. ROS_IP is used by ROS nodes to tell others at which IP:PORT combo they can be reached. For host0, 0.0.0.0 is a local address. For host1, 0.0.0.0 is also a local address. It should be clear why that will not work.

Set ROS_IP to the IP which is accessible to all other (remote) ROS nodes. For a simple LAN setup, that would be the IP of the NIC connected to the LAN on which the other ROS hosts are present.

Set ROS_MASTER_URI to the IP:PORT combo at which the master is reachable.

Note: if remote means "reachable over the (public) internet", and you have a typical consumer grade internet connection with something like a NAT box between you and the "remote", things will become more difficult, as you now have to deal with NAT as well.

If that's the case, I'd recommend using a (peer-to-peer) VPN to create a virtual network between you and your friend, as that will significantly reduce complexity. I've used tinc with good results, but any VPN which is not too difficult to set up should be OK. If/when you have that setup, you'll likely want to use the IP addresses in the VPN's range, instead of the ones you have configured now.

Anyways thanks for any help, really enjoying it so far, though I feel like I've been doing more networking than actually working with ros :).

Probably because ppl typically don't start out with setting up multi-host systems, but first try to get their bearings with ROS on a single host.

Ideally we want to use ros2, but since the networking TSG on that is not out with no ETA,

What do you mean by this? What is a TSG?

None of this behavior makes sense to me unless roscore is not handling all the communication and is instead communicating to nodes to open connections with other nodes.

Yes, that is indeed what the function of the ROS Master is. You may want to review some documentation on its purpose and implementation: wiki/Master.

Anyways, I have seen a ton of posts on this, but the way I got to a semi-working example was by combining multiple answers from multiple posts - so it'd be nice to get a full answer

To get it out of the way (and seeing as you don't mention those pages): have you seen wiki/ROS/NetworkSetup, specifically ROS/Tutorials/MultipleMachines and the linked troubleshooting pages?

They should go into some detail about how to do all this.

I have seen that some people say they need to edit /etc/hosts -> Is this actually required? I have seen several posts say that ROS_IP should be your local IP (like 192.168.0.2 or something), others said it should be 0.0.0.0. I only got this semi-working by using 0.0.0.0. Is this the the correct setting?

0.0.0.0 is almost certainly not a valid value for ROS_IP. ROS_IP is used by ROS nodes to tell others at which IP:PORT combo they can be reached. For host0, 0.0.0.0 is a local address. For host1, 0.0.0.0 is also a local address. It should be clear why that will not work.

Set ROS_IP to the IP which is accessible to all other (remote) ROS nodes. For a simple LAN setup, that would be the IP of the NIC connected to the LAN on which the other ROS hosts are present.

Set ROS_MASTER_URI to the IP:PORT combo at which the master is reachable.

Note: if remote means "reachable over the (public) internet", and you have a typical consumer grade internet connection with something like a NAT box between you and the "remote", things will become more difficult, as you now have to deal with NAT as well.

If that's the case, I'd recommend using a (peer-to-peer) VPN to create a virtual network between you and your friend, as that will significantly reduce complexity. I've used tinc with good results, but any VPN which is not too difficult to set up should be OK. If/when you have that setup, you'll likely want to use the IP addresses in the VPN's range, instead of the ones you have configured now.

Anyways thanks for any help, really enjoying it so far, though I feel like I've been doing more networking than actually working with ros :).

Probably because ppl typically don't start out with setting up multi-host systems, but first try to get their bearings with ROS on a single host.

Ideally we want to use ros2, but since the networking TSG on that is not out with no ETA,

What do you mean by this? What is a TSG?

None of this behavior makes sense to me unless roscore is not handling all the communication and is instead communicating to nodes to open connections with other nodes.

Yes, that is indeed what the function of the ROS Master is. It is not a broker, buffer or relay station, but only a coordinator (it's been likened to a DNS server sometimes).

You may want to review some documentation on its purpose and implementation: wiki/Master.

Anyways, I have seen a ton of posts on this, but the way I got to a semi-working example was by combining multiple answers from multiple posts - so it'd be nice to get a full answer

To get it out of the way (and seeing as you don't mention those pages): have you seen wiki/ROS/NetworkSetup, specifically ROS/Tutorials/MultipleMachines and the linked troubleshooting pages?

They should go into some detail about how to do all this.

I have seen that some people say they need to edit /etc/hosts -> Is this actually required? I have seen several posts say that ROS_IP should be your local IP (like 192.168.0.2 or something), others said it should be 0.0.0.0. I only got this semi-working by using 0.0.0.0. Is this the the correct setting?

0.0.0.0 is almost certainly not a valid value for ROS_IP. ROS_IP is used by ROS nodes to tell others at which IP:PORT combo they can be reached. For host0, 0.0.0.0 is a local address. For host1, 0.0.0.0 is also a local address. It should be clear why that will not work.

Set ROS_IP to the IP which is accessible to all other (remote) ROS nodes. For a simple LAN setup, that would be the IP of the NIC connected to the LAN on which the other ROS hosts are present.

Set ROS_MASTER_URI to the IP:PORT combo at which the master is reachable.

Note: if remote means "reachable over the (public) internet", and you have a typical consumer grade internet connection with something like a NAT box between you and the "remote", things will become more difficult, as you now have to deal with NAT as well.

If that's the case, I'd recommend using a (peer-to-peer) VPN to create a virtual network between you and your friend, as that will significantly reduce complexity. I've used tinc with good results, but any VPN which is not too difficult to set up should be OK. If/when you have that setup, you'll likely want to use the IP addresses in the VPN's range, instead of the ones you have configured now.

Anyways thanks for any help, really enjoying it so far, though I feel like I've been doing more networking than actually working with ros :).

Probably because ppl typically don't start out with setting up multi-host systems, but first try to get their bearings with ROS on a single host.