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
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 :
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 !
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