Installing on Debian from SVN

Install from SVN requires that you download and compile the source code on your own. The main supported version of Debian is version 6, "Squeeze", but it is possible that later versions are working. If you plan to use a newer version like "Wheezy" (version 7) or "Sid" (unstable), please see the bottom paragraph.

Installation

Setup

  • sudo apt-get install build-essential python-yaml cmake subversion wget python-setuptools mercurial

Depending on the configuration you choosed, it is possible that you need to add "contrib" to your /etc/apt/sources.list for some packages. Especially for nvidia-cg-toolkit. Don't forget to do an "apt-get update" after this change to search for the new packages !

Install bootstrap dependencies:

  • sudo apt-get install build-essential python-yaml cmake subversion wget python-setuptools mercurial git-core

Install core library dependencies (aka, 'ROS Base'):

  • sudo apt-get install python-yaml libapr1-dev libaprutil1-dev  libbz2-dev python-dev libgtest-dev python-paramiko libboost-all-dev liblog4cxx10-dev pkg-config python-empy swig

The Python "nose" package version 1.0 or later is required. If you are using Debian 6 (squeeze) or earlier, use pip to install it:

  • sudo apt-get install python-pip
    sudo pip install nose

Otherwise, if you are using Debian 7 (wheezy) or later, use the Debian package:

  • sudo apt-get install python-nose

Next, install graphical library dependencies, if you plan on using ROS graphical tools (aka 'ROS Full'):

  • sudo apt-get install python-wxgtk2.8 python-gtk2 python-matplotlib libwxgtk2.8-dev python-imaging libqt4-dev graphviz qt4-qmake python-numpy

Next, you must build swig-wx from source if you wish to use the graphical tools in ROS in this installation. swig-wx requires bison and the GNU autotools to build.

  • sudo apt-get install bison++ automake autoconf
    git clone https://github.com/ros/swig-wx.git
    cd swig-wx
    ./autogen.sh && ./configure && make && sudo make install

Locales

Currently, there is a known issue with Fuerte's svn scripts if you do not have US-english locales : https://code.ros.org/trac/ros/ticket/3305

A workaround is possible if you do not have US locales :

  • LANG=en_US.utf-8

It will provoke svn warnings during checkout that you may ignore. Here is an example :

  • svn: warning: cannot set LC_CTYPE locale
    svn: warning: environment variable LANG is en_US.utf-8
    svn: warning: please check that your locale name is correct
    svn: warning: cannot set LC_CTYPE locale
    svn: warning: environment variable LANG is en_US.utf-8
    svn: warning: please check that your locale name is correct

rosinstall

The following steps requires two separate installation steps and will compile ROS-related code into two separate places/layers:

  1. Download and install the underlying core ROS libraries and tools into /opt/ros/fuerte.

  2. Download and build some higher-level ROS libraries using rosmake in ~/ros.

The compiled code from (1) is installed into /opt/ros/fuerte. While it is possible to install elsewhere (e.g. /usr), this is not well tested and you will encounter various problems along the way (e.g. having to change rosinstall files, having to manually install system dependencies, etc...). Please see REP 122: Filesystem Hiearchy Layout for more detailed documentation on how the installed files are placed.

The compiled code from (2) is simply built using rosmake, which is familiar to users of previous versions of ROS. The higher-level ROS stacks are download and build in subdirectories inside the ~/ros directory.

First install rosinstall, rospkg and rosdep as described in their instructions:

If you have trouble using rosws/rosinstall, you can manually download the projects by investigating the respective rosinstall file.

Layer 1: Install core libraries

The following instructions will create a system install of the core ROS libraries and tools. The installation is done using standard CMake/make tools, so experts can adjust to their liking.

  • ROS-Full: ROS package, build, communication, tutorials and graphical tools.

    • rosinstall --catkin ~/ros-underlay http://ros.org/rosinstalls/fuerte-ros-full.rosinstall

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries.

    • rosinstall --catkin ~/ros-underlay http://ros.org/rosinstalls/fuerte-ros-base.rosinstall

For people having trouble with rosinstall or catkin on their particular OS: If you have downloaded the source files in a different way, you need to run catkin_init_workspace ~/ros-underlay. This script is part of catkin, which should by now also at least be in your workspace, you can use the script without installing catkin. It should create a suitable global CMakeLists.txt to use in the next step.

If you do not want to use catkin, follow standard cmake procedure for building cmake packages, and install the packages in the dependency order by manually checking the package.xml declarations.

Build and install the underlay into /opt/ros/fuerte:

  • cd ~/ros-underlay
    mkdir build
    cd build

Now, run cmake. The invocation depends on the platform you are on:

  • Debian-based platforms (e.g. Ubuntu, Mint) use:
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte
    Other platforms use:
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte -DSETUPTOOLS_DEB_LAYOUT=OFF

Finally, build + install the code:

  • make -j8
    sudo make install

Useful TIP: If you encounter problems with the make command due to "Unable to find 'swig.swg'" and "Unable to find 'python.swg'" errors then it probably due to the installation script having placed /swig at the toplevel/root directory.

To get around this problem do the following (and then restart make process as above)

cd /
sudo cp -r /swig /usr/local/share
cd ~/ros-underlay/build

Useful TIP: If you are having trouble with the make install command due to lib64 and lib problems, a work around is

cd /opt/ros/fuerte/
sudo mv lib/* lib64/
sudo rmdir lib
sudo ln -s lib64 lib

This makes the lib and the lib64 directory linked together and the make install command should work now.

Verify the installed environment:

  • . /opt/ros/fuerte/setup.sh
    which roscore

You should see:

  • /opt/ros/fuerte/bin/roscore

You can delete ~/ros-underlay now, if you wish. The ROS core libraries are now installed onto your system.

Layer 2: Higher-level robotics libraries and tools

Now it's time to create the second layer, which contains your main robotics libraries (e.g. navigation) as well as visualization tools like rviz. You will build this layer using rosmake, but it is not installed.

There are many different libraries and tools in ROS. We provided four default configurations to get you started.

NOTE: The rosinstall installation files below assume that you've installed into /opt/ros/fuerte, so you will need to change them manually if you have a different install path.

  • Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=desktop-full&overlay=no"

    Desktop Install: : ROS Full, rviz, and robot-generic libraries

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=desktop&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Please reference REP 113 for description of other available configurations.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.zsh

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Build Higher-level/tools (Layer 2)

First, initialize your rosdep. ROS Fuerte comes with rosdep 2. If you get a message that your default sources list exists, then don't worry as it means you've done this before.

  • sudo rosdep init
    rosdep update

Now, use rosdep 2 to install system dependencies. Many of the system dependencies will install into /opt/ros/fuerte and will not be usable if you have changed the installation prefix.

  • rosdep install -a

Useful TIP: to get rid of constant prompts of being sure with proceeding, you can use -y switch to tell the package manager to default 'Yes' while installing.

  • rosdep install -ay

Finally, build the ROS stacks using rosmake.

  • rosmake -a

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Installation on newer versions

If you are using a "Wheezy" or "Sid" version you may have to overwrite the rosinstall OS version detection, with luck it will work as in "Squeeze". Please add this to your environment variables before installing :

  • export ROS_OS_OVERRIDE=debian:squeeze

If this is not enough, you will have to customize your rosdep.yaml files. Please read http://www.ros.org/wiki/rosdep/rosdep.yaml#Overriding_Mapping_File

Compilation failure

Since "Wheezy" and "Sid" include packages for gcc-4.6 and g++-4.6, you may find that your compilation fails if you have these versions of the compilers installed. To remedy this and successfully compile, you can add these environment variables to your session (or shell defaults, such as in ~/.bashrc).

export CC=gcc-4.5
export CXX=g++-4.5

Wiki: fuerte/Installation/Debian (last edited 2013-02-07 17:15:38 by AnqiXu)