ICub software: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
m (→‎See also: remove dead link)
 
(74 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article deals with the installation of YARP and iCub software.
This article deals with the installation of YARP and iCub software. Word of advice: '''always refer to the official iCub documentation first''':
 
* http://www.yarp.it
Please '''always refer to the official iCub manual first''' (http://wiki.icub.org/wiki/ICub_Software_Installation). It features up-to-date instructions on how to install the software, both from Ubuntu packages or from sources.
* http://wiki.icub.org/wiki/Manual#Six._Software.2C_Installing_YARP_and_iCub
* http://wiki.icub.org/wiki/ICub_Software_Installation
* Virtual Machine that contains pre-installed software: https://github.com/robotology/vagrant-icub


Below, we list some unofficial additional notes provided by [[Vislab|VisLab]] members.
Below, we list some unofficial additional notes provided by [[Vislab|VisLab]] members.


== Preliminary software ==
''See [[iCub software/Archive]] for obsolete information.''
 
* [http://www.cmake.org/ CMake]
* [http://git-scm.com/ Git] or SVN client
 
=== Windows ===
 
[https://code.google.com/p/tortoisegit/ TortoiseGit] or [http://tortoisesvn.tigris.org/ TortoiseSVN]


=== Linux ===
== Dependencies ==


  sudo apt-get install make cmake-curses-gui git-core subversion
In Linux, refer to [[iCub machines configuration#Dependencies]].
 
For more details on Linux packages, see [[VisLab machines configuration]].


== Environment variables ==
== Environment variables ==
Line 29: Line 22:
* <code>ICUB_DIR</code>: icub-main build directory, usually <code>ICUB_ROOT/build</code>
* <code>ICUB_DIR</code>: icub-main build directory, usually <code>ICUB_ROOT/build</code>


=== Windows environment variables ===
In Linux, refer to [[iCub machines configuration#Environment variables]].
 
Typical choices are:
* <code>YARP_ROOT</code> = C:/yarp
* <code>YARP_DIR</code> = C:/yarp/build
* <code>ICUB_ROOT</code> = C:/icub-main
* <code>ICUB_DIR</code> = C:/icub-main/build
 
=== Linux environment variables ===
 
Refer to [[VisLab machines configuration#Environment variables]] for typical variables and instructions on where to set them.


== YARP ==
== YARP ==
Line 49: Line 32:
=== Getting the yarp repository in Windows ===
=== Getting the yarp repository in Windows ===


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


Note: if you use Cygwin, refer to Linux instructions instead.
Note: if you use Cygwin, refer to Linux instructions instead.
Line 57: Line 38:
=== Installing yarp in Windows ===
=== Installing yarp in Windows ===


Note: all environment variables should have '/' and NOT '\' (except in the <code>PATH</code> 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.
Note: all environment variables should have '/' and NOT '\' (except in the <code>PATH</code> enviroment variable).
 
# 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.
# If you want GUIs, download GTKMM from http://live.gnome.org/gtkmm/MSWindows and use the installer.
# Create the environment variables <code>ACE_ROOT</code>, <code>GTK_BASEPATH</code>, <code>GTKMM_BASEPATH</code>, <code>GSL_DIR</code> as follows:
#* <code>ACE_ROOT</code> is ACE dir (e.g., C:/ace_wrappers).
#* <code>GTK_BASEPATH</code> and <code>GTKMM_BASEPATH</code> is GTKMM dir (C:/gtkmm).
#* <code>GSL_DIR</code> is GSL dir (C:/gsl-1.8).
# Add this to the <code>PATH</code> environment variable: <code>%ACE_ROOT%/lib</code> (important: make sure you put it at the beginning of the <code>PATH</code> environment variable, to avoid conflicts with other existing ACE versions on the system)
# Make sure that <code>YARP_ROOT</code> and <code>YARP_DIR</code> are correctly set.
# Add this to the <code>PATH</code> enviroment variable: <code>%YARP_DIR%/bin/Release</code> (and/or <code>Debug</code>). Note: these directories will be created later
# Use CMake to build the YARP SLN files. Point the source code to the yarp dir, and build to the yarp/build dir (which will be created now).
# In CMake, check the flags CREATE_DEVICE_LIBRARY_MODULES, CREATE_LIB_MATH and, optionally, CREATE_GUIS (don't uncheck anything!).
# Click: Configure, Configure, Generate.
# Go to <code>YARP_DIR</code> and open YARP.sln with Visual Studio
# Go to Build->Batch Build
# Check ALL_BUILD (Release and/or Debug) and Build!


=== Getting the yarp repository in Linux ===
=== Getting the yarp repository in Linux ===


To clone the repository, you can use one of these addresses:
Run the following command in a console terminal, typically from the <code>$code</code> directory:
* (git read-only)    git://github.com/robotology/yarp.git
  git clone https://github.com/robotology/yarp.git
* (ssh read+write)    git@github.com:robotology/yarp.git
* (https read+write) https://github.com/robotology/yarp.git


More instructions are located at https://github.com/robotology/yarp.
=== Compiling the yarp repository in Linux ===


To use this repository through SVN, you will have to do a new checkout (checkouts prior to March 2013 are not compatible):
mkdir $YARP_DIR
cd $YARP_DIR
ccmake $YARP_ROOT


  svn co https://github.com/robotology/yarp/trunk yarp
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.


=== Compiling the yarp repository in Linux ===
Having generated your project file, only the actual compilation remains to be done:
make


To compile the yarp repository, go to <code>YARP_DIR</code> (the first time you must create it) and '''generate the project files''' with the CMake program with the command
Don't use <strike><code>sudo make install</code></strike>! Rather, add the location of the binaries to the <code>$PATH</code> environment variable (see below).
  ccmake $YARP_ROOT
and you obtain a Makefile.
 
Having generated your project file, only the actual compilation remains to be done:
  make


=== Updating the yarp repository in Linux ===
=== Updating the yarp repository in Linux ===


  cd $YARP_ROOT
cd $YARP_ROOT
  git pull ''(or'' svn update'')''
git pull
 
=== Recommended CMake flags for yarp ===
 
  CMAKE_BUILD_TYPE Release
  CREATE_LIB_MATH ON


=== Downloading YARP as a single file ===
=== Downloading YARP as a single file ===


Refer to http://wiki.icub.org/yarpdoc/index.html -> Downloads. Pre-compiled binaries are also available.
Refer to http://www.yarp.it. Pre-compiled binaries are also available.


== iCub ==
== iCub ==
Line 115: Line 74:
=== Browsing the iCub repository online ===
=== Browsing the iCub repository online ===


'''icub-main''':
'''icub-main'''


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


'''iCub Contrib Software'''


'''icub-contrib''':
These are small repositories in the Robotology organization page, which contain special components and demos, for example the ball tracking and grasping demo is here:
 
https://github.com/robotology/icub-basic-demos/
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 ===
=== Getting the iCub repository in Windows ===


Inside TortoiseGit/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.
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.


Type the following string in the entry "URL of repository":
Note: if you use Cygwin, refer to Linux instructions instead.


  svn://svn.code.sf.net/p/robotcub/code/trunk/iCub
=== Getting the iCub repository in Linux ===


No password or username will be required.
'''icub-main'''


Note: if you use Cygwin, refer to Linux instructions instead.
Run the following command in a console terminal, typically from the <code>$code</code> directory:
git clone https://github.com/robotology/icub-main.git


=== Installing iCub in Windows ===
'''contrib software'''


# Make sure that <code>ICUB_ROOT</code> and <code>ICUB_DIR</code> are correctly set.
Set up icub-contrib-common (see below), then get the contrib application that you wish to install (for example POETICON++), CMake and build it.
# Install OpenCV 1.0, available at http://sourceforge.net/projects/opencvlibrary/files/ . Make sure that the variable <code>OPENCV_DIR</code> was created and add <code>%OPENCV_DIR%/bin</code> to the <code>PATH</code> environment variable.
# 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 <code>IPOPT_DIR</code>, e.g. C:\Ipopt-3.7.0-win32-msvc8-yarp
# 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).
# In CMake, check YARP_AUTO_LINK (not sure why?) and the modules you might want working (don't unheck anything!).
# Click: Configure, Configure, Generate.
# Go to <code>ICUB_DIR</code>, open iCub.sln
# Go to Build->Batch Build
# Check ALL_BUILD (Release and/or Debug) and Build! (sometimes frameGrabberGui2 will not compile correctly)


=== Getting the iCub repository in Linux ===
'''firmware''' (only for [[pc104]])


Paste the following command in a console terminal, typically from the <code>$code</code> directory:
git clone https://github.com/robotology/icub-firmware-shared
  svn co https://svn.code.sf.net/p/robotcub/code/trunk/iCub
git clone https://github.com/robotology/icub-firmware-build


Notice that this may take some time. Alternatively you can download individual parts of the repository (i.e. ''main'' and ''contrib'' or ''firmware'').
=== Compiling the iCub repository in Linux ===
 
This will create a new directory called '''iCub''' that contains the software. Your environment variable <code>ICUB_ROOT</code> should be set to that directory (e.g., <code>$code/iCub</code>).


=== Compiling the iCub repository in Linux ===
'''icub-main'''


'''iCub-main'''
mkdir $ICUB_DIR
cd $ICUB_DIR
ccmake $ICUB_ROOT


To compile the iCub repository, go to <code>ICUB_DIR</code> (the first time you must create it) and '''generate the project files''' with the CMake program, typing with the command
In the CMake interface, set the following
  ccmake $ICUB_ROOT/main
CMAKE_BUILD_TYPE Release
and you obtain a Makefile.
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:
Having generated your project file, the actual compilation remains to be done:
  make
make


With YARP > 2.3.23 and iCub > 1.1.13 software versions, your installation is finished at this point. Provided that <code>YARP_ROBOT_NAME=iCubLisboa01</code> is set, robot-specific files will be automatically copied by CMake.
Provided that <code>YARP_ROBOT_NAME=iCubLisboa01</code> is set, robot-specific files will be automatically copied by CMake.


With older versions, you needed to define the environment variable <code>ICUB_ROBOTNAME=iCubLisboa01</code> and type
Don't use <strike><code>sudo make install</code></strike>! Rather, add the location of the binaries to the <code>$PATH</code> environment variable (see below).
  make install_applications


'''iCub-contrib'''
'''icub-contrib-common metapackage''' (to use contrib modules, i.e., modules outside icub-main)


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 avoid installing these applications with sudo in system directories (<code>/usr/local/lib</code>, <code>/usr/local/share</code>).
Follow the official instructions at the bottom of http://wiki.icub.org/wiki/Linux:Installation_from_sources but '''make sure to point CMAKE_INSTALL_PREFIX to the full path corresponding to $ICUBcontrib_DIR''', which is accessible without administrator privileges and whose binaries will be within $PATH. To accomplish this, follow these simple instructions, paying attention to the part in bold.


Put these into <code>.bash_env</code>:
Verify that your <code>.bashrc_iCub</code> file (or equivalent) contains these environment variables:
  export ICUBcontrib_DIR=$ICUB_ROOT/contrib/build
  export ICUBcontrib_DIR=$code/icub-contrib-common/build
  export PATH=$PATH:$YARP_DIR/bin:$ICUB_DIR/bin:$ICUBcontrib_DIR/bin
  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
  export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib


Now:
Set up the ICUBcontrib metapackage:
  mkdir $ICUB_ROOT/contrib/build
  mkdir $ICUBcontrib_DIR
  mkdir $ICUB_ROOT/contrib/src/ICUBcontrib/build
cd $ICUBcontrib_DIR
  cd $ICUB_ROOT/contrib/src/ICUBcontrib/build
  '''# the following command sets CMAKE_INSTALL_PREFIX to the path corresponding to $ICUBcontrib_DIR'''
'''# instead of /usr/local'''
  '''cmake -DCMAKE_INSTALL_PREFIX=$(echo $ICUBcontrib_DIR) ..'''
  ccmake ..
  ccmake ..
  // CMAKE_INSTALL_PREFIX must point to full $ICUBcontrib_DIR path
  configure, generate, exit
// configure, generate, exit
make
  make install
  make install


At this point, you can install single iCub-contrib applications with <code>make install</code> in their own build subdirectory (don't use sudo!). Binaries will be installed in $ICUBcontrib_DIR/bin.
Don't use <strike><code>sudo make install</code></strike>! Rather, add the location of the binaries to the <code>$PATH</code> environment variable (see above).


=== Updating the iCub repository in Linux ===
At this point, you can install iCub Contrib applications with <code>make install</code> 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 $ICUB_ROOT
cd $code/poeticon
  svn update
mkdir build
cd build
cmake ..
configure, generate, exit
make
make install


=== Recommended CMake flags for iCub ===
=== Updating the iCub repository in Linux ===
 
  CMAKE_BUILD_TYPE Release
 
=== Downloading iCub snapshot files ===


Snapshots of the iCub repository are available at http://eris.liralab.it/iCub/downloads/src/ (warning: not updated anymore)
cd $ICUB_ROOT
 
git pull
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 ==
== 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
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 ===
 
# Download SDL (Simple DirectMedia Layer) from http://www.libsdl.org/ (Development Libraries), unzip it somewhere and note down the directory
# Download ODE from http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/, unzip it somewhere as well
# Create the environment variables <code>SDLDIR</code>, <code>ODE_DIR</code>:
#* <code>ODE_DIR</code> is ODE dir (e.g., C:/ode-0.11.1).
#* <code>SDLDIR</code> is SDL dir (C:/SDL-1.2.14).
# Add <code>%SDLDIR%/lib</code> to the <code>PATH</code> variable.
# Re-run CMake with the ODE, OPENCV and SDL variables checked.
# Compile project iCub_SIM
 
=== Installing iCub_SIM in Mac OS X ===
 
See these pages:
* [http://www.fabioruini.eu/blog/2012/04/30/icub-simulator-on-mac-os-x-lion-the-definitive-tutorial/ iCub simulator on Mac OS X Lion: the definitive (?) tutorial] by Fabio Ruini, University of Plymouth
* [http://www.martinpeniak.com/index.php?option=com_content&view=article&id=186&Itemid=131 iCub simulator, complete MacOSX installation quide] by Martin Peniak, University of Plymouth
 
== Committing changes to the repositories ==
 
If you are a developer and you need to add/modify files within the repository, talk to one of the main developers and use Github/SourceForge.
 
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 [http://www.mediawiki.org/wiki/Subversion/auto-props 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 <code>main</code> part of the repository:
# check with the repository administrators if it's safe to put it in <code>main</code> rather than <code>contrib</code>
# commit a <code>.xml.template</code> file in <code>main/app/APPNAME/scripts</code> that contains generic node names like "pwrNode1", "console" etc.
# commit a VisLab-specific <code>.xml</code> file in <code>main/app/robots/iCubLisboa01/scripts</code> that contains our node names like "icubbrain1", "chico3" etc.


== See also ==
== See also ==


* http://eris.liralab.it/wiki/Manual#Six._Software.2C_Installing_YARP_and_iCub - official iCub manual
* http://wiki.icub.org/wiki/Manual#Six._Software.2C_Installing_YARP_and_iCub - official iCub manual
* http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/
* [[iCub machines configuration]]


[[Category:Vislab]]
[[Category:Vislab]]

Latest revision as of 17:32, 19 July 2017

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.

Dependencies

In Linux, refer to iCub machines configuration#Dependencies.

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 iCub machines configuration#Environment variables.

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 https://github.com/robotology/yarp.git

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

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

Updating the yarp repository in Linux

cd $YARP_ROOT
git pull

Downloading YARP as a single file

Refer to http://www.yarp.it. Pre-compiled binaries are also available.

iCub

Browsing the iCub repository online

icub-main

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

iCub Contrib Software

These are small repositories in the Robotology organization page, which contain special components and demos, for example the ball tracking and grasping demo is here: https://github.com/robotology/icub-basic-demos/

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 https://github.com/robotology/icub-main.git

contrib software

Set up icub-contrib-common (see below), then get the contrib application that you wish to install (for example POETICON++), CMake and build it.

firmware (only for pc104)

git clone https://github.com/robotology/icub-firmware-shared
git clone https://github.com/robotology/icub-firmware-build

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-common metapackage (to use contrib modules, i.e., modules outside icub-main)

Follow the official instructions at the bottom of http://wiki.icub.org/wiki/Linux:Installation_from_sources but make sure to point CMAKE_INSTALL_PREFIX to the full path corresponding to $ICUBcontrib_DIR, which is accessible without administrator privileges and whose binaries will be within $PATH. To accomplish this, follow these simple instructions, paying attention to the part in bold.

Verify that your .bashrc_iCub file (or equivalent) 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

Set up the ICUBcontrib metapackage:

mkdir $ICUBcontrib_DIR
cd $ICUBcontrib_DIR
# the following command sets CMAKE_INSTALL_PREFIX to the path corresponding to $ICUBcontrib_DIR
# instead of /usr/local
cmake -DCMAKE_INSTALL_PREFIX=$(echo $ICUBcontrib_DIR) ..
ccmake ..
configure, generate, exit
make
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 iCub 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/poeticon
mkdir build
cd build
cmake ..
configure, generate, exit
make
make install

Updating the iCub repository in Linux

cd $ICUB_ROOT
git pull

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

See also