Embedded Motion Control/Tutorials/Installing and configuring your ROS environment: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:


If you ran into problems, be sure to check the [http://www.ros.org/wiki/groovy/Installation/Ubuntu installation guide on the ROS website].
If you ran into problems, be sure to check the [http://www.ros.org/wiki/groovy/Installation/Ubuntu installation guide on the ROS website].
= Download Project Specific Software =
Besides ROS, we will use some custom created packages during this project. For example, you will be able simulate the PICO robot using the ''pico_gazebo'' ROS package. To get this software, follow these steps:
# First, create a directory in your home directory in which you will put all ROS-related code, files and data: <pre>mkdir -p ~/ros/emc</pre>
# Then install Subversion (SVN), a file share and versioning tool similar to Dropbox that we will use during this project:<pre>sudo apt-get install subversion</pre>It may be the case that this tool is already installed on your system.
# Navigate into the folder you created:<pre>cd ~/ros/emc</pre>
# ''Check-out'' the PICO-software:<pre>svn co https://roboticssrv.wtb.tue.nl/svn/emc/2013/general</pre>''Check-out'' is the SVN-term for downloading. More information on SVN will be provided later.


= Environment Set-up =
= Environment Set-up =


So far we've installed ROS. However, before you can start working, you need to do some additional set-ups to make sure Ubuntu knows where to find all ROS-related packages, scripts, etc. More specifically, every time you start up a terminal, the correct ''environment variables'' need to be set. The file '''.bashrc''' in your home directory is your friend: it's a script which runs every time a new terminal is opened. We basically need to add some lines to this file, so open the file with a text editor:
So far we've installed ROS and dowloaded PICO-specific software. However, before you can start working, you need to do some additional set-ups to make sure Ubuntu knows where to find all ROS-related packages, scripts, etc. More specifically, every time you start up a terminal, the correct ''environment variables'' need to be set. The file '''.bashrc''' in your home directory is your friend: it's a script which runs every time a new terminal is opened. We basically need to add some lines to this file, so open the file with a text editor:


<pre>gedit ~/.bashrc</pre>
<pre>gedit ~/.bashrc</pre>

Revision as of 16:32, 23 April 2014

Description: This tutorial walks you through installing ROS and setting up the ROS environment on your computer.

Install ROS

In this project we will use the Robotic Operating System (ROS) which aids the testing and development of robot software. ROS provides a nice open-source framework for dealing with the communication between and management of different modules, and comes with a large amount of software that can be used out of the box, including device drivers, libraries, low- and high-level software, visualizers and more. More information about ROS and its goals can be found here.

To install ROS Groovy under Ubuntu 12.04, do the following:

  1. Add the ROS Debian source to your sources.list such that Ubuntu knows where to download ROS from. Open a terminal (Applications -> Accessories -> Terminal) and enter:
    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
  2. To be able to connect with the server, you need to add its public key to your keys:
    wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
  3. Make sure your Debian package index is up-to-date such that you get the latest changes:
    sudo apt-get update
  4. Then, we can install ROS and some additional ROS packages we will need:
    sudo apt-get install ros-groovy-desktop ros-groovy-vision-opencv
  5. Furthermore, you will need some additional ROS packages:
    sudo apt-get install ros-fuerte-pr2-controllers ros-fuerte-vision-opencv

If you ran into problems, be sure to check the installation guide on the ROS website.

Download Project Specific Software

Besides ROS, we will use some custom created packages during this project. For example, you will be able simulate the PICO robot using the pico_gazebo ROS package. To get this software, follow these steps:

  1. First, create a directory in your home directory in which you will put all ROS-related code, files and data:
    mkdir -p ~/ros/emc
  2. Then install Subversion (SVN), a file share and versioning tool similar to Dropbox that we will use during this project:
    sudo apt-get install subversion
    It may be the case that this tool is already installed on your system.
  3. Navigate into the folder you created:
    cd ~/ros/emc
  4. Check-out the PICO-software:
    svn co https://roboticssrv.wtb.tue.nl/svn/emc/2013/general
    Check-out is the SVN-term for downloading. More information on SVN will be provided later.

Environment Set-up

So far we've installed ROS and dowloaded PICO-specific software. However, before you can start working, you need to do some additional set-ups to make sure Ubuntu knows where to find all ROS-related packages, scripts, etc. More specifically, every time you start up a terminal, the correct environment variables need to be set. The file .bashrc in your home directory is your friend: it's a script which runs every time a new terminal is opened. We basically need to add some lines to this file, so open the file with a text editor:

gedit ~/.bashrc

Append the following text to the end of the file:

source /opt/ros/groovy/setup.bash

This will set-up all ROS-related scripts etc. every time you open a terminal. Since the script only runs when a new terminal is opened, the changes are not active in your current terminal. If you want to see it working directly without starting a new terminal, explicitly source .bashrc from the terminal:

source ~/.bashrc

To see whether it worked, try one of the ROS commands that are now at your disposal. For example, navigate to the roscpp package:

roscd roscpp

A later tutorial will have a thorough explanation of what this command does. However, first we will learn about the Dropbox-like file version tool you will be using to keep track of your code: Using Subversion .