ICub software: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
(→‎Compiling the iCub repository in Linux: clarify icub-main CMake instructions)
Line 120: Line 120:
In the CMake interface, set the following
In the CMake interface, set the following
  CMAKE_BUILD_TYPE Release
  CMAKE_BUILD_TYPE Release
  CREATE_LIB_MATH ON
  ENABLE_icubmod_cartesiancontrollerclient ON
ENABLE_icubmod_cartesiancontrollerserver ON
ENABLE_icubmod_gazecontrollerclient ON
then hit c and g in order to '''generate the project files''', to obtain the Makefile.
then hit c and g in order to '''generate the project files''', to obtain the Makefile.



Revision as of 13:35, 1 October 2014

This article deals with the installation of YARP and iCub software. Word of advice: always refer to the official iCub documentation first:

Below, we list some unofficial additional notes provided by VisLab members.

See iCub software/Archive for obsolete information.

Environment variables

The following environment variables must be set.

  • YARP_ROOT: location of the yarp source code
  • YARP_DIR: yarp build directory, usually YARP_ROOT/build
  • ICUB_ROOT: location of the icub-main source code
  • ICUB_DIR: icub-main build directory, usually ICUB_ROOT/build

In Linux, refer to VisLab machines configuration#Environment variables for typical variables and instructions on where to set them.

YARP

Browsing the yarp repository online

https://github.com/robotology/yarp

Getting the yarp repository in Windows

Inside TortoiseGit, 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 "checkout" from the contextual menu; type the above address in the "URL of repository" field. No password or username will be required.

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

Installing yarp in Windows

Note: all environment variables should have '/' and NOT '\' (except in the PATH enviroment variable).

Getting the yarp repository in Linux

Run the following command in a console terminal, typically from the $code directory:

git clone git://github.com/robotology/yarp.git

Note that these addresses and permissions are possible:

More instructions are located at https://github.com/robotology/yarp.

Compiling the yarp repository in Linux

mkdir $YARP_DIR
cd $YARP_DIR
ccmake $YARP_ROOT

In the CMake interface, set the following

CMAKE_BUILD_TYPE Release
CREATE_LIB_MATH ON

then hit c and g in order to generate the project files, to obtain the Makefile.

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

make

Updating the yarp repository in Linux

cd $YARP_ROOT
git pull

Downloading YARP as a single file

Refer to http://wiki.icub.org/yarpdoc/index.html -> Download YARP. Pre-compiled binaries are also available.

iCub

Browsing the iCub repository online

icub-main:

https://github.com/robotology/icub-main/


icub-contrib, icub-firmware:

http://sf.net/p/robotcub/code/HEAD/tree/trunk/iCub/ (pretty interface, ability to show diffs)

or

https://svn.code.sf.net/p/robotcub/code/trunk/iCub/ (simple and raw interface, faster to load)

Getting the iCub repository in Windows

Inside TortoiseGit, 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 "checkout" from the contextual menu; type the repository address in the "URL of repository" entry.

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

Getting the iCub repository in Linux

icub-main

Run the following command in a console terminal, typically from the $code directory:

git clone git://github.com/robotology/icub-main.git

icub-contrib

First get these CMake scripts:

git clone git://github.com/robotology/icub-contrib-common.git

Then get the actual icub-contrib programs:

svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub/contrib icub-contrib

The last command will create a new directory called icub-contrib that contains the software.

Compiling the iCub repository in Linux

icub-main

mkdir $ICUB_DIR
cd $ICUB_DIR
ccmake $ICUB_ROOT

In the CMake interface, set the following

CMAKE_BUILD_TYPE Release
ENABLE_icubmod_cartesiancontrollerclient ON
ENABLE_icubmod_cartesiancontrollerserver ON
ENABLE_icubmod_gazecontrollerclient ON

then hit c and g in order to generate the project files, to obtain the Makefile.

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

make

Provided that YARP_ROBOT_NAME=iCubLisboa01 is set, robot-specific files will be automatically copied by CMake.

Don't use sudo make install! Rather, add the location of the binaries to the $PATH environment variable (see below).

icub-contrib

We follow the official instructions at the bottom of http://wiki.icub.org/wiki/Linux:Installation_from_sources, with a few differences in order to ensure that binaries and settings used by the system are the ones located in $PATH:

Verify that your .bash_env contains these environment variables:

export ICUBcontrib_DIR=$code/icub-contrib-common/build
export PATH=$PATH:$YARP_DIR/bin:$ICUB_DIR/bin:$ICUBcontrib_DIR/bin
export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib

Next, set up the ICUBcontrib meta-package:

mkdir $ICUBcontrib_DIR
cd $ICUBcontrib_DIR
ccmake ..
// set CMAKE_INSTALL_PREFIX to be the full $ICUBcontrib_DIR path, e.g., /usr/local/src/robot/icub-contrib-common/build
// 
// configure, generate, exit
make install

Don't use sudo make install! Rather, add the location of the binaries to the $PATH environment variable (see above).

At this point, you can install contrib applications with make install in their own build subdirectory (again, don't use sudo!). Binaries will be installed in $ICUBcontrib_DIR/bin. For example, to compile the POETICON++ build do the following:

cd $code/icub-contrib/src/poeticon/poeticonpp
mkdir build
cd build
cmake ..
make
make install    // without sudo!

Updating the iCub repository in Linux

  cd $ICUB_ROOT
  git pull (or svn update)

Recommended CMake flags for iCub

 CMAKE_BUILD_TYPE Release

Downloading iCub snapshot files

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), available at http://wiki.icub.org/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://wiki.icub.org/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 these pages:

See also