[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

Gentoo Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo mkdir -p /etc/portage
sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
sudo emerge -u pyyaml cmake subversion hgsubversion gentoolkit setuptools

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

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.

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.

Gentoo Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo mkdir -p /etc/portage
sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
sudo emerge -u pyyaml cmake subversion mercurial gentoolkit setuptools sudo

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.

Gentoo Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo mkdir -p /etc/portage
sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
sudo emerge -u pyyaml cmake subversion mercurial gentoolkit setuptools layman sudo
sudo layman -f
sudo layman -a lorelei
sudo bash -c 'echo source /var/lib/layman/make.conf >> /etc/make.conf'
sudo bash -c 'echo media-libs/assimp >> /etc/portage/package.keywords'
sudo bash -c 'echo media-libs/freeimage >> /etc/portage/package.keywords'

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

Rviz

If you're having trouble getting rviz to run, take a look at this question

Tutorials

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

Gentoo Linux Installation Instructions

SVN Based Install (download-and-compile)

Setup

sudo mkdir -p /etc/portage
sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
sudo emerge -u pyyaml cmake subversion mercurial gentoolkit setuptools layman sudo
sudo layman -f
sudo layman -a lorelei
sudo bash -c 'echo source /var/lib/layman/make.conf >> /etc/make.conf'
sudo bash -c 'echo media-libs/assimp >> /etc/portage/package.keywords'
sudo bash -c 'echo media-libs/freeimage >> /etc/portage/package.keywords'

TODO: need installation line for other ROS Fuerte dependencies, e.g. boost, python-yaml, apr, gtest, python-paramiko

Partial List:

sudo emerge -u boost gtest log4cxx wxpython dev-python/pip
sudo pip install empy rospkg nose

Confirm that python2 is selected as python3 is not fully supported as of 2012/11/12. Also ensure that a version of wxwidgets is selected.

eselect python list
sudo eselect python set python2

eselect wxwidgets list
sudo eselect wxwidgets set 1

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

Rviz

If you're having trouble getting rviz to run, take a look at this question

Tutorials

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

Installing on Gentoo from source

Install from source requires that you download and compile the source code on your own.

Install Necessary System Tools

Assuming you have not done so, it would be a good idea to emerge the package sudo at this time. We're going to add a line to the make.conf file, as well (assuming you don't already have it there).

As root:

# emerge sudo
# echo 'EMERGE_DEFAULT_OPTS="--autounmask-write y"' >> /etc/portage/make.conf

If you get the line (below) stating that the packages are masked during an emerge command (likely, given the quantity), run the command "sudo etc-update". It will update the appropriate configuration files.

Many of ROS's Python libs still depend on Python2.7 so you will likely need to switch.

$ sudo eselect python list
$ sudo eselect python set <num> # choose python2.7
$ sudo python-updater

The following mask changes are necessary to proceed:

Now continue with the dependencies for ROS. Log in as a standard user.

$ sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
$ sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
$ sudo emerge -u pyyaml git cmake subversion mercurial gentoolkit setuptools layman 
$ sudo layman -a lorelei
$ sudo bash -c 'echo source /var/lib/layman/make.conf >> /etc/make.conf'
$ sudo bash -c 'echo media-libs/assimp >> /etc/portage/package.keywords'
$ sudo bash -c 'echo media-libs/freeimage >> /etc/portage/package.keywords'
$ sudo emerge -u boost gtest log4cxx wxpython dev-python/pip dev-libs/apr
  dev-python/paramiko dev-libs/poco dev-cpp/eigen dev-libs/tinyxml dev-python/PyQt4
  dev-cpp/yaml-cpp dev-libs/boost[python] media-libs/opencollada
$ sudo pip-python2.7 install -U empy nose wstool rosdep rosinstall rospkg catkin-pkg Distribute

Now you need to build the library COLLADA-DOM from source. Unfortunately, this library is not currently part of portage. As this is a large package, it will take some time to build (but, since you run Gentoo, you're probably quite used to it).

$ sudo mkdir -p /usr/local/src
$ sudo chown `echo $USER` /usr/local/src 
$ cd /usr/local/src/
$ svn co https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/trunk colladadom
$ cd colladadom
$ sudo nano -w /etc/portage/make.conf

Now you need to change your USE flags and recompile zlib (with minizip). For clarity, do not add the "...", just add the word "minizip" in front of what already exists in the file.

USE = "minizip ..."

$ sudo emerge zlib
$ cmake .
$ make
$ sudo make install
$ sudo ldconfig

At this point, it is highly suggested that you run python-update. This will make sure your packages are happy and healthy.

$ sudo python-updater

Now you need to clone and install rosinstall_generator from scratch.

$ cd ~
$ git clone https://github.com/ros-infrastructure/rosinstall_generator
$ cd rosinstall_generator
$ sudo python setup.py install

At this point, you've likely altered your system quite significantly. So, it is a very good idea to update your packages. This will definitely take a while. This will build your packages that need updating, as well as recompiling those that have been altered significantly by the installation process. You probably do not have to do this, but it is much safer if you do.

$ sudo emerge-webrsync
$ sudo emerge --sync
$ sudo emerge --update --changed-use --deep --with-bdeps=y @world

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

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

  • $ rosinstall_generator desktop-full --rosdistro groovy --deps --wet-only > groovy-desktop-full-wet.rosinstall
    $ wstool init -j8 src groovy-desktop-full-wet.rosinstall

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

  • $ rosinstall_generator desktop --rosdistro groovy --deps --wet-only > groovy-desktop-wet.rosinstall
    $ wstool init -j8 src groovy-desktop-wet.rosinstall

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

  • $ rosinstall_generator ros_comm --rosdistro groovy --deps --wet-only > groovy-ros_comm-wet.rosinstall
    $ wstool init -j8 src groovy-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro groovy --deps --wet-only > groovy-robot-wet.rosinstall
$ wstool init -j8 src groovy-robot-wet.rosinstall

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/groovy argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/groovy just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Build the rosbuild Packages

Now that you have the catkin ROS packages built and sourced, you can build any of the packages and stacks using the rosbuild build system.

Create a rosbuild workspace

Note: You do not need to do this part of the installation for the ROS-Comm: (Bare Bones) variant as it does not contain any rosbuild packages in it.

Like with building catkin packages, it is convenient to build rosbuild packages in a workspace. Lets create a ROS workspace using rosws:

  • $ mkdir ~/ros_ws
    $ cd ~/ros_ws
    $ rosws init . ~/ros_catkin_ws/install_isolated

Note that we are pointing the ROS workspace to the catkin install location that we built in the previous step. This allows the ROS workspace to always source the catkin install location environment before you use the ROS workspace.

Download ROS Stacks

Now we need to get the dry (rosbuild) components of the variant you chose before. Use the corresponding command for your variant to do this:

Desktop-Full Install: 2d/3d simulators, navigation, robot models and several tutorial stacks

  • $ rosinstall_generator desktop-full --rosdistro groovy --deps --dry-only > groovy-desktop-full-dry.rosinstall
    $ rosws merge groovy-desktop-full-dry.rosinstall

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

  • $ rosinstall_generator desktop --rosdistro groovy --deps --dry-only > groovy-desktop-dry.rosinstall
    $ rosws merge groovy-desktop-dry.rosinstall

Now this just setups your rosbuild workspace, you need to tell rosws to fetch the packages still:

  • $ rosws update -j8

Build the ROS Stack

Once this is done fetching the stack you can source this workspace and then build the stack:

  • $ source ~/ros_ws/setup.bash
    $ rosmake -a

Installing On Gentoo

Gentoo installation is rather experimental at the moment. The installation is quite functional, though. Notice: on Funtoo Linux, the following instructions work, but you will need to make several modifications (so proceed at your own risk).

Prerequisites

Selecting Python 2.7

Currently, we need to use Python-2.7. To do so, we will use eselect.

  • # eselect python list
      Available Python interpreters:
        [1]   python2.7 *
        [2]   python3.3

Then do the following command to select 2.7.

  • # eselect python set 1

We will also install some other libraries for ROS, such as OpenCV, Gazebo and Bullet.

  • # emerge sci-physics/bullet sci-electronics/gazebo media-libs/opencv --jobs --load-average `nproc`

If gazebo fails to install, which is highly probable at the moment, omit it from the above command:

# emerge sci-physics/bullet media-libs/opencv --jobs --load-average `nproc`

Installing the Overlay

Before proceeding, the necessary tools for installing ROS must be installed on your system. To do so, you need to install Layman, an overlay manager for Gentoo.

  • # emerge layman -vaj
    # echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf

Now we add the overlay with the necessary Gentoo packages.

  • # layman -f -o https://raw.githubusercontent.com/ros/ros-overlay/master/overlay.xml -a ros-overlay
    # emerge --sync

Now we install the necessary tools for installation.

  • # emerge rosdep rosinstall_generator wstool rosinstall catkin_pkg
    # pip install --upgrade setuptools

Next, add the following lines to the end of /etc/portage/package.use.

  • # required by ROS
    sys-libs/zlib minizip
    dev-libs/boost python

At this point, it is strongly advised that you perform a full system update.

  • # emerge --sync
    # emerge -uDNvaj @world --load-average `nproc`

Initializing rosdep

$ sudo rosdep init
$ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install.

  • $ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop_full-wet.rosinstall
    $ wstool init -j8 src jade-desktop_full-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro jade -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Lastly, we need to do the following:

  • $ echo 'PYTHONPATH="/opt/ros/jade/lib64/python2.7/site-packages"' >> ~/.bashrc
    $ source ~/.bashrc

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ sudo PYTHONPATH="/opt/ros/jade/lib64/python2.7/site-packages" ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/jade -DSETUPTOOLS_DEB_LAYOUT=OFF

At the time of writing, you will need to use a more up to date version of image pipeline, as OpenCV has just made a major bump (2.0 -> 3.0):

$ rm -rf src/image_pipeline
$ git clone https://github.com/ros-perception/image_pipeline

Should your Gazebo installation fail, you may remove gazebo from the source directory and proceed with the rest of the install.

$ rm -rf src/gazebo_ros_pkgs

Now the packages should have been installed to /opt/ros/jade/ or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source /opt/ros/jade/setup.bash

To verify that your ROS install is operational, try and run roscore. You should get something similar to the image below.

roscore running on Gentoo Linux

Post-Installation Instructions

Creating a Workspace

It's recommended that you do your work in a separate ros workspace. To make one named catkin_ws, run the following.

  • $ mkdir -p ~/catkin_ws/src
    $ cd ~/catkin_ws/src && catkin_init_workspace
    & cd ../ && catkin_make

Editing Environment Variables

Now we add some lines to our ~/.bashrc file. Add these lines, replacing catkin_ws with the name you chose above.

  • PYTHONPATH="/opt/ros/jade/lib/python2.7/site-packages:/opt/ros/jade/lib64/python2.7/site-packages/"
    source /opt/ros/jade/setup.bash
    source ~/catkin_ws/devel/setup.bash

Install GMapping

Next we demonstrate how to install extra packages, such as GMapping.

  • $ roscd && cd ../src
    $ git clone https://github.com/ros-perception/openslam_gmapping
    $ git clone https://github.com/ros-perception/slam_gmapping
    $ cd ../ && catkin_make

with luck, you should now have GMapping.

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i jade-desktop_full-wet.rosinstall jade-desktop_full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop_full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u jade-desktop_full-wet.rosinstall jade-desktop_full-wet.rosinstall.old

If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src jade-desktop_full-wet.rosinstall
$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash

Gentoo install of ROS Kinetic

We are automatically generating the Ebuilds for Gentoo. Please note that there are also packages available from the Gentoo developers, but those packages are incomplete. Also note that these are being automatically generated from the rosdistro file, and there are a number of unresolved dependencies for some packages.

Should your package fail to emerge, please report an issue on the ros-overlay repo.

If you need to install from source (not recommended), please see source (download-and-compile) installation instructions.

If you rely on these packages, please support OSRF.

These ebuilds are generated and hosted on infrastructure maintained and paid for by the Open Source Robotics Foundation, a 501(c)(3) non-profit organization. If OSRF were to receive one penny for each downloaded package for just two months, we could cover our annual costs to manage, update, and host all of our online services. Please consider donating to OSRF today.

Installation

First, set the following in /etc/portage/profile/eapi.

6

Next, you need to add the ros-overlay sources to your emaint configuration.

# mkdir /etc/portage/repos.conf

Add the following to the file /etc/portage/repos.conf/ros-overlay.conf

[ros-overlay]
location = /usr/local/portage
sync-type = git
sync-uri = https://github.com/ros/ros-overlay
auto-sync = yes
masters = gentoo

Then synchronize the repository.

# emaint sync -r ros-overlay

While Python 3 works for most of the libraries in ROS, there are still many components that rely on Python 2, making it the recommended choice for installation.

This implies you'll need to use eselect python to choose Python2.7 and add to /etc/portage/package.use:

ros-kinetic/* PYTHON_TARGETS: -* python2_7
ros-kinetic/* PYTHON_SINGLE_TARGET: -* python2_7

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

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

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

    • # emerge ros-kinetic/desktop_full --ask

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

    • # emerge ros-kinetic/desktop --ask

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

    • # emerge ros-kinetic/ros_base

    Individual Package: You can also install a specific ROS package:

# emerge ros-kinetic/PACKAGE

e.g.

# emerge ros-kinetic/slam_gmapping

To find available packages, use:

ls /usr/local/portage/ros/ros-kinetic

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

Getting rosinstall

rosinstall is a frequently used command-line tool in ROS that is distributed separately. It enables you to easily download many source trees for ROS packages with one command.

To install this tool on Gentoo, run:

# emerge dev-python/rosinstall

Build farm status

todo!

Tutorials

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

Gentoo install of ROS Lunar

We are automatically generating the Ebuilds for Gentoo. Please note that there are also packages available from the Gentoo developers, but those packages are incomplete. Also note that these are being automatically generated from the rosdistro file, and there are a number of unresolved dependencies for some packages.

Should your package fail to emerge, please report an issue on the ros-overlay repo.

If you need to install from source (not recommended), please see source (download-and-compile) installation instructions.

If you rely on these packages, please support OSRF.

These ebuilds are generated and hosted on infrastructure maintained and paid for by the Open Source Robotics Foundation, a 501(c)(3) non-profit organization. If OSRF were to receive one penny for each downloaded package for just two months, we could cover our annual costs to manage, update, and host all of our online services. Please consider donating to OSRF today.

Installation

First, set the following in /etc/portage/profile/eapi.

6

Next, you need to add the ros-overlay sources to your emaint configuration.

# mkdir /etc/portage/repos.conf

Add the following to the file /etc/portage/repos.conf/ros-overlay.conf

[ros-overlay]
location = /usr/local/portage
sync-type = git
sync-uri = https://github.com/ros/ros-overlay
auto-sync = yes
masters = gentoo

Then synchronize the repository.

# emaint sync -r ros-overlay

While Python 3 works for most of the libraries in ROS, there are still many components that rely on Python 2, making it the recommended choice for installation.

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

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

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

    • # emerge ros-lunar/desktop_full --ask

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

    • # emerge ros-lunar/desktop --ask

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

    • # emerge ros-lunar/ros_base

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

# emerge ros-lunar/PACKAGE

e.g.

# emerge ros-lunar/slam_gmapping

To find available packages, use:

ls /usr/local/portage/ros/ros-lunar

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

Getting rosinstall

rosinstall is a frequently used command-line tool in ROS that is distributed separately. It enables you to easily download many source trees for ROS packages with one command.

To install this tool on Gentoo, run:

# emerge dev-python/rosinstall

Build farm status

todo!

Tutorials

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


2024-03-23 12:18