UPMC iCub project/libraries

From Wiki for iCub and Friends
Revision as of 15:14, 4 December 2013 by Arwen (talk | contribs) (Environment variables)
Jump to: navigation, search


iCub modules

If you are loading iCub software from the cluster server, in /home/icub/software/src you can find yarp2, iCub and some precompiled libraries:

The other libraries listed in the manual are missing, so you have to install them via apt-get. For Ubuntu 10.04 the libraries are the following (june-2011):

  sudo apt-get update
  sudo apt-get -y install cmake cmake-curses-gui g++ libncurses5-dev libace-dev libgtkmm-2.4-dev libglademm-2.4-dev
  sudo apt-get -y install libqt3-mt-dev libgsl0-dev libsdl1.2-dev libglut3 libglut3-dev python-tk libqwt5-qt3-dev
  sudo apt-get -y install libgsl0-* gfortran libsdl1.2-dev

Important update (sept-2012): other libraries have been added, the list is becoming quite big. also, some libraries have changed name from previous versions of ubuntu. A quite convenient solution is to install icub-common, which includes all dependencies. On Ubuntu 12.04 for example do:

  • configure your apt to look for the correct list as described here, for example in Ubuntu 12 do:
  sudo sh -c 'echo "deb http://www.icub.org/ubuntu precise contrib/science" > /etc/apt/sources.list.d/icub.list'
  • then install icub-common
  sudo apt-get install icub-common
  • you may want to check here

Important update (may-2013): with the upgrade from Ubuntu 10.04 to Ubuntu 12.04 some libraries have been changed install location, some needs to be reinstalled, etc. If you're upgrading from Ubuntu 10.04 to 12.04 (we did this for macsi machines), do:

  sudo apt-get update
  sudo apt-get upgrade
  sudo apt-get dist-upgrade

reboot the machine. If you're upgrading from Ubuntu server (we did this for icubsrv), also do

  sudo apt-get install update-manager-core

otherwise the desktop version should already have it. Then you can do:

  sudo do-release-upgrade

After the upgrade, remove the unused and obsolete libraries:

  sudo apt-get autoremove

verify to have some libraries installed:

  sudo apt-get -y install cmake-curses-gui libace-dev libglib2.0-* libreadline-dev gnulib-dev

If you want to check your installed libraries, you can do:

  sudo apt-cache pkgnames | grep ___library_name____

Particularly, libglib2.0-* will install

  libglib2.0-cil-dev libglib2.0-0-refdbg libglib2.0-doc libglib2.0-0-dbg

These libraries are needed to compile YARP. There is a problem with glib2.0, which apparently changed its install location and cannot be found by the CMake of YARP. To solve this issue, you need to add the new installation location of the library in the LD_LIBRARY_PATH (see below for more information on environment variables and hot to set this variable in the bashrc of your machine). In macsi02, now we have this:

  # added new path ubuntu 12.04 for glib-2.0

which means that glib2.0 is now in /usr/lib/x86_64-linux-gnu/glib-2.0/include

iCub_ISIR modules

If you need to run iCub_ISIR code, you will need additional libraries, which are located in /home/icub/software/src:

Other libraries can be installed via apt-get

  sudo apt-get -y install libglew1.5-dev libblas-dev liblapack-dev
  sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
  sudo apt-get update
  sudo apt-get install libpcl-all

More info about:

MACSi modules

  • Kinect
  sudo apt-get install openni-dev ps-engine
  sudo apt-get install libboost-all-dev libusb-1.0-0-dev libqt4-dev libgtk2.0-dev cmake libglew1.5-dev libgsl0-dev libglut3-dev libxmu-dev
  sudo apt-get install libcminpack-dev 

to install OpenNI, download ROS version (as suggested in the CMakeLists for YARP's kinect driver)

  sudo apt-get install mercurial git-core doxygen
  hg clone https://kforge.ros.org/openni/drivers OpenNI
  cd OpenNI

Note: OpenNI is not necessary if ROS is installed.

If you're using the kinect from OpenCv, then OpenNI must be used in combination with the PrimeSense driver, as explained in OpenCV guide here.

To use the YARP-ROS bridge you have to install some python libraries:

  sudo apt-get install python-dev

Environment variables

If you are loading iCub software from the cluster server, there's a bash file called bashrc_icub, with the environment variables you need:

 echo "Exporting iCub environment variables from specific file.."
 export ICUB_INSTALL_PREFIX=/home/icub/software
 export OPT_INSTALL_PREFIX=/home/icub/software/opt
 export YARP_DIR=$YARP_ROOT/build
 export YARP_CONF=/home/icub/.yarp
 export ICUB_DIR=$ICUB_ROOT/main/build
 export IPOPT_DIR=$ICUB_INSTALL_PREFIX/src/Ipopt/build
 export ISIR_DIR=$ISIR_ROOT/build
 export QHULL_DIR=$ICUB_INSTALL_PREFIX/src/qhull/build
 export OPENCV_NEW_DIR=$ICUB_INSTALL_PREFIX/src/OpenCV_new/build
 export MACSI_DIR=$MACSI_ROOT/main/build
 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/icub/software/lib/pkgconfig/
 export CLASSPATH="$XCSF_DIR/JavaXCSF/xcsf.jar:$XCSF_DIR/xcsf-server/xcsfserver.jar:$XCSF_DIR/xcsfServer.jar"
 echo "Welcome $ICUB_ROBOTNAME!"

(update 12-2013)

The robot name variable has changed. Before it was Before it was

  export ICUB_ROBOTNAME=iCubParis01

now it is

  export YARP_ROBOT_NAME=iCubParis02

You can easily include them in your .bashrc file (/home/icub/.bashrc) by appending these lines at the bottom:

  # iCub software
  if [ -f /home/icub/software/bashrc_icub ]; then
      . /home/icub/software/bashrc_icub

As a test, open a terminal, and type "bash". You should get something like that:

  icub@macsi03:~$ bash
  Exporting iCub environment variables from specific file..
  Welcome iCubParis01!

If you also have ROS on the machine, add these lines at the end of .bashrc file

  echo "Exporting ROS variables.."
  export ROS_WORKSPACE=/home/icub/software/src/ros_workspace
  export ROS_HOSTNAME=macsi01
  export ROS_MASTER_URI=http://macsi01:11311/
  echo "ROS master at $ROS_MASTER_URI"

Note that ROS_MASTER_URI is necessary to connect ROS and YARP, and in fact is the URI of roscore when it starts. It is here assumed that ROS is installed on macsi01 and it is only "locally" installed: that's why we don't put these environment variables in the shared bashrc_icub file. By the way, we noticed that if we put these variables at the beginning of the bashrc file, some ROS functions do not work (beware, ros seems quite variable in its behavior).

Experimental DATA_DIRS (update 12-2013) With the latest yarp updates, there is now a new paradigm in the installation of app-files.

Before: When we were installing yarp, icub, macsi files and apps, through

  make install_applications

ini files, xml files used by gyarpmanager etc were copied from <ROOT>/main/app to <ROOT>/app. Hence the local files used for executing the applications were in


After: Now we don't have to do make install_applications anymore, because with the new cmake the app files are installed in:

     -> applications
     -> contexts
     -> modules
     -> templates
     -> applications
     -> contexts
     -> modules
     -> templates

There is a copy in


The new paradigm is explained inthe new ResourceFinder page, which applies only to versions of YARP > 2.3.23 and iCub > 1.1.13!


Hereinafter, I assume you are using Windows 7 and Visual Studio 10 (msvc10).

iCub modules

Follow the official manual. Precompiled modules are suggested.

iCub_ISIR modules

  • kdl
  • lwpr
  • eigen2 (required for kdl)
  • orocos rtt (required for kdl)

MACSi modules

  • URBI
  • CUDA toolkit