[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

Arch Linux Installation Instructions

NOTE: Installation on Arch does NOT work. Feel free to follow these instructions, picking up where they leave off. If you manage to get a successful install, update this Wiki.

SVN Based Install (download-and-compile)

Setup

First, install and configure sudo. ROS does not seem to support installation on Arch without it. Then, execute

sudo pacman -Sy python2 cmake wget python-yaml python2-distribute

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation.

ROS is poorly supported on Arch, so please carefully follow these instructions, and if you run into problems, solve them and then update this wiki page.

Before running rosinstall, install the package log4cxx from the AUR. You can also try installing yaourt instead, since the rosinstall will attempt to automatically install log4cxx with yaourt if it is not installed. However, yaourt is a very slow AUR helper (Clyde is much better); besides, the code that executes yaourt appears incorrect, since yaourt is interactive and the code doesn't appear to accommodate this. Again, I haven't installed yaourt, so I can't test this for sure.

You will necessarily encounter errors when running the rosinstall command. To fix some of these problems, run

find ~/ros -type f -exec sed -ri 's|#! ?/usr/bin/(env )?python$|#! /usr/bin/env python2' '{}' \;

to fix errors related to scripts using the wrong version of the Python interpreter, and

sed -ri 's|pacman -Sy?|pacman -Sy --noconfirm|g' ~/ros/ros/tools/rosdep/src/rosdep/arch.py

to fix hanging when the scripts invoke pacman. Then, rerun the relevant rosinstall command. There are will be further errors; I'm not sure how to fix them.

The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall:

  • sudo easy_install-2.7 -U rosinstall

Then use rosinstall to download your preferred C-Turtle variant:

  • ROS-only: Includes basic ROS and tutorials.

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

    Base Install: ROS plus robot-generic stacks (e.g. navigation, visualization)

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

    PR2 Install: ROS plus PR2-specific stacks, including PR2 simulator.

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

    PR2 All Install: ROS plus PR2 and bleeding edge research/experimental stacks.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=cturtle&variant=pr2all&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.

Tutorials

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

Arch Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo pacman -S python cmake wget python-yaml mercurial

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall:

  • sudo easy_install -U rosinstall

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

  • 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=diamondback&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=diamondback&variant=desktop&overlay=no"

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

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

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

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-base&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 108 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

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

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

Tutorials

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

Arch Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo pacman -S cmake wget mercurial subversion git python2-distribute python2-yaml python-distribute python-yaml

For the next step, you might need to use something like "easy_install-2.7" instead of just "easy_install"

Running "find /usr/bin -name easy_install*" will show you a list of installed versions of easy-install.

Workaround Install

At this time (20 Feb 2012) ros has not integrated community supplied patches to make the ros installer work with archlinux. Useful links:

https://code.ros.org/trac/ros/ticket/3700

https://github.com/lubosz/rosstacks/commits/arch_support

The following sequence of bash commands worked for me.

sudo easy_install-2.7 -U rosinstall
rosinstall ~/ros 'http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no'
git clone https://github.com/lubosz/rosstacks.git
cd rosstacks
git diff 67ca3..HEAD > arch.patch
cp arch.patch ~/ros/ros
cd ~/ros/ros
patch -p1 < arch.patch
#I use pacaur instead of yaourt for AUR installs. 
sudo ln -s /usr/bin/pacaur /usr/bin/yaourt
source ~/ros/setup.sh && rosmake ros ros_comm --rosdep-install

/!\ If you get an error not a recognized archive type: rosinstall: you have a file somewhere called 'rosinstall' in your current working directory. Delete this file and repeat the instructions above, or change to a different directory.

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall using pip (advanced options for pip):

  • sudo pip install -U rosinstall vcstools

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

  • 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=electric&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=electric&variant=desktop&overlay=no"

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

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

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

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=ros-base&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

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

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

Tutorials

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

Archlinux Installation Instructions

WARNING!!! Installing fuerte on Arch Linux can be done but it's not a clean or well documented process yet.:

  • You may find that additional pacman packages need to be installed in the setup phase.
  • Installing the core libraries does work but see the note if cmake fails.
  • Build higher-level/tools step works but be prepared to be a build ninja...

Prerequisites

Here's a list of Arch Linux packages to install before you get started.

  • sudo pacman -S python2 gcc boost cmake libyaml yaml-cpp python2-yaml python2-matplotlib python2-nose nvidia-cg-toolkit wxpython python-paramiko sip fltk sdl_image cppunit wxgtk swig python2-sip pygtk tinyxml zziplib python2-numpy python2-pyqt python-imaging netpbm intel-tbb lsb-release doxygen graphviz jshon

jshon is required for packer to execute correctly.

AUR Packages

You will need to build some packages from AUR. I use packer to do this but you can also do it by hand or with other build tools. First get packer which is just a bash script which adds extra capabilities to pacman.

  • git clone git://github.com/bruenig/packer.git

Now make packer executable with a "chmod a+x packer" add packer to your PATH, for example bash would be something like:

  • export PATH=~/packer:$PATH

Next use packer to build and install these packages from AUR.

  • packer -S log4cxx python-empy gtest assimp 

Note: As of this writing, python-empy does not support Python 3, but the package build system may attempt to use Python 3 to install it. To work around this, edit 'PKGBUILD' to use python2 to run setup.py, rather than python.

While you are at it you may as well install the AUR packages required for the higher-level build. Note: pcl-ros takes a while to build.

  • packer -S ros-on-arch qhull-ros pcl-ros swig-wx

Note: If you are using 64-bit Arch Linux, you may get an error about a conflict with gcc-libs-multilib. To resolve this, manually install gcc-libs-multilib with pacman. See this wiki page for further information.

The Python Issue

There are presently issues with the different ways Ubuntu and Arch deal with python. Basically Ubuntu has 'python' and 'python3' while Arch has 'python2' and 'python3' with /usr/bin/python linked to python3. Various techniques for handling this have been proposed. Select one of the following or add a technique if you have a suggestion.

Python Workaround 1

Link python -> python2

  • sudo rm /usr/bin/python
    sudo ln -s /usr/bin/python2 /usr/bin/python

WARNING: This has the potential to break a lot of system packages that expect /usr/bin/python to be python3 instead of python2.

Python Workaround 2

Since changing the link /usr/bin/python to point to python2 might have unforeseen side effects like breaking other packages that use python, fixing all #!/usr/bin/env python lines in ROS should be preferred. This can be done with the following shell command:

for file in $(grep -rl 'env python *$' .); do
    sed -i 's/env python *$/env python2/g' $file
done

Note: the command changes all python scripts without notification. Only execute it in your ROS directory.

Python Workaround 3

This seems to be necessary to get ROS to start compiling on the newest Arch Linux 64.

Run the following shell script in ~/ros-underlay:

for file in $(grep -rl '/usr/bin/python *$' .); do
        sed -i 's/\/usr\/bin\/python *$/\/usr\/bin\/python2/g' $file
done

Then rename the 'empy' cmake file.

mv ~/ros-underlay/catkin/cmake/empy.cmake ~/ros-underlay/catkin/cmake/python-empy.cmake

ROS Python Tools

You will need to install rosinstall and rospkg using easy_install (advanced options for easy_install):

  • sudo easy_install-2.7 -U rosinstall vcstools rospkg rosdep

SVN Based Install (download-and-compile)

There is an AUR package to automate the core libraries install (the 'install core libraries' step below). It's called ros-core

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 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.

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

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

cd ~/ros-underlay
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte -DSETUPTOOLS_DEB_LAYOUT=OFF
make -j8
sudo make install

Temporary Note: If the cmake step fails try changing the catkin entry in .rosinstall from 'wg-debs/catkin.git' to 'willowgarage/catkin.git'.

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.

NOTE: you may need to add another stack to .rosinstall

  • cat >> ~/ros/.rosinstall <<'==='
    - tar: {local-name: protobuf, uri: 'https://code.ros.org/svn/release/download/stacks/protobuf/protobuf-0.1.0/protobuf-0.1.0.tar.bz2',
        version: protobuf-0.1.0}
    ===

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

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

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

Build Higher-level/tools (Layer 2)

Note: This presently works but you will need to create a patch. See https://code.ros.org/trac/ros-pkg/ticket/5417 for clues The following should work:

  • cd ~/ros
    wget https://code.ros.org/trac/ros-pkg/raw-attachment/ticket/5417/ros.patch
    patch -p0 ros.patch

Also: you will need to create a link to https://github.com/hauptmech/rosdistro/raw/arch_pkgs3/rosdep/archlinux.yaml

  • sudo sh -c "echo 'yaml https://github.com/hauptmech/rosdistro/raw/arch_pkgs3/rosdep/archlinux.yaml' > /etc/ros/rosdep/sources.list.d/10-local.list"

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

Finally, build the ROS stacks using rosmake.

  • rosmake -a

Installation Instructions for Groovy in Arch Linux

This page describes how to install Groovy in Arch Linux. Arch Linux is not officially supported by ROS and the installation might fail for several reasons. This page does not (yet) contain instructions for most higher level ROS packages, only for the base system. This includes the middleware and command line tools but not much more.

Method 1: Using the AUR Packages

The current most straightforward way to install ROS Groovy is using the AUR packages that start with ros-groovy. Using a helper such as yaourt or packer, it is possible to install all packages related to ROS groovy and let the Arch Build System take care of all the dependencies involved. In the following simple examples I will be using yaourt, however, it is trivial to replace it with packer. In order to see what packages are avaible, simply use:

yaourt ros-groovy

Or view the list of packages online. It is then possible to install a specific subset of the packages (or all of them, using a string like 1-112).

In order to avoid all of the prompts when installing a large number of packages, the use of the following flag may be applied (be warned that you will NOT be prompted for confirmation on any of the packages, only for your password)

yaourt --noconfirm ros-groovy

Using this method, you will be asked only once for the password, and all following packages will be installed without asking the using to edit any PKGBUILD or confirm a package installation. Be warned that should a failure occur in one of the builds, you will not be able to edit a PKBUILD. You can, however, attempt to install that specific package alone and then restart the build process without having to reinstall every package. For instance, should the package ros-groovy-actionlib-msgs fail, you can check it separately with the following procedure:

yaourt -S ros-groovy-actionlib-msgs

Depending on where it fails, different actions are possible. To restart the building process without rebuilding all of the packages, a simple

yaourt --noconfirm --needed ros-groovy

and selecting the packages you want to install will suffice. Once this is done, you will have a complete ROS Groovy installation in /opt/ros/groovy, and you can proceed to follow the ROS Tutorials online. Note, however, that a few extra steps need to be taken:

First, install rosdep with

yaourt -S python2-rosdep

Then, initialize rosdep with

sudo rosdep init
rosdep update

Finally, when initializing a catkin workspace, as specified in the tutorial pages, instead of issuing the command

catkin_make

the flag "-DPYTHON_EXECUTABLE=/usr/bin/python2" will need to be added, as in

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2

This step will not be necessary when installing every package, but if an error occurs mentioning a version of python 3, then it will be needed in order to specify the right version. There are other ways to avoid this; one of them involves linking the python2 executable as follows:

mkdir ~/bin
ln -s /usr/bin/python2 ~/bin/python
export PATH=~/bin:$PATH

This will make it so that the python2 executable is found before the other one.

Method 2: Manual Build

This method grants a bit more control, but is more complicated and will still require the installation of several AUR packages.

Prerequisites

First, install a few dependencies.

sudo pacman -S python2 gcc boost cmake libyaml yaml-cpp python2-yaml python2-nose python2-paramiko python2-netifaces tinyxml lsb-release bzip2 python2-pip mercurial subversion git pkg-config jshon make

Now we need to build a few dependencies from source. For that, AUR Helpers are most useful. For instance, install packer.

wget https://aur.archlinux.org/packages/pa/packer/packer.tar.gz
tar -zxvf packer.tar.gz 
cd packer
makepkg PKGBUILD 
sudo pacman -U packer*.pkg.tar.xz

Install additional dependencies from source:

sudo packer -S python2-empy log4cxx gtest

For the Raspberry Pi , edit the files when prompted and change the arch= line into arch=('armv6h')

Finally, we need to install a few ROS python tools using pip2:

sudo pip2 install -U rospkg rosdep rosinstall catkin-pkg wstool

In order to use rosdep, we need to initialize it:

sudo rosdep init
rosdep update

Building ROS Base

First, check out all ROS base packages:

wstool init src -j8 http://prerelease.ros.org/rosinstall/generate/raw/groovy/ros_comm

This generates a CMakeLists.txt for Fuerte, so we need to get rid of it and link catkin's toplevel cmake file:

cd ~/groovy_underlay/src
ln -s catkin/cmake/toplevel.cmake CMakeLists.txt

Before we can actually invoke cmake, we first need to deal with the python issue. Arch uses Python 3 while ROS still requires Python 2. All we need to do is to fix all python shebang lines. The following command does that for us:

for file in $(grep -rl 'env python *$' .); do sed -i 's/env python *$/env python2/g' $file ;done

or just follow the suggested Archlinux fix by creating a bin directory within your home directory and set a link to the Python 2.7 executable.

$ mkdir ~/bin
$ ln -s /usr/bin/python2 ~/bin/python
$ export PATH=~/bin:$PATH

Now it's time for configuring the build:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/groovy -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so -DSETUPTOOLS_DEB_LAYOUT=OFF

The configure should not throw an error. After running it, we can finally build and install ROS:

However, I first had to edit src/genmsg/src/genmsg/gentools.py and chenge line 90 from return buff.getvalue().strip() into return buff.getvalue().strip().encode('utf-8')

make -j8
sudo make install

This will install everything in /opt/ros/groovy. To use our freshly built ROS installation, we need to source its setup file:

source /opt/ros/groovy/setup.bash

Community

If you would like to contribute to packaging ROS on Arch try [https://wiki.archlinux.org/index.php/Talk:Ros]

Installation Instructions for Hydro in Arch Linux

This page describes how to install Hydro in Arch Linux. Arch Linux is not officially supported by ROS and the installation might fail for several reasons. This page does not (yet) contain instructions for most higher level ROS packages, only for the base system. This includes the middleware and command line tools but not much more.

Method 1: Using the AUR Packages

Installing an AUR helper

First, install base-devel that contains everything needed by makepkg to compile packages on Arch Linux:

pacman -S base-devel

The current most straightforward way to install ROS Hydro is using the AUR packages that start with ros-hydro. Using a helper such as yaourt or packer, it is possible to install all packages related to ROS Hydro and let the Arch Build System take care of all the dependencies involved.

To install yaourt, you can add the archlinuxfr repository to /etc/pacman.conf:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Then, simply run:

pacman -Sy yaourt

Or if you decide to go for packer:

pacman -Sy packer

Preliminary configuration

Some settings will make the installation process faster:

  • Set MAKEFLAGS in /etc/makepkg.conf to the number of threads you want to use when compiling. If you want to use the maximum of threads for your system, use the value given by nproc. For instance, if you have 4 cores, use MAKEFLAGS="-j4". If you want to be able to use your computer while installing ROS without much of a performance hit, you may want to lower this value.

You should also make sure that [core], [extra] and possibly [community] are enabled in your /etc/pacman.conf, since some dependencies are part of these official repositories.

Installing AUR Packages

In the following simple examples I will be using yaourt, however, it is trivial to replace it with packer. In order to see what packages are avaible, simply use:

yaourt ros-hydro

Or view the list of packages online. It is then possible to install a specific subset of the packages (or all of them, using a string like 1-112).

In order to avoid all of the prompts when installing a large number of packages, the use of the following flag may be applied (be warned that you will NOT be prompted for confirmation on any of the packages, only for your password)

yaourt --noconfirm ros-hydro

Using this method, you will be asked only once for the password, and all following packages will be installed without asking the using to edit any PKGBUILD or confirm a package installation. Be warned that should a failure occur in one of the builds, you will not be able to edit a PKBUILD. You can, however, attempt to install that specific package alone and then restart the build process without having to reinstall every package. For instance, should the package ros-hydro-actionlib-msgs fail, you can check it separately with the following procedure:

yaourt -S ros-hydro-actionlib-msgs

Depending on where it fails, different actions are possible. To restart the building process without rebuilding all of the packages, a simple

yaourt --noconfirm --needed ros-hydro

and selecting the packages you want to install will suffice. Once this is done, you will have a complete ROS Hydro installation in /opt/ros/hydro, and you can proceed to follow the ROS Tutorials online. Note, however, that a few extra steps need to be taken:

First, install rosdep with

yaourt -S python2-rosdep

Then, initialize rosdep with

sudo rosdep init
rosdep update

Some users could experience problems with the last command. In this case, remove the python2-rosdep package and install python2-pip. Therefore, rosdep could be installed using pip2. In the following, these steps are summarized:

yaourt -Rsc python2-rosdep
yaourt -S python2-pip
sudo pip2 install -U rosdep

Therefore, init and update rosdep:

sudo rosdep init
rosdep update

Finally, when initializing a catkin workspace, as specified in the tutorial pages, instead of issuing the command

catkin_make

some Python 2 flags will need to be added, as in

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

This step will not be necessary when installing every package, but if an error occurs mentioning a version of Python 3, then it will be needed in order to specify the right version.

There are other ways to avoid this; one of them involves linking the python2 executable as follows:

mkdir ~/bin
ln -s /usr/bin/python2 ~/bin/python
# Then
alias python=~/bin/python
# or:
export PATH=~/bin:$PATH

This will make it so that the python2 executable is found before the other one. HOWEVER, if you install AUR packages that rely on the python executable, the Python 2 version will be installed instead of the Python 3 version.

Thus, you should create a shell function that sets everything ROS-related, and run that function when you want to use some shells for ROS. For instance, you can add something like this in your ~/.bashrc:

# ROS
hydro() {
  source /opt/ros/hydro/setup.bash
  export ROS_PACKAGE_PATH=/path/to/your/your/package/path:$ROS_PACKAGE_PATH
  export PYTHONPATH=/opt/ros/hydro/lib/python2.7/site-packages:$PYTHONPATH
  export PKG_CONFIG_PATH="/opt/ros/hydro/lib/pkgconfig:$PKG_CONFIG_PATH"
  alias python=/usr/bin/python2

  # Gazebo
  source /usr/share/gazebo/setup.sh
}

Then, in a shell:

$ hydro
$ roscore

Adding New AUR Packages

If you want to help packaging for Arch Linux, you can use import_catkin_packages.py available in ros-build-tools. You can fork arch-ros-stacks and contribute by doing this:

# Go to ros-build-tools upstream scripts
cd /path/to/arch-ros-stacks/dependencies/ros-build-tools

# List available packages
python2 import_catkin_packages.py --distro=hydro --output-directory=/path/to/arch-ros-stacks/hydro --list | less

# Generate PKGBUILD for a given package and its dependencies
python2 import_catkin_packages.py --distro=hydro --output-directory=/path/to/arch-ros-stacks/hydro -r package_name

# Go to newly created package(s) directory
cd ../../hydro/package_name

# Build, install, add to Git and create AUR source tarball
# You may need to apply some patches in the PKGBUILD (e.g. for Ogre 1.8)
# mkaurball is available in pkgbuild-introspection [community], and
# automatically generates the .AURINFO file
makepkg -if && git add PKGBUILD && mkaurball

After that, you can upload the new package's *.src.tar.gz to the AUR, commit and make a pull request on GitHub. Thus, other Arch Linux users will be able to install your package by simply typing:

yaourt ros-hydro-package-name

Note that you can also create PKGBUILDs manually (just copy another package's PKGBUILD and adapt it), but the automatic process is probably the safest option, since it gets the latest release version, the adequate dependencies, the short description etc.

Method 2: Manual Build

This method grants a bit more control, but is more complicated and will still require the installation of several AUR packages.

Prerequisites

TBD

Building ROS Base

TBD

Community

If you would like to contribute to packaging ROS on Arch, check arch-ros-stacks on GitHub (as explained in #1.2), or even [https://wiki.archlinux.org/index.php/Talk:Ros].

Installation Instructions for Indigo in Arch Linux

This page describes how to install Indigo in Arch Linux. Arch Linux is not officially supported by ROS and the installation might fail for several reasons. This page does not (yet) contain instructions for most higher level ROS packages, only for the base system. This includes the middleware and command line tools but not much more.

Method 1: Using the AUR Packages

Installing an AUR helper

First, install base-devel that contains everything needed by makepkg to compile packages on Arch Linux:

pacman -S base-devel

The current most straightforward way to install ROS Indigo is using the AUR packages that start with ros-indigo. Using a helper such as yaourt or packer, it is possible to install all packages related to ROS Indigo and let the Arch Build System take care of all the dependencies involved.

To install yaourt, you can add the archlinuxfr repository to /etc/pacman.conf:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Then, simply run:

pacman -Sy yaourt

Or if you decide to go for packer:

pacman -Sy packer

Preliminary configuration

Some settings will make the installation process faster:

  • Set MAKEFLAGS in /etc/makepkg.conf to the number of threads you want to use when compiling. If you want to use the maximum of threads for your system, use the value given by nproc. For instance, if you have 4 cores, use MAKEFLAGS="-j4". If you want to be able to use your computer while installing ROS without much of a performance hit, you may want to lower this value.

You should also make sure that [core], [extra] and possibly [community] are enabled in your /etc/pacman.conf, since some dependencies are part of these official repositories.

Python version

Arch Linux uses Python 3 as its default version, and starting with Indigo, Python 3 is now supported in ROS. However, since several non-core packages have not been fixed for Python 3 yet, we still rely on Python 2.

Since Python 3 is not fully compatible with Python 2, some extra options have to be provided to catkin_make and/or cmake to make sure that the proper Python executable, headers and libraries are used.

Installing AUR Packages

In the following simple examples I will be using yaourt, however, it is trivial to replace it with packer. In order to see what packages are avaible, simply use:

yaourt ros-indigo

Or view the list of packages online. It is then possible to install a specific subset of the packages (or all of them, using a string like 1-112).

In order to avoid all of the prompts when installing a large number of packages, the use of the following flag may be applied (be warned that you will NOT be prompted for confirmation on any of the packages, only for your password)

yaourt --noconfirm ros-indigo

Using this method, you will be asked only once for the password, and all following packages will be installed without asking the using to edit any PKGBUILD or confirm a package installation. Be warned that should a failure occur in one of the builds, you will not be able to edit a PKBUILD. You can, however, attempt to install that specific package alone and then restart the build process without having to reinstall every package. For instance, should the package ros-indigo-actionlib-msgs fail, you can check it separately with the following procedure:

yaourt -S ros-indigo-actionlib-msgs

Depending on where it fails, different actions are possible. To restart the building process without rebuilding all of the packages, a simple

yaourt --noconfirm --needed ros-indigo

and selecting the packages you want to install will suffice. Once this is done, you will have a complete ROS Indigo installation in /opt/ros/indigo, and you can proceed to follow the ROS Tutorials online. Note, however, that a few extra steps need to be taken:

First, install rosdep with

yaourt -S python2-rosdep

Then, initialize rosdep with

sudo rosdep init
rosdep update

Some users could experience problems with the last command. In this case, remove the python2-rosdep package and install python2-pip. Therefore, rosdep could be installed using pip2. In the following, these steps are summarized:

yaourt -Rsc python2-rosdep
yaourt -S python2-pip
sudo pip2 install -U rosdep

Therefore, init and update rosdep:

sudo rosdep init
rosdep update

User configuration

Finally, when initializing a catkin workspace, as specified in the tutorial pages, instead of issuing the command:

catkin_make

some Python 2 flags will need to be added, as in:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

This step will not be necessary when installing every package, but if an error occurs mentioning a version of Python 3, then it will be needed in order to specify the right version.

To make things easier, you should create a shell function that sets everything ROS-related, and run that function when you want to use some shells for ROS. For instance, you can add something like this in your ~/.bashrc:

# ROS
indigo() {
  source /opt/ros/indigo/setup.bash
  export PYTHONPATH=/opt/ros/indigo/lib/python2.7/site-packages:$PYTHONPATH
  export PKG_CONFIG_PATH="/opt/ros/indigo/lib/pkgconfig:$PKG_CONFIG_PATH"
  # Optionally, you can set:
  #export ROS_PACKAGE_PATH=/path/to/your/package/path:$ROS_PACKAGE_PATH

  # Useful aliases
  alias catkin_make="catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so"

  # If you use Gazebo:
  #source /usr/share/gazebo/setup.sh
}

Then, in a shell:

$ indigo
$ roscore

Adding New AUR Packages

If you want to help packaging for Arch Linux, you can use import_catkin_packages.py available in arch-ros-stacks. You can fork arch-ros-stacks and contribute by following the instructions in the README.

If you do push your packages to the AUR, other Arch Linux users will be able to install your package by simply typing:

yaourt ros-indigo-package-name

Note that you can also create PKGBUILDs manually (just copy another package's PKGBUILD and adapt it), but the automatic process is probably the safest option, since it gets the latest release version, the adequate dependencies, the short description etc.

Method 2: Manual Build

This method grants a bit more control, but is more complicated and will still require the installation of several AUR packages.

Prerequisites

TBD

Building ROS Base

TBD

Community

If you would like to contribute to packaging ROS on Arch, check arch-ros-stacks on GitHub (as explained in #1.2), or even [https://wiki.archlinux.org/index.php/Talk:Ros].

Arch Linux install of ROS Melodic

Arch Linux packages are available for the following architectures.

Version

amd64

i686

arm

armv6h

armv7h

aarch64

Arch Linux

X

X

X

X

X

X

Installation

Before you start

Since you'll be installing a lot of packages, it is recommended to use an AUR helper like yay or pikaur. You can find a larger more verbose list of AUR helpers within the ArchLinux wiki page for AUR helpers. This tutorial will assume the use of yay as the AUR helper.

It is also recommended to use the arch4edu repository. They are hosting many packages related to education and research, including robotics. Adding a repository allows for you to install binaries of packages, instead of compiling them from source. This will greatly speed up your installation time. Visit here to add and use arch4edu.

Installation

There are many different libraries and tools in ROS. We provided three default configurations to get you started. You can also install ROS packages individually.

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

    • yay -S ros-melodic-desktop-full

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

    • yay -S ros-melodic-desktop

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

    • yay -S ros-melodic-ros-base

    Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

    • yay -S ros-melodic-PACKAGE
      • e.g.
      yay -S ros-melodic-slam-gmapping

To find available packages, use:

yay -Ss ros-melodic

Initialize rosdep

Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

sudo rosdep init
rosdep update

Environment setup

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

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

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

If you just want to change the environment of your current shell, instead of the above you can type:

source /opt/ros/melodic/setup.bash

If you use zsh instead of bash you need to run the following commands to set up your shell:

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

Tutorials

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


2024-12-21 13:03