-
Notifications
You must be signed in to change notification settings - Fork 0
Installing and Configuring ROS
Once, both the systems are running Ubuntu 16.04, you need to install ROS kinetic on both the machines.
-
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.
-
Install ROS-Kinetic in your PC and the raspberry pi from here. There are no special instructions for doing this on the raspberry pi.
-
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.
Steps to follow:
-
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.
-
IN YOUR PC From this directory copy 'central_server folder' to where the ROS packages live, i.e. in ~/catkin_ws/src/
-
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.
-
IN YOUR PC Open the terminal and run these commands:
cd ~/catkin_ws
rosdep update
rosdep install central_server
catkin_make
- 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.
- 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:
-
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 -
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'
- IN YOUR R-PI, Find your R-PI's IP address. To do this, in the terminal run this command:
ifconfigSay 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
- 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
- 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## ##