Skip to content

Installing and Configuring ROS

CHARISMAlab edited this page Sep 21, 2018 · 5 revisions

Installing ROS

Once, both the systems are running Ubuntu 16.04, you need to install ROS kinetic on both the machines.

  1. You should be able to ssh into the raspberry pi as it is connected to the same WiFi network, in this wiki wherever I mention running a terminal command, I mean to run it in a terminal in which you have ssh-ed into the raspberry pi.

  2. Install ROS-Kinetic in your PC and the raspberry pi from here. There are no special instructions for doing this on the raspberry pi.

  3. Only if you are unfamiliar with ROS, atleast follow tutorials 1.1,1.2, 1.3 and 1.4 from here. This step will help in understanding and debugging with ROS later.

Installing ROS-codebase

Steps to follow:

  1. Git clone this repository and store it locally, this repo has some folders which need to be placed at different places - in your central PC and the raspberry pi.

  2. IN YOUR PC From this directory copy 'central_server folder' to where the ROS packages live, i.e. in ~/catkin_ws/src/

  3. IN YOUR R-PI Now log into the raspberry pi and copy 'neato_robot folder' to where the ROS packages live, i.e. in ~/catkin_ws/src Step 2 and Step 3 were to copy the files of the ROS packages 'central_server' and 'neato_robot', now we need to build these packages so that ROS knows that these new packages exist (remember tutorial 1.4?), following instructions will help you build these packages.

  4. IN YOUR PC Open the terminal and run these commands:

cd ~/catkin_ws

rosdep update

rosdep install central_server

catkin_make

  1. Since, we will be using PS4 hand-held controller, in the terminal run these commands to install packages for that:

sudo apt-get install ros-kinetic-joy

More information about configuring Joy node can be found here.

  1. IN YOUR R-PI Open the terminal and run these commands:

cd ~/catkin_ws

rosdep update

rosdep install neato_robot

catkin_make

Now the packages have been installed, in order to run and use them, follow the next sub-section. First we need to configure ROS IP settings:

Configuring ROS IP settings

  1. First thing is to make sure that the PC and the R-Pi are on the same WiFi network. You can check over terminal by running this command: iwconfig

  2. IN YOUR PC, Find your PC's IP address. To do this, in the terminal run this command: ifconfig

Say the PC's IP address is '192.168.1.64'

  1. IN YOUR R-PI, Find your R-PI's IP address. To do this, in the terminal run this command: ifconfig Say the R-PI's IP address is '192.168.1.136'

Now that we know the IP addresses, follow these steps to tell ROS who is the master and which other machines are communicating with the master. Keep in mind that you need to use your machine's IPs and not the ones used here

  1. IN YOUR PC, in the terminal run these commands:

export ROS_IP=192.168.1.64

export ROS_MASTER_URI=http://192.168.1.64:11311

source ~/catkin_ws/devel/setup.bash

  1. IN YOUR R-PI, in the terminal run these commands:

export ROS_IP=192.168.1.136 //telling ROS the IP of this machine

export ROS_MASTER_URI=http://192.168.1.64:11311 //telling ROS the IP of the master, which is your PC

source ~/catkin_ws/devel/setup.bash //not necessary but sometimes not sourcing can cause erros## ##

Clone this wiki locally