[Documentation] [TitleIndex] [WordIndex

Installation of ROS on the Nao robot

nao_markers.jpg

Binary packages for ROS

Note that currently, only ROS Indigo is supported.

Note that this procedure is only carefully tested on OpenNao 1.14. If you encounter issues on OpenNao 2.1, please report them here.

To install a ROS distribution on Nao, you need to install on one hand a set of ROS packages, and on the other hand, their required system dependencies.

Nao's operating system (OpenNao) is based on Gentoo, so system dependencies can be installed with the emerge tool. Since no compiler is available on the robot itself, we have prepared for you binary packages.

To install ROS packages, we rely on robotpkg, a special package manager for robotic softwares, developed at LAAS-CNRS, that also provides binary packages compiled for Nao.

If you have a Nao v3 (Geode-based), you may also want to refer to ROS cross-compilation on AMD Geode.

Installing and configuring the package managers

   1 $ su -c 'sed -i "s|#allow user nao to shutdown the robot|nao     ALL=(ALL) ALL\n&|" /etc/sudoers'
   2 # (enter root password)
   3 

   1 $ curl -k -s https://chili-research.epfl.ch/ros4nao/bootstrap.sh | sh

If you are updating from a previous NAOqi installation:

  • you first need to delete .bash_profile (or, if you made custom changes, rename it into .bash_profile.old and copy back your changes at the end) and unexport $OPENROBOTS by typing export OPENROBOTS=,

  • since the Portage database is stored on Nao's SD card, it is still present after the NAOqi update, and emerge will think the packages are already installed. Hence, you likely need to run sudo emerge -e world to force a re-install of all the binaries.

  • finally, to be on the safe side, run sudo robotpkgin full-upgrade to upgrade all robotpkg packages you may have previously installed.

If everything went ok, you can now install binary packages directly on the robot.

Using the package managers

To install system dependencies, run sudo emerge <pkg>.

For instance, the system dependencies required by roscore are log4cxx, netifaces, pyyaml, libpoco, apr, apr-util:

   1 $ sudo emerge log4cxx netifaces pyyaml poco apr apr-util

On some newer Naos (e.g. SDK V2), you can leave away apr and apr-util since they are already installed and fetching their source package fails for certain outdated versions.

Because of the way emerge works, you actually need to call the emerge command twice to get the packages to install. If required, you will also need to follow the instructions to add the argument --autounmask-write to emerge and run sudo etc-update in between. Be sure to merge in the suggested config changes.

To install ROS and Nao-specific ROS packages, use sudo robotpkgin install <pkg>.

   1 $ sudo robotpkgin install nao-robot

This installs the full ROS 'ros-robot' variant along with the Nao ROS support for sensors and actuators.

robotpkg does not provide only ROS: over 100 packages focused on academic robotics are available. Most of them compile fine on OpenNAO, do not hesistate!

Note: The first time you install a ROS package, you need to log out/log in (or simply source ~/.bash_profile) to load ROS environment variables.

Note: All robotpkg packages (including ROS) are installed in /opt/openrobots. On the robot, /opt is a link to the SD card.

You should now be able to start ROS on Nao:

   1 $ roslaunch nao_bringup nao.launch

Setting up a development environment

Instead of going for cross-compilation (which is difficult to setup with ROS and Aldebaran having their own systems), we recommend you to go the virtual machine way.

So, first, install the Nao virtual image, as nicely explained here.

Then, connect to the virtual machine, and follow the exact same steps as above, to configure the package managers.

Install as well the ROS stacks you need for your development (sudo robotpkgin install ros-robot ros-image-common is a good start).

Then, process as you would on any development machine. git, gcc, cmake, etc. are all available, and, if you followed all the steps for the installation of binary packages, catkin should work out-of-the-box.

Note, that it might be necessary to adjust

   1 /etc/portage/package.keywords

according to the suggestions of emerge.

You may also want to modify /etc/portage/make.conf to pass optimization flags:

   1 CFLAGS="${CFLAGS} -O2 -m32 -march=i486 -mtune=atom -mssse3 -mfpmath=sse"

For obtaining easy_install (python setup tools) run:

   1 $ sudo bash -c 'echo app-portage/gentoolkit >> /etc/portage/package.keywords'
   2 $ sudo bash -c 'echo dev-python/setuptools >> /etc/portage/package.keywords'
   3 $ sudo emerge setuptools

Afterwards, you can obtain rosinstall, rosdep, etc. using

   1 $ sudo easy_install  rosdep rosinstall_generator wstool rosinstall

Note that robotpkg provides more recent versions of boost (boost-1.52) and opencv (opencv-2.4.8) than the ones provided on OpenNao. Feel free to install them with robotpkgin install.

To ease the distribution of your freshly compiled softwares on the robot, we recommend you to install your packages to /opt/openrobots/.

Then, use rsync to send your changes to Nao:

$ rsync -raz /opt/openrobots nao.local:/opt/

If you encounter any issue, please report them either on http://answers.ros.org or by email on the ros-sig-aldebaran@googlegroups.com.

Troubleshooting


2024-12-21 15:05