Note: Setting up ROS Hydro on Raspberry Pi. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Installing ROS Hydro on Raspberry Pi
Description:Tutorial Level:
Contents
Introduction
This tutorial shows how to get ROS Hydro installed on the Raspberry Pi. This requires an installation from source, and all this information should be available elsewhere on the internet.
Installation
I went through this procedure 3 times to make sure it works. I'm sure this is not the only way to make it work, and probably not the best way. There may even be errors. Please feel free to update this wiki if you find something that should be fixed.
- Start with NOOBS. There are several ways to do this, and plenty of tutorials on the internet.
- Install Raspbian from NOOBS.
- Install repositories:
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu raring main" > /etc/apt/sources.list.d/ros-latest.list' $ wget http://packages.ros.org/ros.key -O - | sudo apt-key add - $ sudo apt-get update $ sudo apt-get upgrade
- Install the dependencies:
$ sudo apt-get install python-pip $ sudo pip install rosdistro $ sudo pip install wstool
- Install setup tools:
$ cd ~/Downloads $ wget https://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz $ tar xvf setuptools-1.1.6.tar.gz $ cd setuptools-1.1.6 $ sudo python setup.py install
- Install stdeb:
$ sudo apt-get install python-stdeb
Install dependencies
$ sudo pip install rosdep $ sudo pip install rosinstall-generator $ sudo pip install wstool $ pip install -U rospkg $ sudo apt-get install python-rosdep python-rosinstall-generator build-essential
Now continue from the Hyrdo install from source page. This downloads all the packages, and takes a couple hours.
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws $ rosinstall_generator ros_comm --rosdistro hydro --deps --wet-only > hydro-ros_comm-wet.rosinstall $ wstool init -j8 src hydro-ros_comm-wet.rosinstall $ sudo rosdep init $ rosdep update $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy
Now the rosdep fails :
Package sbcl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: sbcl-source sbcl-doc E: Package 'sbcl' has no installation candidate ERROR: the following rosdeps failed to install apt: command [sudo apt-get install -y sbcl] failed
Apparently the roslisp package uses sbcl, which is not available for the pi, so we have to remove that.
$ cd src $ wstool rm roslisp $ rm -rf roslisp $ cd .. $ $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy
Variant: It also worked under Raspbian Jessie, by specifying --os=debian:jessie
That worked! Now it's time to try building it:
$ ./src/catkin/bin/catkin_make_isolated --install
Success!!!!
Make sure you reference the newly created install:
$ cd ~ $ echo "source ~/ros_catkin_ws/install_isolated/setup.bash" >> .bashrc $ source .bashrc
Installing new packages
I'm not completely sure of the best way to install new packages, but I think this works:
$ cd ~/ros_catkin_ws/src $ roslocate info turtlesim | rosws merge - $ rosws update $ cd .. $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy $ ./src/catkin/bin/catkin_make_isolated --install
Variant: It also worked under Raspbian Jessie, by specifying --os=debian:jessie
Broken packages
The instructions above worked ok for most packages, though the dependencies are not automatically resolved. Some packages required more work. Here's how a got a couple to work.
console_bridge
Apparently console_bridge is a pure cmake package. I think it just needs a package.xml file for catkin to find it. This is how I got it to work:
$ cd ~/ros_catkin_ws/src $ mkdir cb_ws $ cd cb_ws $ git clone https://github.com/ros/console_bridge $ mkdir build $ cd build $ cmake -DCMAKE_INSTALL_PREFIX=../../../install_isolated ../console_bridge $ make install $ cd ~/ros_catkin_ws/src $ mv cb_ws/console_bridge . $ rm -rf cb_ws $ sed -e "s/rosconsole/console_bridge/" rosconsole/package.xml > console_bridge/package.xml
rosbag_migration_rule
Rosbag migration rule was not found by roslocate_info, and the git repo was not listed anywhere. I had to search github to find it. For some reason, I couldn't get rosws to add it correctly. Here's how I think I got it to work:
$ cd ~/ros_catkin_ws/src $ git clone https://github.com/ros/rosbag_migration_rule.git $ cd .. $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy $ ./src/catkin/bin/catkin_make_isolated --install
This took hours to rebuild everything, so there must be a better way, but it worked.
Variant: It also worked under Raspbian Jessie, by specifying --os=debian:jessie
References
http://answers.ros.org/question/88106/problems-installing-hydro-on-1204-from-source-on-armhf/
http://wiki.ros.org/ROSberryPi/Setting%20up%20ROS%20on%20RaspberryPi