Difference between revisions of "Compilation on the pc104"

From Wiki for iCub and Friends
Jump to navigation Jump to search
Line 76: Line 76:
  ICUB_ROOT = $ROBOT_CODE/icub-main
  ICUB_ROOT = $ROBOT_CODE/icub-main
  ICUB_DIR  = $ROBOT_CODE/icub-main/build-pc104
  ICUB_DIR  = $ROBOT_CODE/icub-main/build-pc104
ICUBcontrib_DIR = $ROBOT_CODE/iCubContrib
  icub_firmware_shared_DIR = $ROBOT_CODE/icub-firmware-shared/build-pc104
  icub_firmware_shared_DIR = $ROBOT_CODE/icub-firmware-shared/build-pc104

Line 88: Line 89:
Edit /home/icub/.bash_iCubrc and append:
Edit /home/icub/.bash_iCubrc and append:

   export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub
   export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib
   export YARP_ROBOT_NAME=iCubAberystwyth01  (for example)
   export YARP_ROBOT_NAME=iCubAberystwyth01  (for example)

Revision as of 18:08, 22 September 2016


These instructions only apply to YARP > 2.3.23 and iCub > 1.1.13 software versions

See Compilation on the pc104 old for older instructions

Compilation on the pc104 follows the same procedure we saw in Section 6 of the manual. The main difference is that in addition you need to enable certain flags in CMake that enable compilation of external modules. Some of these modules are generic and open source and are available in YARP; others are available in iCub because they are specific to the robot and in certain case require proprietary code (the API shipped with the hardware).

We recap the list of modules before going to the installation instructions.

List of modules

The list of modules depends on the version of the robot you have.

These are modules that are common to all robots:

  • serial and serialport: face expressions
  • xsensmtx: inertial sensor
  • dragonfly2: firewire cameras
  • portaudio: microphones
  • skinWrapper

CAN based robots:

  • sharedcan
  • canmotioncontrol: communication with the can bus
  • canBusAnalogSensor
  • canBusDoubleFTSensor
  • canBusInertialMTB
  • canBusSkin
  • canBusVirtualAnalogSensor

CAN subdevices to enable depending on the version of the robot:

  • pcan: plx can interface (iCub 1.0 and 1.1.0)
  • ecan: esd can interface (iCub 1.1.0)
  • cfw2can: cfw2 can interface (iCub 1.1.1 and later versions)
  • skinprototype: if skin parts (palm, forearm, arm) are present on the robot (iCub versions 1.2 and later)

ETH based robots: In addition to can devices also enable the following ones

  • embObjStrain
  • embObjMais
  • embObjInertials
  • embObjMotionControl
  • embObjSkin
  • embObjVirtualAnalogSensor


  • parametricCalibrator (can version)
  • parametricCalibratorEth (Ethernet version, EMS boards)

Cartesian controllers:

  • cartesiancontrollerclient
  • cartesiancontrollerserver

Prepare your system

The Debian Linux that comes installed on the pc104 is already configured. Before you go ahead make sure the Debian Live on the pc104 is configured to use SVN (use image version > 1.3).

Section 9.1 gives more details on the pc104 Debian and instructions on how to update it.

Environment variables

After booting the pc104 you should be able to login using ssh and the icub user.

Let's call ROBOT_CODE the folder in which the source code was downloaded, then verify that the following environment variables are present and correctly set-up

YARP_DIR  = $ROBOT_CODE/yarp/build-pc104
ICUB_DIR  = $ROBOT_CODE/icub-main/build-pc104
ICUBcontrib_DIR = $ROBOT_CODE/iCubContrib
icub_firmware_shared_DIR = $ROBOT_CODE/icub-firmware-shared/build-pc104

Important: double check that the environment variable YARP_ROBOT_NAME exists and matches the name of your robot (e.g. iCubAberystwyth01).

If something is missing check the pc104 installation instructions.

Note: After yarp 2.3.23 you also need to do the following:

Set YARP_DATA_DIRS and YARP_ROBOT_NAME environment variables.

Edit /home/icub/.bash_iCubrc and append:

 export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib
 export YARP_ROBOT_NAME=iCubAberystwyth01   (for example)

Getting YARP and iCub sources

You should be aware that in default installations the Linux on the pc104 mounts a directory from the laptop/server. This is visible from /usr/local/src/robot and should normally contain the software repositories in the following directories:


If for some reasons you don't have these directories you have to download the repositories from svn or git:

cd /usr/local/src/robot
Using subversion: svn co https://github.com/robotology/yarp/trunk yarp 
Using git:  git clone https://github.com/robotology/yarp.git
git clone https://github.com/robotology/icub-firmware-shared
Using subversion: svn co https://github.com/robotology/iCub-main/trunk icub-main
Using git: git clone https://github.com/robotology/icub-main.git

Don't change the location of the repositories because the icub environment on the pc104 is already configured by assuming the above directories (e.g. ICUB_ROOT, ICUB_DIR, YARP_ROOT etc..).

Compile YARP

Create the $YARP_DIR directory:

mkdir $YARP_DIR

Clean the cache and generate makefiles:

rm CMakeCache.txt
ccmake $YARP_ROOT

Do not forget to enable optimization, this will improve performances a lot. In cmake for both YARP and iCub set:


Configure (hit c):

Now enable:


Configure and generate makefiles.

Compile YARP:


Do not run make install, the current instructions assume that the binaries are not installed in system directories.

To verify the procedure type:

 yarpdev --list

among the others the list should contains also the new devices:

 Device "serial", C++ class ServerInertial, is a network wrapper,
 Device "serialport", C++ class SerialDeviceDriver, wrapped by "serial"
 Device "portaudio", C++ class ...

Compile icub-firmware-shared

Create $icub_firmware_shared_DIR if it does not exist:

 mkdir $icub_firmware_shared_DIR

Clean cache and generate makefiles:

 cd $icub_firmware_shared_DIR
 rm CMakeCache.txt
 ccmake $icub_firmware_shared_ROOT

Hit c to configure.

Hit g to generate.



Compile iCub

Create $ICUB_DIR if it does not exist:

 mkdir $ICUB_DIR

Clean cache and generate makefiles:

 rm CMakeCache.txt
 ccmake $ICUB_ROOT/main

The following options are as usual:


Hit c to configure. A long list of devices (in the form of ENABLE_icubmod_*) will appear.

You need to enable (all versions of iCub):


CAN robots:


ETH robots: enable also the following


Cartesian controller:


Versions from iCub 1.1.1 enable also:


Versions iCub 1.x.2 enable also:


Previous versions (iCub 1.0 and 1.1.0):

 ENABLE_icubmod_pcan: iCub 1.0 and 1.1.0
 ENABLE_icubmod_ecan: iCub 1.1.0

CMake will generate make files. Possible errors:

  • pcan/ecan fails to detect API(s): check that you have unpacked plxCanApi/esdCanApi in /usr/local/src/robot/drivers. cmake uses the environment variables PLXCANAPI_DIR/ESDCANAPI_DIR to locate these libraries. If you the pc104 has a Debian Live image >= 1.4 these should be already set, otherwise you have to do it manually.



DO NOT run make install, the current instructions assume that the binaries are not installed in system directories.

Note: after YARP 2.3.23 you no longer need to install applications.

To verify the procedure type:

 yarpdev --list

among the others the list should contains also the selceted devices like:

 Device "dragonfly2", C++ class DragonflyDeviceDriver2, wrapped by "grabber"
 Device "pcan", C++ class PlxCan, has no network wrapper