In this tutorial we will see how to set up the connexion between the ROS master of the REETI and a remote linux computer.
Setting the Environment Variable
In order to use ROS from a remote computer you will need to add some environment variables on your computer and on the REETI.
On the REETI :
- Open the ".bashrc" file in the "home" directory of the REETI
- On a terminal use "ifconfig" in order to get the IP adress of the REETI : (e.g 192.168.0.10)
- On the ".bashrc" file add the following lines:
- ROS_IP=<Ip Address of your reeti (e.g192.168.0.10)>
- ROS_HOSTNAME="reeti"
On the remote computer:
- Open the ".bashrc" file in the "home" directory of the computer
- On a terminal use "ifconfig" in order to get the IP adress of the computer (e.g 192.168.0.20)
- On a terminal get the hostname of your computer by typing "hostname" (e.g mylaptop)
- On the ".bashrc" file add the following lines:
- ROS_IP=<Ip Address of your computer (e.g192.168.0.20)>
- ROS_HOSTNAME="<Host Name Of Your computer (eg. "mylaptop")>"
- ROS_MASTER_URI="http://<IP_ADRESS_REETI>:11311" (e.g http://192.168.0.10:11311)
Save and close the files and restart your reeti (to restart the roscore with good ROS_IP and ROS_HOSTNAME).
To get more informations on how to setup ROS with multiple computers, read this page.
Testing the connexion
Once your Reeti is restarted, roscore and ReetiRosNode are started automatically.
Open a terminal in the remote computer and launch : "rosservice list", you should be able to see the different services of the node you launched earlier as "/Say" or "/SetPose".
You can now create new ros nodes on your computer and make them communicate with the Reeti Ros Node on the REETI.
TroubleShooting
If when you using a node on the remote computer you fail to call the associated service on the REETI and the roscore on the REETI prints: "Couldn't find an AF_INET address for".
Edit (as root) the /etc/hosts file of the remote computer and then add the following line :
- IP_ADRESS_REETI reeti
Edit (as root) the /etc/hosts file of the reeti and then add the following line :
- IP_ADRESS_COMPUTER HOSTNAME_OF_THE_COMPUTER
Close all the opened terminal and retry.