1. Home
  2. Docs
  3. Niryo One documentation
  4. Tutorials
  5. Remotely control Niryo One (ROS multi-machines)

Remotely control Niryo One (ROS multi-machines)

PHN0eWxlPgouZGlzY2xhaW1lciB7CmJhY2tncm91bmQ6I2U3ZjJmYTsKICAgIGxpbmUtaGVpZ2h0OiAyNHB4OwogICAgbWFyZ2luLWJvdHRvbTogMjRweDsKICAgICAgYm9yZGVyLXJhZGl1czogMTBweDsKICAgIG92ZXJmbG93OiBoaWRkZW47CiAgICBib3gtc2hhZG93OiAwIDAgMTBweCByZ2IoMCAwIDAgLyAzMCUpOwogIGZvbnQtZmFtaWx5OiBvcGVuLXNhbnMsIGhlbHZldGljYSwgc2Fucy1zZXJpZjsKfQouZGlzLXRpdGxlIHsKYmFja2dyb3VuZDojNmFiMGRlOwogIGZvbnQtd2VpZ2h0OiA3MDA7CiAgICBkaXNwbGF5OiBibG9jazsKICAgIGNvbG9yOiAjZmZmOwogICAgYmFja2dyb3VuZDogIzZhYjBkZTsKICAgIHBhZGRpbmc6IDZweCAxMnB4Owp9Ci5kaXMtdGV4dCB7CiAgICBwYWRkaW5nOiA2cHggMTJweDsKfQouZGlzLXRleHQgYSB7CnRleHQtZGVjb3JhdGlvbjogdW5kZXJsaW5lICFpbXBvcnRhbnQ7Cn0KPC9zdHlsZT4KPGRpdiBjbGFzcz0iZGlzY2xhaW1lciI+CjxkaXYgY2xhc3M9ImRpcy10aXRsZSI+Tm90ZTwvZGl2Pgo8ZGl2IGNsYXNzPSJkaXMtdGV4dCI+VGhpcyB0dXRvcmlhbCBpcyBkZXNpZ25lZCBmb3IgTmlyeW8gT25lIHVzZXJzLiBJZiB5b3UgYXJlIHVzaW5nIE5lZCwgcGxlYXNlIGZpbmQgdGhlIG5ldyB0dXRvcmlhbCA8YSBocmVmPSJodHRwczovL2RvY3MubmlyeW8uY29tL2FwcGxpY2F0aW9ucy9uZWQvc291cmNlL3R1dG9yaWFscy9jb250cm9sX25lZF9yb3NfbXVsdGlfbWFjaGluZXMuaHRtbCIgdGFyZ2V0PSJfYmxhbmsiPmhlcmU8L2E+LjwvZGl2Pgo8L2Rpdj4=

This guide will show you how to control the Niryo One ROS program from another ROS system, for example, a native Ubuntu OS with ROS, or a Ubuntu virtual box. You will be able to remotely use the Niryo One Python API or develop your own ROS packages on a different machine.

First of all, you’ll need to have ROS installed on your Ubuntu OS.

Before going any further, here are some useful readings :

Here we’ll see how to work with multiple machines, with the Raspberry Pi 3 as the ROS Master. (This also applies to a Master running on any other computer, but for the clarity of this tutorial, we’ll say that the Master is a Raspberry Pi 3, and the other machine will be called “the remote machine”).

Connect to the robot

First you need to connect to the Raspberry Pi 3 inside Niryo One, via ssh.

Know your IPs

You already know the Raspberry Pi 3 IP address on the network, because you are connected to it.

To know the IP address on your remote machine, type hostname -I.

Make sure you can successfully ping both machines between each other, using the following command : ping

Modify the ROS_MASTER_URI environment variable on your remote machine

By default, the ROS_MASTER_URI should be something like : http://localhost:11311. You can check the value by typing printenv | grep ROS_MASTER_URI

You need to change the hostname, and replace it by the Raspberry Pi hostname (or IP). For example, if the Raspberry Pi 3 IP on the network is 192.168.43.179, then you need to do :

export ROS_MASTER_URI=http://192.168.43.179:11311

Testing time

Make sure that ROS is running on the Raspberry Pi 3. You can simply start a roscore or launch the complete Niryo One ROS stack.

On the remote machine, type rosnode list. If the configuration is correctly done, you should see the list of nodes currently running on the Master (Raspberry Pi 3). This means that the connection is successful. You can now use the ROS communication tools, the Python API, etc, directly from your remote machine !

When executing rosnode list, if you get the error “ERROR: Unable to communicate with master!”, it means that you did something wrong in the setup, or your ROS installation is not properly configured. Make sure you correctly installed ROS, read the ROS wiki pages about Network and multiple machines, and try to follow the guide again.

Optional : some improvements

If you often work from the same remote machine with the same Raspberry Pi 3 Master, you can directly set the environment variable in your bashrc.

Simply write “export ROS_MASTER_URI=http://(ip_address):11311” at the end of your .bashrc file.

You can also set a hostname instead of an IP address, for that you’ll need to edit your /etc/hosts and add a new line, for example : “rpi_machine 192.168.43.179”, and then you can set the ROS_MASTER_URI to http://rpi_machine:11311

How can we help?