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

From Control Systems Technology Group
Jump to navigation Jump to search
Line 21: Line 21:
# 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.
# 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>
# 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/2014/general</pre>''Check-out'' is SVN-terminology for downloading. More information on SVN will be provided later.
# ''Check-out'' the PICO-software:<pre>svn co https://roboticssrv.wtb.tue.nl/svn/emc/2014/general</pre>Validate the certificate by pressing p (permanently). You will then be prompted for your username and password. Use the account credentials that were sent to your group. The term ''check-out'' is SVN-terminology for downloading. More information on SVN will be provided later.


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

Revision as of 21:01, 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

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/2014/general
    Validate the certificate by pressing p (permanently). You will then be prompted for your username and password. Use the account credentials that were sent to your group. The term check-out is SVN-terminology for downloading. More information on SVN will be provided later.

Environment Set-up

So far we've installed ROS and created a local copy of the SVN. 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 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/fuerte/setup.bash

This will set-up all ROS-related scripts etc. every time you open a terminal. Furthermore, ROS needs to known where your software is located. Therefore, also add the following command to ~/.bashrc:

export ROS_PACKAGE_PATH=~/ros/emc:$ROS_PACKAGE_PATH

That's it. Next time you open a terminal, .bashrc is executed, which will in turn execute the script and set the path specified above. 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 commands that are now at your disposal. For example, change your directory to the pico_gazebo package:

roscd pico_gazebo

The next tutorial will explain in more detail what you can do with the roscd command.