Compilation on the pc104
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
CAN based robots:
- canmotioncontrol: communication with the can bus
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
- parametricCalibrator (can version)
- parametricCalibratorEth (Ethernet version, EMS boards)
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.
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_ROOT = $ROBOT_CODE/yarp YARP_DIR = $ROBOT_CODE/yarp/build-pc104 ICUB_ROOT = $ROBOT_CODE/icub-main ICUB_DIR = $ROBOT_CODE/icub-main/build-pc104 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 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:
/usr/local/src/robot/icub-main /usr/local/src/robot/yarp /usr/local/src/robot/icub-firmware-shared
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
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..).
Create the $YARP_DIR directory:
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:
CREATE_LIB_MATH, set to ON CREATE_DEVICE_LIBRARY_MODULES:ON
Configure (hit c):
ENABLE_yarpmod_serial ENABLE_yarpmod_serialport ENABLE_yarpmod_portaudio
Configure and generate makefiles.
Do not run make install, the current instructions assume that the binaries are not installed in system directories.
To verify the procedure type:
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 ...
Create $icub_firmware_shared_DIR if it does not exist:
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.
Create $ICUB_DIR if it does not exist:
Clean cache and generate makefiles:
cd $ICUB_DIR 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):
ENABLE_icubmod_dragonfly2 ENABLE_icubmod_skinWrapper ENABLE_icubmod_xsensmtx
ENABLE_icubmod_sharedcan ENABLE_icubmod_canmotioncontrol ENABLE_icubmod_canBusAnalogSensor ENABLE_icubmod_canBusDoubleFTSensor ENABLE_icubmod_canBusSkin ENABLE_icubmod_canBusInertialMTB ENABLE_icubmod_canBusVirtualAnalogSensor ENABLE_icubmod_cfw2can ENABLE_icubmod_parametricCalibrator
ETH robots: enable also the following
ENABLE_icubmod_embObjAnalogSensor ENABLE_icubmod_embObjMotionControl ENABLE_icubmod_embObjSkin ENABLE_icubmod_embObjVirtualAnalogSensor ENABLE_icubmod_parametricCalibratorEth
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:
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 ...