Difference between revisions of "Compilation on the pc104"

From Wiki for iCub and Friends
Jump to: navigation, search
(Replaced content with "This page has been migrated to https://icub-tech-iit.github.io/documentation/sw_installation/icub_head_manual/ .")
 
Line 1: Line 1:
[[Image:linux.jpg|right|50px]]
+
This page has been migrated to https://icub-tech-iit.github.io/documentation/sw_installation/icub_head_manual/ .
[[Image:Icubs-logo.jpg|right|150px]]
 
 
 
'''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).
 
 
 
__TOC__
 
 
 
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
 
 
 
Calibrators:
 
* 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).
 
 
 
[[The_Linux_on_the_pc104 | 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
 
 
 
YCM_SOURCE_DIR  = $ROBOT_CODE/ycm
 
YCM_DIR        = $YCM_SOURCE_DIR/build-pc104
 
YARP_SOURCE_DIR = $ROBOT_CODE/yarp
 
YARP_DIR        = $YARP_SOURCE_DIR/build-pc104
 
ICUB_SOURCE_DIR = $ROBOT_CODE/icub-main
 
ICUB_DIR        = $ICUB_SOURCE_DIR/build-pc104
 
ICUBcontrib_DIR = $ROBOT_CODE/iCubContrib
 
icub_firmware_shared_SOURCE_DIR = $ROBOT_CODE/icub-firmware-shared
 
icub_firmware_shared_DIR = $icub_firmware_shared_SOURCE_DIR/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, iCub sources and Robots configurations ===
 
 
 
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/ycm
 
/usr/local/src/robot/yarp
 
/usr/local/src/robot/icub-main
 
/usr/local/src/robot/icub-firmware-shared
 
/usr/local/src/robot/icub-contrib-common
 
/usr/local/src/robot/robots-configuration
 
 
 
If for some reasons you don't have these directories you have to download the repositories from git:
 
 
 
cd /usr/local/src/robot
 
git clone https://github.com/robotology/ycm.git
 
git clone https://github.com/robotology/yarp.git
 
git clone https://github.com/robotology/icub-main.git
 
git clone https://github.com/robotology/icub-firmware-shared.git
 
git clone https://github.com/robotology/icub-contrib-common.git
 
git clone https://github.com/robotology/robots-configuration.git
 
 
 
Importantly, the software release of each of the above repositories shall match the YARP dependencies as per the [[Software Versioning Table]].
 
 
 
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_SOURCE_DIR, ICUB_DIR, YARP_SOURCE_DIR etc..).
 
 
 
== Compile YCM ==
 
 
 
mkdir -p $YCM_DIR
 
cd $YCM_DIR
 
ccmake $YCM_SOURCE_DIR
 
make
 
 
 
'''Do not''' run make install, the current instructions assume that the binaries are not installed in system directories.
 
 
 
== Compile YARP ==
 
 
 
Create the $YARP_DIR directory:
 
 
 
mkdir $YARP_DIR
 
cd $YARP_DIR
 
 
 
Clean the cache and generate makefiles:
 
 
 
rm CMakeCache.txt
 
ccmake $YARP_SOURCE_DIR
 
 
 
Do not forget to enable optimization, this will improve performances a lot.
 
In cmake for both YARP and iCub set:
 
 
 
  CMAKE_BUILD_TYPE: Release
 
  CREATE_LIB_MATH, set to ON
 
  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
 
 
 
'''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_SOURCE_DIR
 
 
 
Hit c to configure.
 
 
 
Hit g to generate.
 
 
 
Compile:
 
 
 
  make
 
 
 
== Compile iCub ==
 
 
 
Create $ICUB_DIR if it does not exist:
 
 
  mkdir $ICUB_DIR
 
 
 
Clean cache and generate makefiles:
 
 
 
  cd $ICUB_DIR
 
  rm CMakeCache.txt
 
  ccmake $ICUB_SOURCE_DIR
 
 
 
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 (all versions of iCub):
 
 
 
  ENABLE_icubmod_dragonfly2
 
  ENABLE_icubmod_skinWrapper
 
  ENABLE_icubmod_xsensmtx
 
 
 
CAN robots:
 
  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
 
 
 
Cartesian controller:
 
  ENABLE_icubmod_cartesiancontrollerclient
 
  ENABLE_icubmod_cartesiancontrollerserver
 
 
 
Versions from '''iCub 1.1.1''' enable also:
 
  ENABLE_icubmod_cfw2can
 
  ENABLE_icubmod_skinprototype
 
 
 
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.
 
 
 
compile:
 
 
 
  make
 
 
 
'''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
 
  ...
 
 
 
== Configuring your Robot ==
 
 
 
First off, prepare the contributing helpers:
 
 
  cd $ROBOT_CODE/icub-contrib-common
 
  mkdir build && cd build
 
  ccmake ../
 
 
 
Make sure that CMAKE_INSTALL_PREFIX points to $ICUBContrib_DIR and finally do:
 
 
 
  make install
 
 
 
Further documentation is available at https://github.com/robotology/icub-contrib-common.
 
 
 
Then, proceed installing your robot configuration files:
 
 
 
  cd $ROBOT_CODE/robots-configuration
 
  mkdir build && cd build
 
  ccmake ../
 
  make install
 
 
 
In case you want to tune/modify any robot parameters, remember to create first your local copies:
 
 
 
  yarp-config robot --import $YARP_ROBOT_NAME
 
 
 
Now you should have editable copies in ~/.local/share/yarp/robots/$YARP_ROBOT_NAME.
 
 
 
Further documentation is available at https://github.com/robotology/robots-configuration.
 

Latest revision as of 19:12, 18 January 2021

This page has been migrated to https://icub-tech-iit.github.io/documentation/sw_installation/icub_head_manual/ .