Compilation on the pc104

From Wiki for RobotCub and Friends

Jump to: navigation, search

The pc104 runs Linux Debian (Live).

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).

The Debian Live that comes with the robot should be configured correctly (in particular the environment of the iCub user). For robots shipped after August 2009 the following steps have been already done for you. If you need to upgrade the software on the pc104 (or you are upgrading from the CVS repository), you need to follow these instructions.

Before you go ahead make sure the Debian Live on the pc104 is configured to use SVN (image > 1.3). Section 9.1 gives more details on the pc104 Debian Live and instructions on how to update it.

Contents

Environment variables

In addition to the iCub and YARP environment variables, and depending on the device you use you will also need:

  ESDCANAPI_DIR=/usr/local/src/robot/drivers/esdCanApi
  PLXCANAPI_DIR=/usr/local/src/robot/drivers/plxCanApi
  CWF2CANAPI_DIR=/usr/local/src/robot/drivers/cfw002

respectively for the ecan, pcan and cfw2can devices (see below).

Optimization

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

 CMAKE_BUILD_TYPE: Release

List of modules

You need the following modules:

  • serial and serialport: face expressions
  • xsensmtx: inertial sensor
  • canmotioncontrol: communication with the can bus
  • pcan: plx can interface
  • dragonfly2: cameras
  • portaudio: microphones

and the calibrators:

  • icubarmcalibrator
  • icubheadcalibrator
  • icublegscalibrator

For iCub 1.1 (force sensors and hand position sensors) users: see at the end of this page.

Compilation of modules

Some modules are compiled with YARP others, specific to the robot, are compiled with iCub.

YARP modules

 cd $YARP_DIR
 ccmake $YARP_ROOT

Set:

 CREATE_DEVICE_LIBRARY_MODULES:ON

Configure (hit c):

Now enable:

 ENABLE_yarpmod_serial
 ENABLE_yarpmod_serialport
 ENABLE_yarpmod_portaudio

Configure and generate makefiles.

Compile YARP:

 make

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

iCub modules

The procedure in this case is similar. For licensing reasons not all the code is available in the repository. First you need to get the device drivers for the ecan and pcan modules. We provide precompiled binaries for the pc104 here:

http://eris.liralab.it/iCub/downloads/drivers/linux

Get the version of the precompiled drivers that matches your system, probably: http://eris.liralab.it/iCub/downloads/drivers/linux/pc104etchnhalf-bin-1.2.tgz

Download this in /usr/local/src/robot and unpack:

 tar xvf pc104etchnhalf-bin-1.2.tgz

this will create a directory called drivers that contains the libraries you need.

Now you are ready to compile the new modules.

 cd $ICUB_DIR
 ccmake $ICUB_ROOT/main

The following options are as usual:

 CMAKE_BUILD_TYPE:Release

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

You need to enable:

 ENABLE_icubmod_pcan
 ENABLE_icubmod_canmotioncontrol
 ENABLE_icubmod_dragonfly2
 ENABLE_icubmod_logpolarclient
 ENABLE_icubmod_logpolargrabber
 ENABLE_icubmod_xsensmtx
 ENABLE_icubmod_icubarmcalibrator
 ENABLE_icubmod_icubheadcalibrator
 ENABLE_icubmod_icublegscalibrator

For iCub 1.1 (force sensors) users: see at the end of this page.

cmake should 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 this manually.

compile:

 make

To verify the procedure type:

 icubmoddev --list

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

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

iCub 1.1 modules

In iCub 1.1 (equipped with force sensors) add:

  • ecan
  • icubarmcalibratorj8
  • icubhandcalibrator

in cmake enable:

 ENABLE_icubmod_ecan 
 ENABLE_icubmod_icubarmcalibratorj8
 ENABLE_icubmod_icubhandcalibrator

iCub with CFW2

in cmake enable:

 ENABLE_icubmod_cfw2Can
Personal tools