Difference between revisions of "UPMC iCub project/Installing libraries"

From Wiki for iCub and Friends
Jump to: navigation, search
(Added python binding for yarp)
Line 166: Line 166:
 
   sudo apt-get install harkfd hark-ros-electric hark-ros-stacks-electric  
 
   sudo apt-get install harkfd hark-ros-electric hark-ros-stacks-electric  
 
To install the supported driverss follow the link on the website. For example for [http://winnie.kuis.kyoto-u.ac.jp/HARK/wiki.cgi?page=HARK-KINECT+Installation+Instructions kinect].
 
To install the supported driverss follow the link on the website. For example for [http://winnie.kuis.kyoto-u.ac.jp/HARK/wiki.cgi?page=HARK-KINECT+Installation+Instructions kinect].
 +
 +
=== quadprog ===
 +
 +
Quadprog++ is a quadratic optimization tool required by ORCISIR. The [http://sourceforge.net/projects/quadprog original code] has been modified for ORCISIR, the source can be taken [https://github.com/serena-ivaldi/quadprog here]. Do:
 +
  git clone https://github.com/serena-ivaldi/quadprog.git
 +
  cd quadprog
 +
  mkdir build
 +
  cd build
 +
  ccmake ..
 +
  make
 +
  make install
 +
 +
 +
== OSX ==
  
 
=== Python Binding for Yarp (on OS X) ===
 
=== Python Binding for Yarp (on OS X) ===

Revision as of 17:57, 5 September 2013

Linux

Note: these notes assume you are putting sources in /home/icub/software/src and installing everything in /home/icub/software (as in the icub cluster).

Boost

Boost is required by Orocos-Rtt. The official link is here. Download Boost

  svn co http://svn.boost.org/svn/boost/trunk boost

Launch the scripts to install

  ./bootstrap.sh --prefix=/home/icub/software
  ./b2

In .bashrc, add the environment variable BOOST_ROOT (required by orocos-rtt)

  export BOOST_ROOT=$ICUB_INSTALL_PREFIX/src/boost

Alternatively, you can get the libraries via apt-get.

Orocos-Rtt

Orocos-Rtt is required by KDL. The official link is here. Download Orocos-Rtt

  svn co http://svn.mech.kuleuven.be/repos/orocos/trunk/rtt rtt

Follow the instructions here to install, precisely

  mkdir build
  cd build 
  cmake 
  cmake .. -DOROCOS_TARGET=gnulinux -DCMAKE_INSTALL_PREFIX=/home/icub/software
  make
  make install

Eigen2

Eigen2 is required by KDL. The official link is here. Attention: download eigen2 and not eigen3. Download eigen2

  wget http://bitbucket.org/eigen/eigen/get/2.0.15.tar.bz2

Extract it in /eigen2, enter and do:

  mkdir build
  cd build
  ccmake ..
  make
  make install

KDL

Download kdl

  wget http://people.mech.kuleuven.be/~rsmits/kdl/orocos-kdl-1.0.2-src.tar.bz2

Extract it in kdl, enter and follow the instructions in INSTALL, doing:

  mkdir build
  cd build
  ccmake ..
  make
  make install

In .bashrc, add the environment variable KDL_DIR (required by iCub_MACSI code) and make it point to the path where you installed kdl (it will look for lib, include..), for example

 export KDL_DIR=$ICUB_INSTALL_PREFIX

LWPR

Download LWPR

  wget http://www.ipab.inf.ed.ac.uk/slmc/software/lwpr/lwpr-1.2.3.zip

Extract it in lwpr, enter and follow the instructions in INSTALL.TXT, doing:

  ./configure
  make
  make install

PAE

Download pae via svn

  svn checkout https://scm.gforge.inria.fr/svn/pae/trunk pae

Then in the folder do

  ./bootstrap
  ./configure --enable-opencv=yes --enable-surf=no --prefix=/home/icub/software
  make
  make install

If the configure script doesn't find opencv (e.g. because they are installed in a different directory than /usr/local/) add this line to .bashrc

  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/icub/software/lib/pkgconfig/

where the directory on the left points toward the folder where the file opencv.pc has been installed by OpenCV during its installation. Note: you may need to install these packages

 sudo apt-get install libtool automake

qhull

Download qhull

  wget http://www.qhull.org/download/qhull-2011.1-src.tgz

Extract it, then

  mkdir build
  cd build
  ccmake ..
  make
  make install

ROS

To install ROS fuerte, simply follow the installation guide on the official website. ROS will be installed in /opt/ros/fuerte. It is necessary then to modify the .bashrc file to load ROS' environment variables. For example in our bashrc we have:

  # load icub environment vars even in non-interactive mode
  source ~/software/bashrc_icub
  # If not running interactively, don't do anything
  [ -z "$PS1" ] && return
  .....
  # better to put this at the end of the file
  # load ros environment vars 
  source /opt/ros/fuerte/setup.bash
  .....
  # ROS environment variables
  ....

Some environment variables have to be added manually to make ROS cohexist with YARP: see how to add these variables in the bashrc_icub. If you have an earlier installation of eigen3 or pcl, you may need to remove those libraries. In our case on Ubuntu 10.04 we did the following:

  sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu lucid main" > /etc/apt/sources.list.d/ros-latest.list'
  wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
  sudo rm /etc/apt/sources.list.d/v-launchpad-jochen-sprickerhof-de-pcl-lucid.list*
  sudo apt-get remove libeigen3-dev
  sudo apt-get update
  sudo apt-get install ros-fuerte-desktop-full
  sudo apt-get install python-pip
  sudo easy_install -U rosinstall vcstools rosdep
  

Generally, ROS requires a number of libraries, which you may want to install before, for example:

  sudo apt-get install build-essential python-yaml cmake subversion wget python-setuptools mercurial git-core
  sudo apt-get install python-yaml libapr1-dev libaprutil1-dev libbz2-dev python-dev libgtest-dev python-paramiko libboost1.40-all-dev liblog4cxx10-dev pkg-config
  sudo apt-get install python-wxgtk2.8 python-gtk2 python-matplotlib libwxgtk2.8-dev python-imaging libqt4-dev graphviz qt4-qmake python-numpy ros-fuerte-swig-wx

You can verify that ROS is installed correctly by typing for example:

  rosversion ros
  rospack find <name of basic package>

To enable YARP-ROS communication, follow the instructions on YARP's website.

URBI

To install Urbi, download the sdk or the precompiled version. If you choose to install the sdk and compile yourself do:

  wget http://www.gostai.com/downloads/urbi/2.7.5/urbi-sdk-2.7.5.tar.bz2
  ln -s urbi-sdk-2.7.5 urbi-root

Then follow the instructions for building on the website. Urbi has many dependencies, so before starting you may need to get some libraries, e.g.

  sudo apt-get install aspell aspell-en autoconf automake bc ccache colordiff coreutils cvs doxygen flex g++ gettext git-core gnuplot graphviz help2man imagemagick libboost-all-dev liblinphone-dev libx11-dev make pkg-config python-docutils python-yaml python2.6 socat sun-java6-jdk swig tex4ht texinfo texlive-base texlive-binaries texlive-latex-extra transfig valgrind

Many of these libraries should be already installed in your machine. It is also possible to get a precompiled version of urbi. For our Lucid we did:

  wget http://www.gostai.com/downloads/urbi/2.7.5/urbi-sdk-2.7.5-linux_lucid-x86-gcc4.tar.bz2

Unpack it in a user-accessible folder and rename it as urbi-root. Follow the instructions to install. Then add the environment variable URBI_ROOT pointing at this folder, and add its /bin folder to the PATH. For example do something like:

  export URBI_ROOT=$ICUB_INSTALL_PREFIX/urbi-root
  export PATH=$PATH:$ICUB_INSTALL_PREFIX/bin:$URBI_ROOT/bin: <the rest>

You now need to install the yarp-urbi bridge.

  wget http://www.gostai.com/downloads/yarp/urbi-yarp-sources-1.0.zip
  unzip urbi-yarp-sources-1.0.zip
  cd urbi-yarp
  wget http://www.gostai.com/downloads/tools/FindUrbi.cmake

The standard instruction to compile this package is:

  umake-shared -o yarp yarp.cc -I/<PathToYarp>/include -L/<PathToYarp>/lib -lYARP_dev -lYARP_OS -lYARP_sig -lYARP_init WARNING_CXXFLAGS=  -I. -lACE

which in our case (where everything is installed in /home/icub/software) is:

  umake-shared -o yarp yarp.cc -I/home/icub/software/include -L/home/icub/software/lib -lYARP_dev -lYARP_OS -lYARP_sig -lYARP_init WARNING_CXXFLAGS=  -I. -lACE

HARK

Hark is a library for sound source detection and localization. We use it with a set of ROS modules (hence it is only installed in macsi01). Ti install it, follow the guidelines here. Do:

  sudo sh -c 'echo "deb http://winnie.kuis.kyoto-u.ac.jp/HARK/harkrepos lucid non-free\ndeb-src http://winnie.kuis.kyoto-u.ac.jp/HARK/harkrepos lucid non-free" > /etc/apt/sources.list.d/hark.list'
  wget -q -O - http://winnie.kuis.kyoto-u.ac.jp/HARK/harkrepos/public.gpg | sudo apt-key add -
  sudo apt-get update
  sudo apt-get install harkfd
  sudo apt-get install harktool3

For ROS fuerte users also do this:

  sudo apt-get install harkfd hark-ros-fuerte hark-ros-stacks-fuerte

this is for ros-electric

  sudo apt-get install harkfd hark-ros-electric hark-ros-stacks-electric 

To install the supported driverss follow the link on the website. For example for kinect.

quadprog

Quadprog++ is a quadratic optimization tool required by ORCISIR. The original code has been modified for ORCISIR, the source can be taken here. Do:

  git clone https://github.com/serena-ivaldi/quadprog.git
  cd quadprog
  mkdir build
  cd build
  ccmake ..
  make
  make install


OSX

Python Binding for Yarp (on OS X)

Install SWIG :

   brew install swig

Giving that $YARP_DIR is where you svn checkout is:

   cd $YARP_DIR/bindings
   mkdir build
   cd build
   ccmake ..

Check CREATE_PYTHON, press 'c' twice, 'g' once.

   make

If you run make install, it will probably put them in the wrong place. So, assuming you are using python brew :

   cp yarp.py ~/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/
   cp _yarp.so ~/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/

To verify all is well, run

   python

And type 'import yarp', and press enter. If nothing happens, all is good.