Skip to content

ROS Multiple Machines

diegocardozo97 edited this page Jul 1, 2020 · 2 revisions

Running ROS across multiple machines

ROS offers to use several computers to run in each nodes that you otherwise would run in a single computer, without changing any code. Here is an overview of that process and outline of what needs to be done.

Overview

The tutorial is at the ROS website. The requirements are to have all computers in the same network, all ports available, and the IP of everyone. There isn't any configuration or adjustment beforehand, you can decide in any moment to use 1, 2, 3, etc. number of machines. Only the terminal variables (i.e. using export) are needed before running a node and for each terminal.

There is a script to setup each computer.

Notes:

  • This doesn't seem to work with VM, because others can't even ping it.

Steps

Master

  • It does not need to set any variable: MASTER_URI nor ROS_IP.
  • Only to run ROSCORE.

No masters

  • To not run ROSCORE.
  • Set terminal variable ROS_MASTER_URI with the master's ip or hostname with the port 11311, i.e.: http://master_host:11311 or http://ip.ma.st.er:11311

Publishers/talkers

  • Also needs to set variable ROS_IP of that computer, i.e.: its.own.i.p or its_hostname.

Susbcribers/listeners

  • Doesn't need anything else.

Hotspot, IPs, and Hostnames

An option is to use one computer (desirable the master) as a hotspot to others machines. Ubuntu enables this option in the WiFi options.

  • To set the address of the hotspot (master with ROSCORE) check this to set address1, that in general will automatically be the .1 ip.
  • To assign by the MAC a static IP to each device check this for the hotspot computer.
  • To enable using hostnames instead of the IPs, check the additions to the hosts file in the hotspot computer here.