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
...
- 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 : IP_ADRESS_REETI (e.g 192.168.0.10)
- On the ".bashrc" file add the following lines:
- ROS_IP="IP_ADRESS_REETI"<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_ADRESS_COMPUTER"<Ip Address of your computer (e.g192.168.0.20)>
- ROS_HOSTNAME="HOSTNAME_COMPUTER"<Host Name Of Your computer (eg. "mylaptop")>"
- ROS_MASTER_URI="http://IP<IP_ADRESS_REETIREETI>: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
Open a new terminal on the REETI and launch "roscore"Once your Reeti is restarted, roscore and ReetiRosNode are started automatically.
Open a new terminal on the REETI and launch "rosrun reetiros ReetiRos"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".
...
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".
In the file explorer Edit (as root) the /etc/hosts file of the remote computer go to "/etc" and open the "hosts" and then add the following line :
- IP_ADRESS_REETI reeti
In the file explorer of the Reeti go to "/etc" and open the "hosts" and 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.
...