Pc104/Archive: Difference between revisions
m (→After the installation: .bashrc) |
m (clean up) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
''If you want to look at the current setup, go back to [[pc104]].'' | |||
= 2009 notes = | |||
Ubuntu Server 8.04 Installation | |||
Between 2009-05-21 and 2009-05-26, we did some experiments with Ubuntu '''Server''' 8.04 'Hardy Heron' on a 4GB Flash IDE memory attached to the pc104 CPU board. The objective was to get rid of the laptop (icubsrv) dependency, however there are still a couple of problems with libraries in YARP which at present are unsolved: dragonfly cameras and Canbus. | |||
First of all, we changed the BIOS setting ''First Boot Device'' to: USB-CDROM. We had a Ubuntu Server 8.04 CD inside the drive. (It is apparently possible to boot and install directly from a Flash memory, but a CDROM installation is easier.) | First of all, we changed the BIOS setting ''First Boot Device'' to: USB-CDROM. We had a Ubuntu Server 8.04 CD inside the drive. (It is apparently possible to boot and install directly from a Flash memory, but a CDROM installation is easier.) | ||
Here is our configuration on Ubuntu Server 8.04: | Here is our configuration on Ubuntu Server 8.04: | ||
* hostname: pc104 | * hostname: <code>pc104</code> | ||
* automatic partitioning (which will partition the 4GB drive into an ext3 and a swap partition) | * automatic partitioning (which will partition the 4GB drive into an ext3 and a swap partition) | ||
* username: icub | * username: <code>icub</code> | ||
* no HTTP proxy | * no HTTP proxy | ||
* software selection: OpenSSH (which includes scp to copy files among machines), nothing else | * software selection: OpenSSH (which includes scp to copy files among machines), nothing else | ||
Line 21: | Line 23: | ||
At this point we have a minimal Linux system (474MB). | At this point we have a minimal Linux system (474MB). | ||
== Network == | |||
Change the IP to 10.10.1.50 by editing /etc/network/interfaces in the following way: | Change the IP to <code>10.10.1.50</code> by editing <code>/etc/network/interfaces</code> in the following way: | ||
auto lo | auto lo | ||
iface lo inet loopback | iface lo inet loopback | ||
Line 35: | Line 37: | ||
gateway 10.10.1.254 | gateway 10.10.1.254 | ||
Add the following lines in /etc/hosts (besides the already-existing lines): | Add the following lines in <code>/etc/hosts</code> (besides the already-existing lines): | ||
10.10.1.52 chico2 | 10.10.1.52 chico2 | ||
10.10.1.1 cortex1 | 10.10.1.1 cortex1 | ||
Line 44: | Line 46: | ||
10.10.1.6 cortex6 | 10.10.1.6 cortex6 | ||
Then, copy the content of directory ~/.ssh/ from a machine we have used in the past to connect to pc104 (e.g., icubsrv or chico2) to the pc104 itself. This will permit passwordless login sessions, necessary for yarprun and demos. | Then, copy the content of directory <code>~/.ssh/</code> from a machine we have used in the past to connect to pc104 (e.g., icubsrv or chico2) to the pc104 itself. This will permit passwordless login sessions, necessary for yarprun and demos. | ||
On the other machines of the network which we use to connect to pc104 (e.g., chico2, cortex cluster) you might need to delete a line of your ~/.ssh/known_hosts file (the "offending line" which contains an old key -- follow the ssh error message and just delete that line). | On the other machines of the network which we use to connect to pc104 (e.g., chico2, cortex cluster) you might need to delete a line of your <code>~/.ssh/known_hosts</code> file (the "offending line" which contains an old key -- follow the ssh error message and just delete that line). | ||
Now, passwordless logins to pc104 should be no problem from the other machines. | Now, passwordless logins to pc104 should be no problem from the other machines. | ||
Line 67: | Line 69: | ||
source $HOME/.bash_env | source $HOME/.bash_env | ||
Now create a file ~/.bash_env (used by non-interactive sessions, namely commands launched via yarprun from another machine) containing these variables: | Now create a file <code>~/.bash_env</code> (used by non-interactive sessions, namely commands launched via <code>yarprun</code> from another machine) containing these variables: | ||
export ICUB_DIR=/home/icub/iCub | export ICUB_DIR=/home/icub/iCub | ||
export ICUB_ROOT=$ICUB_DIR | export ICUB_ROOT=$ICUB_DIR | ||
export PATH=$PATH:/ | export YARP_DIR=/home/icub/yarp2 | ||
export YARP_ROOT=$YARP_DIR | |||
export PATH=$PATH:$ICUB_DIR/bin | |||
export PATH=$PATH:$YARP_DIR/bin | |||
= 2011 notes = | |||
It boots from a read-only memory (using a [http://debian-live.alioth.debian.org/ Debian Live distribution]), therefore it is necessary to mount an external partition to make permanent changes to files and perform basic I/O. This is accomplished by mounting an external partition on the pc104 at boot time. | |||
== Booting and mounting == | |||
After that, it runs the scripts that are found in icubsrv's <code>/exports/code-pc104/pc104/hooks</code> directory. You can use those scripts for making some configuration permanent on pc104 and/or to run programs. They set up the yarp namespace, configure the keys for passwordless log-ins, etc. | |||
== About the hook scripts == | |||
The common version of the hook scripts is located in the RobotCub repository, under <code>/usr/local/src/robot/iCub/pc104/startupscripts/opencall/hooks</code> (available, for example, on icubsrv). The procedure is to copy them to icubsrv's <code>/exports/code-pc104/pc104/hooks</code> and then to customize VisLab-specific settings there. | |||
== Software == | |||
* Custom yarp2 configuration | |||
CMAKE_BUILD_TYPE Release | |||
CREATE_DEVICE_LIBRARY_MODULES ON | |||
CREATE_GUIS ON // probably not needed | |||
CREATE_LIB_MATH ON | |||
CREATE_YARPSERVER3 ON | |||
ENABLE_yarpmod_portaudio ON | |||
ENABLE_yarpmod_serial | |||
ENABLE_yarpmod_serialport | |||
* Custom iCub configuration | |||
BUILD_TESTING ON | |||
CMAKE_BUILD_TYPE Release | |||
ENABLE_icubmod_canmotioncontrol ON | |||
ENABLE_icubmod_cartesiancontrollerclient ON // not needed! this is for the servers | |||
ENABLE_icubmod_cartesiancontrollerserver ON | |||
ENABLE_icubmod_cfw2can ON | |||
ENABLE_icubmod_dragonfly2 ON | |||
ENABLE_icubmod_icubarmcalibrator ON | |||
ENABLE_icubmod_icubhandcalibrator ON | |||
ENABLE_icubmod_icubheadcalibrator ON | |||
ENABLE_icubmod_icublegscalibrator ON | |||
ENABLE_icubmod_logpolarclient ON | |||
ENABLE_icubmod_logpolargrabber ON | |||
ENABLE_icubmod_pcan ON // for the old head, now called iCubLisboa02 | |||
ENABLE_icubmod_xsensmtx ON | |||
== Additional RobotCub software == | == Additional RobotCub software == | ||
Line 76: | Line 124: | ||
=== iCub: downloading the repository === | === iCub: downloading the repository === | ||
In /home/icub, do: | In <code>/home/icub</code>, do: | ||
cvs -d vislab@cvs.robotcub.org:/cvsroot/robotcub co iCub | cvs -d vislab@cvs.robotcub.org:/cvsroot/robotcub co iCub | ||
Line 88: | Line 136: | ||
cd yarp2 | cd yarp2 | ||
Enter yarp2/conf and do: | Enter <code>yarp2/conf</code> and do: | ||
cp ExternalModules.cmake.template ExternalModules.cmake | cp ExternalModules.cmake.template ExternalModules.cmake | ||
then write the following lines in ExternalModules.cmake: | then write the following lines in ExternalModules.cmake: | ||
Line 94: | Line 142: | ||
SET(icub_DIR "/home/icub/iCub/src/modules") | SET(icub_DIR "/home/icub/iCub/src/modules") | ||
We now have to install two FireWire IEEE-1394 libraries needed by dragonfly and dragonfly2: '''libraw1394''' and '''libdc1394'''. Rather than installing the Ubuntu packages, we compile them manually. Do these two sequences of commands from icub's home dir (pay attention | We now have to install two FireWire IEEE-1394 libraries needed by dragonfly and dragonfly2: '''libraw1394''' and '''libdc1394'''. Rather than installing the Ubuntu packages, we compile them manually. Do these two sequences of commands from icub's home dir (pay attention: ./configure has a --prefix option). First '''libraw1394''': | ||
wget http://www.linux1394.org/dl/libraw1394-2.0.2.tar.gz ''<-- or a newer version from http://www.linux1394.org/'' | wget http://www.linux1394.org/dl/libraw1394-2.0.2.tar.gz ''<-- or a newer version from http://www.linux1394.org/'' | ||
Line 103: | Line 151: | ||
sudo make install | sudo make install | ||
As for '''libdc1394''', we follow the instructions in $ICUB_DIR/src/modules/dragonfly2/linux/readme.txt: | |||
wget http://downloads.sourceforge.net/libdc1394/libdc1394-2.1.0.tar.gz?modtime=1200479950&big_mirror=0 | wget http://downloads.sourceforge.net/libdc1394/libdc1394-2.1.0.tar.gz?modtime=1200479950&big_mirror=0 | ||
tar xzvf libdc1394-2.1.0.tar.gz | tar xzvf libdc1394-2.1.0.tar.gz | ||
cd libdc1394-2.1.0/ | cd libdc1394-2.1.0/ | ||
followed by | |||
./configure --prefix=/usr | ./configure --prefix=/usr | ||
which must say | which must say | ||
Line 117: | Line 165: | ||
IIDC-over-USB support: Disabled (libusb-1.0 not found) | IIDC-over-USB support: Disabled (libusb-1.0 not found) | ||
then, finally, | |||
make | make | ||
sudo make install | sudo make install | ||
Line 149: | Line 197: | ||
=== iCub: compiling and installing === | === iCub: compiling and installing === | ||
Enter iCub/ and do: | Enter <code>iCub/</code> and do: | ||
ccmake . | ccmake . | ||
c | c | ||
Line 156: | Line 204: | ||
BUILD_IN_ROOT | BUILD_IN_ROOT | ||
(to be completed) | (to be completed) | ||
= 2014 notes = | |||
== Repositories on icubsrv laptop == | |||
Note that the icubsrv laptop has 2 locations for the repositories: | |||
* <code>/exports/code-64</code> for the laptop itself (compiled for 64bit, rarely used) | |||
* <code>/exports/code-pc104</code> for pc104 (compiled for 32bit, this is the one that is actually used) | |||
== Updating the repositories == | |||
First method: from a pc104 console, normally update and compile the repositories as if on a normal machine - see [[RobotCub software]] for details. Note that after compiling iCub you must type <code>make install_applications</code> as well: this will copy files from <code>$ICUB_ROOT/main/app/robots/iCubLisboa01</code> to <code>$ICUB_ROOT/app/iCubLisboa01</code> (check that the new versions are effectively copied). | |||
If the above method fails for any reason (old version of svn, internet problems with DNS or NTP, etc.) you can use the following workaround: | |||
# open a pc104 shell window | |||
# open an icubsrv shell window | |||
# on icubsrv: <code>svn update /exports/code-pc104/yarp2</code> and <code>/exports/code-pc104/iCub</code> (for now we need to do this from icubsrv because the version of svn on pc104 is too old) | |||
# on pc104: cmake, make in <code>$YARP_DIR</code> (the files are physically on icubsrv, but we need to issue the command from pc104 to obtain 32bit binaries) | |||
# on pc104: cmake, make, make install_applications in <code>$ICUB_DIR</code> (the files are physically on icubsrv, but we need to issue the command from pc104 to obtain 32bit binaries) | |||
== Software == | |||
* Custom iCub configuration using iCubInterface | |||
CMAKE_BUILD_TYPE Release | |||
ENABLE_icubmod_canmotioncontrol ON | |||
ENABLE_icubmod_cartesiancontrollerclient ON | |||
ENABLE_icubmod_cartesiancontrollerserver ON | |||
ENABLE_icubmod_cfw2can ON | |||
ENABLE_icubmod_dragonfly2 ON | |||
ENABLE_icubmod_dragonfly2raw ON | |||
ENABLE_icubmod_icubarmcalibrator ON | |||
ENABLE_icubmod_icubarmcalibratorj8 ON | |||
ENABLE_icubmod_icubhandcalibrator ON | |||
ENABLE_icubmod_icubheadcalibrator ON | |||
ENABLE_icubmod_icubheadcalibratorV2 ON | |||
ENABLE_icubmod_icublegscalibrator ON | |||
ENABLE_icubmod_logpolarclient ON | |||
ENABLE_icubmod_logpolargrabber ON | |||
ENABLE_icubmod_skinprototype ON | |||
ENABLE_icubmod_xsensmtx ON |
Latest revision as of 17:33, 3 December 2014
If you want to look at the current setup, go back to pc104.
2009 notes
Ubuntu Server 8.04 Installation
Between 2009-05-21 and 2009-05-26, we did some experiments with Ubuntu Server 8.04 'Hardy Heron' on a 4GB Flash IDE memory attached to the pc104 CPU board. The objective was to get rid of the laptop (icubsrv) dependency, however there are still a couple of problems with libraries in YARP which at present are unsolved: dragonfly cameras and Canbus.
First of all, we changed the BIOS setting First Boot Device to: USB-CDROM. We had a Ubuntu Server 8.04 CD inside the drive. (It is apparently possible to boot and install directly from a Flash memory, but a CDROM installation is easier.)
Here is our configuration on Ubuntu Server 8.04:
- hostname:
pc104
- automatic partitioning (which will partition the 4GB drive into an ext3 and a swap partition)
- username:
icub
- no HTTP proxy
- software selection: OpenSSH (which includes scp to copy files among machines), nothing else
After a while, the CDROM will eject automatically. Remove it and, after reboot, change the BIOS boot sequence settings to the default, which is:
- Primary Boot Device: Hard Disk
- Second Boot Device: Disabled
- Third Boot Device: Disabled
At this point we have a minimal Linux system (474MB).
Network
Change the IP to 10.10.1.50
by editing /etc/network/interfaces
in the following way:
auto lo iface lo inet loopback
auto eth0 iface eth0 inet static address 10.10.1.50 netmask 255.255.255.0 network 10.10.1.0 broadcast 10.10.1.255 gateway 10.10.1.254
Add the following lines in /etc/hosts
(besides the already-existing lines):
10.10.1.52 chico2 10.10.1.1 cortex1 10.10.1.2 cortex2 10.10.1.3 cortex3 10.10.1.4 cortex4 10.10.1.5 cortex5 10.10.1.6 cortex6
Then, copy the content of directory ~/.ssh/
from a machine we have used in the past to connect to pc104 (e.g., icubsrv or chico2) to the pc104 itself. This will permit passwordless login sessions, necessary for yarprun and demos.
On the other machines of the network which we use to connect to pc104 (e.g., chico2, cortex cluster) you might need to delete a line of your ~/.ssh/known_hosts
file (the "offending line" which contains an old key -- follow the ssh error message and just delete that line).
Now, passwordless logins to pc104 should be no problem from the other machines.
After the installation
Install the following packages:
sudo apt-get install gcc g++ cmake make cvs subversion ssh libace-dev libgsl0-dev
Write this at the bottom of ~/.bashrc
export ICUB_DIR=/home/icub/iCub export ICUB_ROOT=$ICUB_DIR export YARP_DIR=/home/icub/yarp2 export YARP_ROOT=$YARP_DIR export PATH=$PATH:$ICUB_DIR/bin export PATH=$PATH:$YARP_DIR/bin
Then, before the following line of /etc/bash.bashrc
[ -z "$PS1" ] && return
add this:
# per-user environment variables (non-interactive and interactive mode) source $HOME/.bash_env
Now create a file ~/.bash_env
(used by non-interactive sessions, namely commands launched via yarprun
from another machine) containing these variables:
export ICUB_DIR=/home/icub/iCub export ICUB_ROOT=$ICUB_DIR export YARP_DIR=/home/icub/yarp2 export YARP_ROOT=$YARP_DIR export PATH=$PATH:$ICUB_DIR/bin export PATH=$PATH:$YARP_DIR/bin
2011 notes
It boots from a read-only memory (using a Debian Live distribution), therefore it is necessary to mount an external partition to make permanent changes to files and perform basic I/O. This is accomplished by mounting an external partition on the pc104 at boot time.
Booting and mounting
After that, it runs the scripts that are found in icubsrv's /exports/code-pc104/pc104/hooks
directory. You can use those scripts for making some configuration permanent on pc104 and/or to run programs. They set up the yarp namespace, configure the keys for passwordless log-ins, etc.
About the hook scripts
The common version of the hook scripts is located in the RobotCub repository, under /usr/local/src/robot/iCub/pc104/startupscripts/opencall/hooks
(available, for example, on icubsrv). The procedure is to copy them to icubsrv's /exports/code-pc104/pc104/hooks
and then to customize VisLab-specific settings there.
Software
- Custom yarp2 configuration
CMAKE_BUILD_TYPE Release CREATE_DEVICE_LIBRARY_MODULES ON CREATE_GUIS ON // probably not needed CREATE_LIB_MATH ON CREATE_YARPSERVER3 ON ENABLE_yarpmod_portaudio ON ENABLE_yarpmod_serial ENABLE_yarpmod_serialport
- Custom iCub configuration
BUILD_TESTING ON CMAKE_BUILD_TYPE Release ENABLE_icubmod_canmotioncontrol ON ENABLE_icubmod_cartesiancontrollerclient ON // not needed! this is for the servers ENABLE_icubmod_cartesiancontrollerserver ON ENABLE_icubmod_cfw2can ON ENABLE_icubmod_dragonfly2 ON ENABLE_icubmod_icubarmcalibrator ON ENABLE_icubmod_icubhandcalibrator ON ENABLE_icubmod_icubheadcalibrator ON ENABLE_icubmod_icublegscalibrator ON ENABLE_icubmod_logpolarclient ON ENABLE_icubmod_logpolargrabber ON ENABLE_icubmod_pcan ON // for the old head, now called iCubLisboa02 ENABLE_icubmod_xsensmtx ON
Additional RobotCub software
iCub: downloading the repository
In /home/icub
, do:
cvs -d vislab@cvs.robotcub.org:/cvsroot/robotcub co iCub
For now, don't compile iCub but start installing YARP instead.
YARP
Type this from our homedir:
cvs -d:pserver:anonymous@yarp0.cvs.sourceforge.net:/cvsroot/yarp0 login cvs -z3 -d:pserver:anonymous@yarp0.cvs.sourceforge.net:/cvsroot/yarp0 co -P yarp2 cd yarp2
Enter yarp2/conf
and do:
cp ExternalModules.cmake.template ExternalModules.cmake
then write the following lines in ExternalModules.cmake:
SET(EXTERNAL_MODULES icub) SET(icub_DIR "/home/icub/iCub/src/modules")
We now have to install two FireWire IEEE-1394 libraries needed by dragonfly and dragonfly2: libraw1394 and libdc1394. Rather than installing the Ubuntu packages, we compile them manually. Do these two sequences of commands from icub's home dir (pay attention: ./configure has a --prefix option). First libraw1394:
wget http://www.linux1394.org/dl/libraw1394-2.0.2.tar.gz <-- or a newer version from http://www.linux1394.org/ tar xzvf libraw1394-2.0.2.tar.gz cd libraw1394-2.0.2/ ./configure --prefix=/usr make sudo make install
As for libdc1394, we follow the instructions in $ICUB_DIR/src/modules/dragonfly2/linux/readme.txt:
wget http://downloads.sourceforge.net/libdc1394/libdc1394-2.1.0.tar.gz?modtime=1200479950&big_mirror=0 tar xzvf libdc1394-2.1.0.tar.gz cd libdc1394-2.1.0/
followed by
./configure --prefix=/usr
which must say
Configuration (libdc1394): libraw1394 support (Linux legacy): Enabled <-- required by yarpdev. If you obtain 'Disabled', check the libraw1394 installation Juju support (Linux new): Enabled Mac OS X support: Disabled (Mac OS not detected) Windows support: Disabled (Windows not detected) IIDC-over-USB support: Disabled (libusb-1.0 not found)
then, finally,
make sudo make install
Note: by default, in Ubuntu, only the administrator has access to the FireWire camera device files in /dev. So we need to manually add user icub into the video and disk groups:
sudo usermod -a -G video icub sudo usermod -a -G disk icub
TODO: fix libdc1394 (yarpdev is giving "Can't set DC1394_CAPTURE_FLAGS_DEFAULT", both with dragonfly and dragonfly2) TODO: fix the following modules -> lib_plxapi (Canbus)
Now
ccmake .
In CMake, type 'c' (whenever necessary) and turn on the following modules only:
CREATE_DEVICE_LIBRARY_MODULES CREATE_LIB_MATH
ENABLE_icubmod_canmotioncontro ENABLE_icubmod_dragonfly2 ENABLE_icubmod_icubarmcalibrat ENABLE_icubmod_icubheadcalibra ENABLE_icubmod_icublegscalibra ENABLE_icubmod_pcan ENABLE_icubmod_xsensmtx
ENABLE_yarpmod_serial ENABLE_yarpmod_serialport MERGE_DEVICE_LIBRARY_MODULES
iCub: compiling and installing
Enter iCub/
and do:
ccmake . c
Enable these modules only:
BUILD_IN_ROOT
(to be completed)
2014 notes
Repositories on icubsrv laptop
Note that the icubsrv laptop has 2 locations for the repositories:
/exports/code-64
for the laptop itself (compiled for 64bit, rarely used)/exports/code-pc104
for pc104 (compiled for 32bit, this is the one that is actually used)
Updating the repositories
First method: from a pc104 console, normally update and compile the repositories as if on a normal machine - see RobotCub software for details. Note that after compiling iCub you must type make install_applications
as well: this will copy files from $ICUB_ROOT/main/app/robots/iCubLisboa01
to $ICUB_ROOT/app/iCubLisboa01
(check that the new versions are effectively copied).
If the above method fails for any reason (old version of svn, internet problems with DNS or NTP, etc.) you can use the following workaround:
- open a pc104 shell window
- open an icubsrv shell window
- on icubsrv:
svn update /exports/code-pc104/yarp2
and/exports/code-pc104/iCub
(for now we need to do this from icubsrv because the version of svn on pc104 is too old) - on pc104: cmake, make in
$YARP_DIR
(the files are physically on icubsrv, but we need to issue the command from pc104 to obtain 32bit binaries) - on pc104: cmake, make, make install_applications in
$ICUB_DIR
(the files are physically on icubsrv, but we need to issue the command from pc104 to obtain 32bit binaries)
Software
- Custom iCub configuration using iCubInterface
CMAKE_BUILD_TYPE Release ENABLE_icubmod_canmotioncontrol ON ENABLE_icubmod_cartesiancontrollerclient ON ENABLE_icubmod_cartesiancontrollerserver ON ENABLE_icubmod_cfw2can ON ENABLE_icubmod_dragonfly2 ON ENABLE_icubmod_dragonfly2raw ON ENABLE_icubmod_icubarmcalibrator ON ENABLE_icubmod_icubarmcalibratorj8 ON ENABLE_icubmod_icubhandcalibrator ON ENABLE_icubmod_icubheadcalibrator ON ENABLE_icubmod_icubheadcalibratorV2 ON ENABLE_icubmod_icublegscalibrator ON ENABLE_icubmod_logpolarclient ON ENABLE_icubmod_logpolargrabber ON ENABLE_icubmod_skinprototype ON ENABLE_icubmod_xsensmtx ON