Generic iCub machine installation instructions

From Wiki for iCub and Friends
Revision as of 14:59, 22 October 2014 by Matteo.brunettini@iit.it (talk | contribs) (iCub software repository and common packages)
Jump to: navigation, search

This page contains instructions on how to prepare a machine to work in the iCub Subnet environment. This is a basic setup, useful as a starting point to prepare any kind of machine of the iCub ecosystem.

Operative System

You can choose both a Debian or Ubuntu Linux, the curently suggested OS is Debian 7 (wheezy)

Creation of the icub user

You need to create the icub user. For nfs (see later) to work this user has to have the uid 1000 and guid 1000. In LINUX starting procedure, it is asked to create the first user. By default uid is set at 1000. to make sure it is done do :

id -u icub
id -g icub

Add the icub user to the sudoers group, by editing in /etc/group the following line

 sudo:x:27:icub

Network configuration

You have two options:

  • Static IP address (this option is mandatory if there is no DHCP in you subnet - like in the case of iCub Laptop - or if your machine is the DHCP server - this is the case of icub server)
  • Dynamic DHCP IP address

Dynamic IP configuration

To configure a dynamic IP adress, edit /etc/network/interfaces, as follows (where eth0 is the interface to configure)

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet dhcp

Static IP configuration

To configure a static IP adress, edit /etc/network/interfaces, as follows (where eth0 is the interface to configure)

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet static
   address 10.0.0.MACHINE_IP
   netmask NETMASK
   gateway GATEWAY_IP
   dns-nameservers DNS_IP 8.8.8.8
   dns-domain icub.local
   dns-search icub.local

and replace MACHINE_IP NETMASK DNS_IP GATEWAY_IP with the appropriate values for you network.
As example, in case of a machine in an environment with the icub server the above configuration will be (where MACHINE_IP is now 10.0.0.16)

 # The primary network interface
 auto eth0
 allow-hotplug eth0
 iface eth0 inet static
   address 10.0.0.16
   netmask 255.255.255.0
   network 10.0.0.0
   broadcast 10.0.0.255
   gateway 10.0.0.1
   dns-nameservers 10.0.0.1 8.8.8.8
   dns-domain icub.local
   dns-search icub.local

In case of Static IP, please check that the file /etc/hosts looks as follows

 127.0.0.1       localhost
 127.0.1.1       MACHINE_HOSTNAME.icub.local       MACHINE_HOSTNAME

and replace MACHINE_HOSTNAME with the hostname of you machine, that should match the file /etc/hostname

Required Packages

Please install the following packages (names are correct for Debian 7, please check the corresponding package in your distribution):

 nfs-common python-tk libopencv-dev ntp vim ssh

Software repository

NOTE : this step is require only for a Debian machine.
Enable the non-free and contrib sources, by editing the file /etc/apt/sources.list Exaple:

deb http://mi.mirror.garr.it/mirrors/debian/ wheezy main non-free contrib
deb-src http://mi.mirror.garr.it/mirrors/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main non-free contrib
deb-src http://security.debian.org/ wheezy/updates main non-free contrib
# wheezy-updates, previously known as 'volatile'
deb http://mi.mirror.garr.it/mirrors/debian/ wheezy-updates main non-free contrib
deb-src http://mi.mirror.garr.it/mirrors/debian/ wheezy-updates main non-free contrib

iCub software repository and common packages

Configure the iCub software repository, by creating the file /etc/apt/sources.list.d/icub.list as following example for a Debian Wheezy machine :

 deb http://www.icub.org/debian wheezy contrib/science

Replace debian and wheezy accordingly to your distribution. Install the following packages from icub repository

 icub-common

mount remote NFS shares

NOTE : skip this step in case of icub server To mount the remote NFS shares, edit /etc/fstab, by adding the folowing lines

 NFS_SERVER_IP:/exports/code /usr/local/src/robot nfs _netdev,auto,hard,intr  0 0
 NFS_SERVER_IP:/exports/local_yarp    /home/icub/.local/share/yarp nfs _netdev,auto,hard,intr 0 0

and replace NFS_SERVER_IP with the appropriate value for you network. As example, in case of a machine in an environment with the icub server the above configuration will be

 10.0.0.1:/exports/code /usr/local/src/robot nfs _netdev,auto,hard,intr  0 0
 10.0.0.1:/exports/local_yarp    /home/icub/.local/share/yarp nfs _netdev,auto,hard,intr 0 0

Then create the two above mountpoints as follows

 mkdir -p /home/icub/.local/share/yarp
 mkdir -p /usr/local/src/robot

NTP configuration

NOTE : skip this step in case of icub server

Edit the file /etc/ntp.conf by adding the following lines

 server NTP_SERVER_IP

and replace NTP_SERVER_IP with the appropriate value for you network. As example, in case of a machine in an environment with the icub server the above configuration will be

 server 10.0.0.1

icub user enviroment variables

NOTE : skip this step in case of icub server

Optional - Configure remote desktop

If you want to setup a VNC remote desktop, execute from a graphical session the following command

 vino-preferences

Optional - disable the screen power off

Using the gnome3 control panel, it is not possible to avoid the system has to be idle for the monitor to be turned off, the maximum time is "1 hour", "never" is not possible. From the command line execute the following commands

gsettings set org.gnome.settings-daemon.plugins.power sleep-display-ac 0
gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 0
gsettings set org.gnome.desktop.session idle-delay 0

Optional - install nVidia video drivers

  • Install the following packages
 nvidia-glx nvidia-settings nvidia-xconfig
  • Run nvidia-xconfig
  • Reboot

Optional - Fix the the .local domains resolution problems

NOTE: only on clients, NOT on icub server. Edit /etc/nsswitch replacing the following line

 hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

with

 hosts:          files dns

Optional - install opencv version 2.4.8

Download the sources of Opencv-2.4.8 Unzip and build with

 cmake -D CMAKE_BUILD_TYPE=RELEASE

if you dont't want to install it, you can setup the environment variable OpenCV_DIR, es:

 export OpenCV_DIR=$code/opencv/opencv-2.4.8/build

Optional - how to fix ssh lag on connect

In case of lag in SSH connections, disable DNS lookup on ssh server, edit the file /etc/ssh/sshd_config adding the following line

UseDNS no

Optional - how to fix the "nobody:nobody" NFS mount issue

If the NFS mounts shows NOBODY as UID and GUID, this mean that the client and the server are not in the same domain, check the file

 /etc/idmap.conf

Usually it is derived from the domain name mentioned in

 /etc/resolv.conf

so both, server and client must match.