ICub software: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
(→‎See also: more links)
m (→‎See also: remove dead link)
 
(179 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Effective August 2009, YARP and iCub software repositories have been moved to SourceForge.net servers and must be downloaded with Subversion (SVN).
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
* 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


It is recommended that you rename your old (CVS) iCub and yarp2 directories and do a fresh download of the new SVN repositories.
Below, we list some unofficial additional notes provided by [[Vislab|VisLab]] members.


== Preliminaries ==
''See [[iCub software/Archive]] for obsolete information.''


You should install an SVN client on your system if you do not have one already. For Windows, [http://tortoisesvn.tigris.org/ TortoiseSVN] is recommended. If you run Linux or other UNIX flavours, chances are high that you can just go ahead using <code>svn</code> in command line (if that is not the case, install it with <code>apt-get install subversion</code> or equivalent).
== Dependencies ==


Furthermore, you should install [http://www.cmake.org/ CMake].
In Linux, refer to [[iCub machines configuration#Dependencies]].


== YARP ==
== Environment variables ==


=== Browsing the yarp2 repository online ===
The following environment variables must be set.


http://yarp0.svn.sf.net/viewvc/yarp0/trunk/yarp2/
* <code>YARP_ROOT</code>: location of the yarp source code
* <code>YARP_DIR</code>: yarp build directory, usually <code>YARP_ROOT/build</code>
* <code>ICUB_ROOT</code>: location of the icub-main source code
* <code>ICUB_DIR</code>: icub-main build directory, usually <code>ICUB_ROOT/build</code>


=== Getting the yarp2 repository in Windows ===
In Linux, refer to [[iCub machines configuration#Environment variables]].


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.
== YARP ==


Type the following string in the entry "URL of repository":
=== Browsing the yarp repository online ===


  https://yarp0.svn.sourceforge.net/svnroot/yarp0/trunk/yarp2
https://github.com/robotology/yarp


No password or username will be required.
=== 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.
Note: if you use Cygwin, refer to Linux instructions instead.


=== Installing yarp2 in Windows ===
=== Installing yarp 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.
Note: all environment variables should have '/' and NOT '\' (except in the <code>PATH</code> enviroment variable).


# Download ACE and GLS from http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/ ; unzip them to anywhere (don't forget where :)).
=== Getting the yarp repository in Linux ===
# If you want GUIs, download GTKMM from http://live.gnome.org/gtkmm/MSWindows and use the installer.
# Create environment variable: ACE_ROOT, GTK_BASEPATH, GTKMM_BASEPATH, GSL_DIR.
# 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)
# 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).
# Set the YARP_ROOT, YARP_DIR environment variables.
# Add this to the PATH enviroment variable: %YARP_DIR%/bin/Release (and/or Debug). Note: these directories will be created later
# YARP_ROOT is yarp dir (C:/yarp2).
# YARP_DIR is yarp build dir (C:/yarp2/build).
# 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).
# In CMake, check: CREATE_DEVICE_LIBRARY_MODULES, CREATE_LIB_MATH and, optionally, CREATE_GUIS (don't uncheck anything!).
# Click: Configure, Configure, Generate.
# Go to your YARP_DIR and open YARP.sln with Visual Studio
# Go to Build->Batch Build
# Check ALL_BUILD (Release and/or Debug) and Build!


=== Getting the yarp2 repository in Linux ===
Run the following command in a console terminal, typically from the <code>$code</code> directory:
git clone https://github.com/robotology/yarp.git


Paste the following command in a console terminal:
=== Compiling the yarp repository in Linux ===
  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 variables <code>YARP_DIR</code> and <code>YARP_ROOT</code> should be set to that directory (e.g., <code>/home/yourname/yarp2</code>).


== Compiling the yarp2 repository in Linux ==
mkdir $YARP_DIR
cd $YARP_DIR
ccmake $YARP_ROOT


To compile the yarp2 repository, go to <code>YARP_DIR</code> and '''generate the project files''' with the CMake program with the command
In the CMake interface, set the following
  ccmake .
CMAKE_BUILD_TYPE Release
and you obtain a Makefile.
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. In Linux type <code>make</code>.
Having generated your project file, only the actual compilation remains to be done:
make


=== Updating the yarp2 repository in Linux ===
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).


  cd $YARP_ROOT
=== Updating the yarp repository in Linux ===
  svn update
 
cd $YARP_ROOT
git pull


=== Downloading YARP as a single file ===
=== 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: [http://eris.liralab.it/yarp/specs/dox/download.html]. Pre-compiled binaries are also available.
Refer to http://www.yarp.it. Pre-compiled binaries are also available.


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


http://robotcub.svn.sf.net/viewvc/robotcub/trunk/iCub/
'''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 ===
=== 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.
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'''


Type the following string in the entry "URL of repository":
Run the following command in a console terminal, typically from the <code>$code</code> directory:
git clone https://github.com/robotology/icub-main.git


  https://robotcub.svn.sourceforge.net/svnroot/robotcub/trunk/iCub
'''contrib software'''


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


Note: if you use Cygwin, refer to Linux instructions instead.
'''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 ===


=== Installing iCub in Windows ===
'''icub-main'''


# Create enviroment variable: ICUB_ROOT, ICUB_DIR.
mkdir $ICUB_DIR
# ICUB_ROOT is iCub dir (e.g., C:/icub).
cd $ICUB_DIR
# ICUB_DIR is iCub build dir (C:/icub/main/build).
ccmake $ICUB_ROOT
# 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.
# 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
# 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 your ICUB_DIR 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 ===
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.


Paste the following command in a console terminal:
Having generated your project file, the actual compilation remains to be done:
  svn co https://robotcub.svn.sourceforge.net/svnroot/robotcub/trunk/iCub
make
This will create a new directory called '''iCub''' that contains the software. Your environment variables <code>ICUB_DIR</code> and <code>ICUB_ROOT</code> should be set to that directory (e.g., <code>/home/yourname/iCub</code>).


== Compiling the iCub repository in Linux ==
Provided that <code>YARP_ROBOT_NAME=iCubLisboa01</code> is set, robot-specific files will be automatically copied by CMake.


To compile the iCub repository, go to <code>ICUB_DIR</code> and '''generate the project files''' with the CMake program, typing 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 .
and you obtain a Makefile.


Having generated your project file, only the actual compilation remains to be done. In Linux type <code>make</code>.
'''icub-contrib-common metapackage''' (to use contrib modules, i.e., modules outside icub-main)


=== Updating the iCub repository in Linux ===
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.


  cd $ICUB_ROOT
Verify that your <code>.bashrc_iCub</code> file (or equivalent) contains these environment variables:
  svn update
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


=== Downloading iCub snapshot files ===
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


Periodic snapshots of the iCub repository are available at http://eris.liralab.it/iCub/downloads/src/
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).


Note that there are two types of files:
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:
* 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 ==
cd $code/poeticon
mkdir build
cd build
cmake ..
configure, generate, exit
make
make install


=== Installing iCub_SIM in Windows ===
=== Updating the iCub repository in Linux ===


To install iCub Simulator (optional):
cd $ICUB_ROOT
# Download the SDL (Simple DirectMedia Layer) from http://www.libsdl.org/ (Development Libraries), unzip it somewhere and note down the directory
git pull
# Download ODE from http://eris.liralab.it/iCub/downloads/packages/windows/msvc8/, unzip it somewhere as well
# Create 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).
# Add %SDLDIR%/lib to the PATH variable.
# Re-Run CMAKE with the ODE, OPENCV and SDL variables checked.
# Compile project iCub_SIM


== Committing changes to the repositories ==
== iCub Simulator ==


If you are a developer and you need to add/modify files within the repository, you need two things:
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
* a SourceForge.net account; once you have that, send an email to the [http://sourceforge.net/project/memberlist.php?group_id=139262 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 [http://www.mediawiki.org/wiki/Subversion/auto-props here] for a better explanation, and check the 'Subversion client flags' page (linked below) for auto-props adopted by RobotCub developers.


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


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


[[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