Pc104: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
m (→‎Software: CREATE_LIB_MATH -> YARP_COMPILE_libYARP_MATH)
 
(98 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Ubuntu Server 8.04 Installation ==
''See [[pc104/Archive]] for information about previous setups.''


On 2009-05-21, we installed Ubuntu '''Server''' 8.04 'Hardy Heron' on a brand new 4GB Flash IDE memory.
The '''pc104 CPU board''' is located into the iCub's head and it runs a full (read/write) Debian distribution that boots from a USB pen drive.


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.)
= Booting and mounting =


Here is our configuration on Ubuntu Server 8.04:
During boot, the pc104 does two things: 1) it loads a Debian Live USB Flash Drive with Persistence; 2) it mounts remote NFS shares from the [[iCub laptop]].
* 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:
== USB Flash Drive ==
* Primary Boot Device: Hard Disk
* Second Boot Device: Disabled
* Third Boot Device: Disabled


At this point we have a minimal Linux system (474MB).
With respect to the standard image provided by the official iCub support, our configuration differs in the following files:


=== Network ===
.bashrc_iCub
/etc/network/interfaces
/etc/hosts
/etc/fstab
/etc/rc.iCub.d/mounts.list
/etc/rc.iCub.d/S90_mount-remote-fs.sh
/etc/timezone
/etc/resolv.conf
/etc/udev/rules.d/70-persistent-net.rules
/etc/default/ntpdate


Change the IP to 10.10.1.50 by editing /etc/network/interfaces in the following way:
== NFS shares ==
  auto lo
  iface lo inet loopback


  auto eth0
The mounted volume contains the yarp and iCub repositories (both code and binaries) and configuration files. The binaries are located in the respective '''build-pc104''' subdirectories.
  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):
= Software =
  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.
* Dependencies for 640x480@30Hz images with Bayer encoding
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 ==
sudo apt install libraw1394-dev libdc1394-22-dev


Install the following packages:
* yarp CMake configuration


  sudo apt-get install gcc g++ cmake make cvs subversion ssh libace-dev libgsl0-dev
CMAKE_BUILD_TYPE Release
CREATE_DEVICE_LIBRARY_MODULES ON
YARP_COMPILE_libYARP_MATH ON
ENABLE_yarpmod_portaudio ON
ENABLE_yarpmod_serialport ON


== Additional RobotCub software ==
CREATE_OPTIONAL_CARRIERS
ENABLE_yarpcar_bayer ON
ENABLE_yarpcar_mjpeg ON


=== iCub: downloading the repository ===
* icub-main CMake configuration


In /home/icub, do:
CMAKE_BUILD_TYPE Release
  cvs -d vislab@cvs.robotcub.org:/cvsroot/robotcub co iCub
ENABLE_icubmod_canBusAnalogSensor ON
ENABLE_icubmod_canBusSkin ON
ENABLE_icubmod_canBusVirtualAnalogSensor ON
ENABLE_icubmod_canmotioncontrol ON
ENABLE_icubmod_cartesiancontrollerclient ON
ENABLE_icubmod_cartesiancontrollerserver ON
ENABLE_icubmod_cfw2can ON
ENABLE_icubmod_dragonfly2 ON
ENABLE_icubmod_gazecontrollerclient ON
ENABLE_icubmod_parametricCalibrator ON
ENABLE_icubmod_sharedcan ON
ENABLE_icubmod_skinWrapper ON
ENABLE_icubmod_xsensmtx ON


For now, don't compile iCub but start installing YARP instead.
* yarp configuration


=== YARP ===
# <code>yarp namespace /icub</code>
# <code>yarp conf 10.10.1.53 10000</code> (yarpserver runs on [[iCub laptop]])


Type this from our homedir:
The last command writes the information of the YARP server located on [[iCub laptop]] into the file specified by <code>yarp conf</code>, which is typically <code>/home/icub/.config/yarp/_icub.conf</code>. Warning: that command overwrites previous content.
  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:
* tuning and optimization
  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")


TODO: fix the following modules -> lib_plxapi, lib_dc1394, lib_raw1394
# make sure that <code>CMAKE_BUILD_TYPE=Release</code> for both yarp and icub-main
# <code>cat /proc/sys/net/core/rmem_max</code> // should return 8388608


Now
= Updating =
  ccmake .


In CMake, type 'c' (whenever necessary) and turn on the following modules only:
In addition to yarp and icub-main, '''icub-firmware-shared''' must also be updated (these are scripts, not the firmware itself).
  CREATE_DEVICE_LIBRARY_MODULES
In order to update the firmware, use the binaries in '''icub-firmware-build''' and follow the official iCub manual.
  CREATE_LIB_MATH


  ENABLE_icubmod_canmotioncontro
= See also =
  ENABLE_icubmod_dragonfly2
  ENABLE_icubmod_icubarmcalibrat
  ENABLE_icubmod_icubheadcalibra
  ENABLE_icubmod_icublegscalibra
  ENABLE_icubmod_pcan
  ENABLE_icubmod_xsensmtx


  ENABLE_yarpmod_serial
* [http://wiki.icub.org/wiki/The_Linux_on_the_pc104 The Linux on the pc104]
  ENABLE_yarpmod_serialport
* [http://wiki.icub.org/wiki/ICub_PC104_Linux_Image_-_Detailed_info ICub PC104 Linux Image - Detailed info]
  MERGE_DEVICE_LIBRARY_MODULES
* [http://wiki.icub.org/wiki/Compilation_on_the_pc104 Compilation on the pc104]
 
* [http://wiki.icub.org/wiki/Generic_iCub_machine_installation_instructions Generic iCub machine installation instructions]
=== iCub: compiling and installing ===
* [http://wiki.icub.org/wiki/CFW002_PC104_linux_driver CFW002 PC104 linux driver]
 
Enter iCub/ and do:
  ccmake .
  c
 
Enable these modules only:
  BUILD_IN_ROOT
(to be completed)
 
== Old setup (prior to 2009-05-21) ==
 
pc104 booted from a read-only memory.
 
after booting, it mounted a part of the hard-disk of icubsrv (the laptop, IP address 10.10.1.51).
 
after that, it ran the scripts that are found in /exports/code-pc104/pc104/hooks.
you can use those scripts for making some configuration permanent on pc104 and/or to run programs.
they set up the yarp namespace, they start yarp run, configure the keys for passwordless log-ins, etc.


[[Category:Vislab]]
[[Category:Vislab]]

Latest revision as of 16:08, 28 July 2019

See pc104/Archive for information about previous setups.

The pc104 CPU board is located into the iCub's head and it runs a full (read/write) Debian distribution that boots from a USB pen drive.

Booting and mounting

During boot, the pc104 does two things: 1) it loads a Debian Live USB Flash Drive with Persistence; 2) it mounts remote NFS shares from the iCub laptop.

USB Flash Drive

With respect to the standard image provided by the official iCub support, our configuration differs in the following files:

.bashrc_iCub
/etc/network/interfaces
/etc/hosts
/etc/fstab
/etc/rc.iCub.d/mounts.list
/etc/rc.iCub.d/S90_mount-remote-fs.sh
/etc/timezone
/etc/resolv.conf
/etc/udev/rules.d/70-persistent-net.rules
/etc/default/ntpdate

NFS shares

The mounted volume contains the yarp and iCub repositories (both code and binaries) and configuration files. The binaries are located in the respective build-pc104 subdirectories.

Software

  • Dependencies for 640x480@30Hz images with Bayer encoding
sudo apt install libraw1394-dev libdc1394-22-dev
  • yarp CMake configuration
CMAKE_BUILD_TYPE Release
CREATE_DEVICE_LIBRARY_MODULES ON
YARP_COMPILE_libYARP_MATH ON
ENABLE_yarpmod_portaudio ON
ENABLE_yarpmod_serialport ON
CREATE_OPTIONAL_CARRIERS
ENABLE_yarpcar_bayer ON
ENABLE_yarpcar_mjpeg ON
  • icub-main CMake configuration
CMAKE_BUILD_TYPE Release
ENABLE_icubmod_canBusAnalogSensor ON
ENABLE_icubmod_canBusSkin ON
ENABLE_icubmod_canBusVirtualAnalogSensor ON
ENABLE_icubmod_canmotioncontrol ON
ENABLE_icubmod_cartesiancontrollerclient ON
ENABLE_icubmod_cartesiancontrollerserver ON
ENABLE_icubmod_cfw2can ON
ENABLE_icubmod_dragonfly2 ON
ENABLE_icubmod_gazecontrollerclient ON
ENABLE_icubmod_parametricCalibrator ON
ENABLE_icubmod_sharedcan ON
ENABLE_icubmod_skinWrapper ON
ENABLE_icubmod_xsensmtx ON
  • yarp configuration
  1. yarp namespace /icub
  2. yarp conf 10.10.1.53 10000 (yarpserver runs on iCub laptop)

The last command writes the information of the YARP server located on iCub laptop into the file specified by yarp conf, which is typically /home/icub/.config/yarp/_icub.conf. Warning: that command overwrites previous content.

  • tuning and optimization
  1. make sure that CMAKE_BUILD_TYPE=Release for both yarp and icub-main
  2. cat /proc/sys/net/core/rmem_max // should return 8388608

Updating

In addition to yarp and icub-main, icub-firmware-shared must also be updated (these are scripts, not the firmware itself). In order to update the firmware, use the binaries in icub-firmware-build and follow the official iCub manual.

See also