wiki:ROSOnFedora

Version 1 (modified by thofmann, 3 months ago) (diff)

--

ROS on Fedora

This page contains information about how to use ROS on Fedora.

ROS COPR

The easiest way to install ROS is to use the ROS COPR. The COPR contains a set of Fedora packages for ROS. The COPR currently only has packages for kinetic. The installation instructions are on the COPR page.

If you installed the ROS COPR, you do not need to follow the rest of this page!

Building ROS locally

If you do not want to or cannot use the ROS COPR, you can also build ROS locally on your machine.

Alternatively, you can find the official guide here. This assumes installation in /opt/ros (which should belong to a user other than root). We leave out rosdep since it is not well maintained and fawkes-devenv will take care of everything we need. The instructions are for ROS Indigo and Kinetic, replacing the name with others should also work (it does for indigo, hydro requires a patch if used with system Gazebo).

Kinetic (tested for Fedora 25)

Install the following dependencies (in addition to the Fawkes dependencies).

sudo dnf install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build python-qt5-devel python-defusedxml

Since Fedora 27 you need additionally the tinyxml packages (both version 1 and 2).

sudo dnf install tinyxml tinyxml-devel tinyxml2 tinyxml2-devel

Make qmake visible for the system by executing the following as admin

echo "export PATH=/usr/lib64/qt5/bin/:$PATH" > /etc/profile.d/qt5-qmake.sh
source /etc/profile

First create a working directory. The chosen format allows for well separable parallel installations of multiple versions.

mkdir -p /opt/ros/catkin_ws_kinetic
cd /opt/ros/catkin_ws_kinetic

Then download and build the packages. This will take some time and requires decent bandwidth.

rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall
wstool init -j8 src kinetic-desktop-wet.rosinstall

rosinstall_generator navigation --rosdistro kinetic --deps --wet-only --tar > kinetic-navigation.rosinstall
rosinstall_generator ar_track_alvar --rosdistro kinetic --deps --wet-only --tar > kinetic-ar_track_alvar.rosinstall
wstool merge -t src kinetic-navigation.rosinstall
wstool merge -t src kinetic-ar_track_alvar.rosinstall
wstool update -t src

Next, build the whole workspace (you may also build with RelWithDebInfo if you want to be able to step into ROS code for debugging). We add the "-DENABLE_PRECOMPILED_HEADERS=OFF" flag to fix a build issue with OpenCV 3.

./src/catkin/bin/catkin_make_isolated --install --install-space=/opt/ros/kinetic \
  -DCMAKE_BUILD_TYPE=Release -DENABLE_PRECOMPILED_HEADERS=OFF

Add the setup.bash to your .bashrc

echo 'source /opt/ros/kinetic/setup.bash' >> ~/.bashrc
source ~/.bashrc 

Indigo (Tested for Fedora 23, 24 and 25)

If you use Fedora 25, do not install ar_track_alvar. It requires OpenCV 2.4 and is not currently compatible with OpenCV 3.1 that comes with Fedora 25.

Install the following dependencies (in addition to the Fawkes dependencies).

sudo dnf install python3-rosinstall_generator python3-rosinstall
# The following is necessary for ROS Kinetic
sudo dnf install python-qt5-devel python3-qt5-devel python2-defusedxml

First create a working directory. The chosen format allows for well separable parallel installations of multiple versions.

mkdir -p /opt/ros/catkin_ws_indigo
cd /opt/ros/catkin_ws_indigo

Then download and build the packages. This will take some time and requires decent bandwidth.

rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall
wstool init -j8 src indigo-desktop-full-wet.rosinstall

rosinstall_generator navigation --rosdistro indigo --deps --wet-only --tar > indigo-navigation.rosinstall
rosinstall_generator ar_track_alvar --rosdistro indigo --deps --wet-only --tar > indigo-ar_track_alvar.rosinstall
wstool merge -t src indigo-navigation.rosinstall
# Skip the following line (and only the following line) on Fedora 25
wstool merge -t src indigo-ar_track_alvar.rosinstall
wstool update -t src

If you build on a system that uses C++14 by default, e.g., Fedora 24 or later, additionally do the following.

curl -o stage-fixes.patch https://github.com/rtv/Stage/commit/a1110d12691ab2d3679c7a028f97848a465c0dbe.patch
curl -o stage-cpp11.patch https://patch-diff.githubusercontent.com/raw/rtv/Stage/pull/62.patch
curl -o rviz-cpp11.patch https://github.com/ros-visualization/rviz/commit/311fd949913dbc6ad3e989b8ceb6ef2b04292350.patch
pushd src/stage
patch -p1 < ../../stage-fixes.patch
patch -p1 < ../../stage-cpp11.patch
popd
# The following is for ROS Indigo only, not Kinetic!
pushd src/rviz
patch -p1 < ../../rviz-cpp11.patch
popd

Next, build the whole workspace (you may also build with RelWithDebInfo if you want to be able to step into ROS code for debugging).

./src/catkin/bin/catkin_make_isolated --install --install-space=/opt/ros/indigo -DCMAKE_BUILD_TYPE=Release

Add the setup.bash to your .bashrc

echo 'source /opt/ros/indigo/setup.bash' >> ~/.bashrc
source ~/.bashrc