ICub software

From ISRWiki
Jump to navigation Jump to search

This article explains how to install YARP and iCub software.

Preliminary software

Effective August 2009, YARP and iCub software repositories have been moved to SourceForge.net servers and must be downloaded with Subversion (SVN).

You should install an SVN client on your system if you do not have one already. For Windows, TortoiseSVN is recommended. If you run Linux or other UNIX flavours, chances are high that you can just go ahead using svn in command line (if that is not the case, install it with sudo apt-get install subversion or equivalent).

Furthermore, you should install CMake. In Linux, type sudo apt-get install make cmake cmake-curses-gui

Environment variables

The following environment variables must be set. Since summer 2010, it is recommended that they really point to different directories on your system:

  • YARP_ROOT: location of the yarp2 source code
  • YARP_DIR: yarp2 build directory
  • ICUB_ROOT: location of the iCub source code
  • ICUB_DIR: iCub build directory

Windows environment variables

Typical choices are:

  • YARP_ROOT = C:/yarp2
  • YARP_DIR = C:/yarp2/build
  • ICUB_ROOT = C:/icub
  • ICUB_DIR = C:/icub/main/build

Linux environment variables

Typical choices are:

 export YARP_ROOT=~/yarp2
 export YARP_DIR=$YARP_ROOT/build
 export ICUB_ROOT=~/iCub
 export ICUB_DIR=$ICUB_ROOT/main/build

Create a file called .bash_env in your home directory and copy the above lines in there.

Then, before the following line of /etc/bash.bashrc

 [ -z "$PS1" ] && return

add this:

 # per-user environment variables (non-interactive and interactive mode)
 source $HOME/.bash_env

This is not the only way to set these variables systemwide and enforce them in non-interactive mode too (needed by yarprun), however we recommend it.

YARP

Browsing the yarp2 repository online

http://yarp0.svn.sf.net/viewvc/yarp0/trunk/yarp2/

Getting the yarp2 repository in Windows

Inside TortoiseSVN, use the file manager to browse to the location where you would like to download the code. Right click on an empty region of the window and select "SVN checkout" from the contextual menu.

Type the following string in the entry "URL of repository":

 https://yarp0.svn.sourceforge.net/svnroot/yarp0/trunk/yarp2

No password or username will be required.

Note: if you use Cygwin, refer to Linux instructions instead.

Installing yarp2 in Windows

Note: all environment variables should have '/' and NOT '\' (except in the PATH enviroment variable)! The directories do not need to be the same as the ones presented here, just be sure to alter the environment variables correctly.

  1. Download ACE and GSL from http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/ ; unzip them to a directory of your choice and remember it.
  2. If you want GUIs, download GTKMM from http://live.gnome.org/gtkmm/MSWindows and use the installer.
  3. Create the environment variables ACE_ROOT, GTK_BASEPATH, GTKMM_BASEPATH, GSL_DIR as follows:
    • ACE_ROOT is ACE dir (e.g., C:/ace_wrappers).
    • GTK_BASEPATH and GTKMM_BASEPATH is GTKMM dir (C:/gtkmm).
    • GSL_DIR is GSL dir (C:/gsl-1.8).
  4. Add this to the PATH environment variable: %ACE_ROOT%/lib (important: make sure you put it at the beginning of the PATH environment variable, to avoid conflicts with other existing ACE versions on the system)
  5. Make sure that YARP_ROOT and YARP_DIR are correctly set.
  6. Add this to the PATH enviroment variable: %YARP_DIR%/bin/Release (and/or Debug). Note: these directories will be created later
  7. Use CMake to build the YARP SLN files. Point the source code to the yarp2 dir, and build to the yarp2/build dir (which will be created now).
  8. In CMake, check the flags CREATE_DEVICE_LIBRARY_MODULES, CREATE_LIB_MATH and, optionally, CREATE_GUIS (don't uncheck anything!).
  9. Click: Configure, Configure, Generate.
  10. Go to YARP_DIR and open YARP.sln with Visual Studio
  11. Go to Build->Batch Build
  12. Check ALL_BUILD (Release and/or Debug) and Build!

Getting the yarp2 repository in Linux

Paste the following command in a console terminal:

 svn co https://yarp0.svn.sourceforge.net/svnroot/yarp0/trunk/yarp2

This will create a new directory called yarp2 that contains the software. Your environment variable YARP_ROOT should be set to that directory (e.g., /home/yourname/yarp2).

Compiling the yarp2 repository in Linux

To compile the yarp2 repository, go to YARP_DIR (the first time you must create it) and generate the project files with the CMake program with the command

 ccmake $YARP_ROOT

and you obtain a Makefile.

Having generated your project file, only the actual compilation remains to be done:

 make

Updating the yarp2 repository in Linux

  cd $YARP_ROOT
  svn update

Recommended CMake flags for yarp2

 CMAKE_BUILD_TYPE Release
 CREATE_GUIS ON
 CREATE_LIB_MATH ON

Downloading YARP as a single file

If for whatever reason you cannot use SVN on a machine, or you do not want the very latest revision of the repository, you may just download a single file containing YARP here: [1]. Pre-compiled binaries are also available.

iCub

Browsing the iCub repository online

http://robotcub.svn.sf.net/viewvc/robotcub/trunk/iCub/

Getting the iCub repository in Windows

Inside TortoiseSVN, use the file manager to browse to the location where you would like to download the code. Right click on an empty region of the window and select "SVN checkout" from the contextual menu.

Type the following string in the entry "URL of repository":

 https://robotcub.svn.sourceforge.net/svnroot/robotcub/trunk/iCub

No password or username will be required.

Note: if you use Cygwin, refer to Linux instructions instead.

Installing iCub in Windows

  1. Make sure that ICUB_ROOT and ICUB_DIR are correctly set.
  2. Install OpenCV 1.0, available at http://sourceforge.net/projects/opencvlibrary/files/ . Make sure that the variable OPENCV_DIR was created and add %OPENCV_DIR%/bin to the PATH environment variable.
  3. If you intend to use the iKin kinematics modules (normally you don't - this is only needed on servers), then download IPOPT, unzip it and create the environment variable IPOPT_DIR, e.g. C:\Ipopt-3.7.0-win32-msvc8-yarp
  4. Use CMake to build the iCub SLN files. Point the source code to the icub/main dir, and build to the icub/main/build dir (which will be created now).
  5. In CMake, check YARP_AUTO_LINK (not sure why?) and the modules you might want working (don't unheck anything!).
  6. Click: Configure, Configure, Generate.
  7. Go to ICUB_DIR, open iCub.sln
  8. Go to Build->Batch Build
  9. Check ALL_BUILD (Release and/or Debug) and Build! (sometimes frameGrabberGui2 will not compile correctly)

Getting the iCub repository in Linux

Paste the following command in a console terminal:

 svn co https://robotcub.svn.sourceforge.net/svnroot/robotcub/trunk/iCub

This will create a new directory called iCub that contains the software. Your environment variable ICUB_ROOT should be set to that directory (e.g., /home/yourname/iCub).

Compiling the iCub repository in Linux

To compile the iCub repository, go to ICUB_DIR (the first time you must create it) and generate the project files with the CMake program, typing with the command

 ccmake $ICUB_ROOT/main

and you obtain a Makefile.

Having generated your project file, the actual compilation remains to be done:

 make

and, optionally, the installation of the iCubLisboa01-specific robot initialization files (in this case, define the environment variable ICUB_ROBOTNAME=iCubLisboa01):

 make install_applications

Updating the iCub repository in Linux

  cd $ICUB_ROOT
  svn update

Recommended CMake flags for iCub

 CMAKE_BUILD_TYPE Release

Downloading iCub snapshot files

Periodic snapshots of the iCub repository are available at http://eris.liralab.it/iCub/downloads/src/

Note that there are two types of files:

  • iCub-src-x.y.z.tar.gz: the whole iCub repository, version x.y.z
  • iCub-dep-x.y.z.txt: a list of the libraries, software packages and environment variables that are required to compile the code in snapshot x.y.z, including YARP version number.

iCub Simulator

This component is optional. Refer to the official iCub manual, section 9 (Software), subsection 6 (Simulators), available at http://eris.liralab.it/wiki/Manual#Nine._Software.2C_iCub

Installing iCub_SIM in Windows

  1. Download SDL (Simple DirectMedia Layer) from http://www.libsdl.org/ (Development Libraries), unzip it somewhere and note down the directory
  2. Download ODE from http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/, unzip it somewhere as well
  3. Create the environment variables SDLDIR, ODE_DIR:
    • ODE_DIR is ODE dir (e.g., C:/ode-0.11.1).
    • SDLDIR is SDL dir (C:/SDL-1.2.14).
  4. Add %SDLDIR%/lib to the PATH variable.
  5. Re-run CMake with the ODE, OPENCV and SDL variables checked.
  6. Compile project iCub_SIM

Installing iCub_SIM in Mac OS X

See this page created by Martin Peniak of the University of Plymouth: http://www.martinpeniak.com/index.php?option=com_content&view=article&id=186&Itemid=131

Committing changes to the repositories

If you are a developer and you need to add/modify files within the repository, you need two things:

  • a SourceForge.net account; once you have that, send an email to the RobotCub project administrators to join the project
  • make sure that your SVN client is configured correctly with regard to auto-props, which is a mechanism that takes care of line endings and MIME filetypes according to wildcards (for example, setting some flags for *.txt files and other flags for *.sh). Go here for a better explanation, and check the 'Subversion client flags' subpage (part of the official manual, linked below) for auto-props adopted by RobotCub developers

To commit an application "APPNAME" (consisting of several modules and connections) in the main part of the repository:

  1. check with the repository administrators if it's safe to put it in main rather than contrib
  2. commit a .xml.template file in main/app/APPNAME/scripts that contains generic node names like "pwrNode1", "console" etc.
  3. commit a VisLab-specific .xml file in main/app/robots/iCubLisboa01/scripts that contains our node names like "icubbrain1", "chico3" etc.

See also