How To Setup ROS Kinetic To Communicate Between Raspberry Pi 3 and a remote Linux PC

How To Setup ROS Kinetic To Communicate Between Raspberry Pi 3 and a remote Linux PC

I work these days to setup ROS Kinetic to communicate between Raspberry Pi 3 and a remote Linux PC. The Raspberry Pi 3 has limited capabilities for graphics applications such as rviz and other visualization software. In conclusion, I need this setup to remotely monitor and control my robot and for graphics applications.

To link the robot’s Raspberry Pi and the remote computer, I have two options:

  1. both computers communicate on the same network;
  2. both computers communicate via a VPN;

I choose the first option since I have both computers connected to the same WiFi network.

Here is how I did:
Since the robot will work at a fairly large distance away from the remote computer, I decide to use a high power outdoor access point to connect the Pi and the PC to the same WiFi network.

I did a research and I buy a TP-Link 5GHz 300Mbps 13dBi. The price is very good considering that I can control and monitor the robot over a distance of several kilometers. According to the specifications, the access point offers a range of 15 kilometers (I guess in ideal conditions). A range of up to one kilometer is enough for what I need.

Next, I’ll describe the steps that I did to setup ROS Kinetic to communicate between Raspberry Pi 3 and the remote Linux computer.

  • Step 1: The first step was to check that everything was okay with ROS Kinetic on my remote computer. I installed it some time ago using the steps described here.
  • Step 2: The second step was to install a new Linux image and ROS Kinetic on one of the Raspberry Pi 3 board from my Pi collection. Here it took me some time because I chose to install ROS on the Raspbian Stretch Lite.
    This operating system is what I need for my robot: it doesn’t have desktop applications or a GUI of any kind.
  • Step 3: At this step, I pay some attention at the IP address for the ROS master node (Pi) and the IP for other ROS node (Linux PC).
    1. on Raspberry Pi 3 type the following command:
      sudo nano .bashrc

      Navigate to the end of the file and add these two lines:

      #The IP address for the Master node = the IP address of Raspberry Pi
      export ROS_MASTER_URI=http://192.168.0.1:11311
      
      #The IP address for the Master node= the IP address of Raspberry Pi
      export ROS_HOSTNAME=192.168.0.1
      
    2. on the Linux PC, type the following command:
      sudo nano .bashrc

      Navigate to the end of the file and add these lines:

      #The IP address for the Master node = the IP address of Raspberry Pi
      export ROS_MASTER_URI=http://192.168.0.1:11311
      #The IP address for your Linux PC
      export ROS_HOSTNAME=192.168.1.101

These are all the steps to make two Linux computers communicate and share nodes, topics, and services.

Leave a Reply

Required fields are marked *.