Difference between revisions of "Generic iCub machine installation instructions"

From Wiki for iCub and Friends
Jump to: navigation, search
(Optional - install nVidia video drivers =)
(iCub user environment variables)
 
(92 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
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.
 
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 ==
+
== Operating System ==
You can choose both a Debian or Ubuntu Linux, the curently suggested OS is '''Debian 7 (wheezy)'''
+
You can choose both a Debian or Ubuntu Linux, the currently suggested OS is [http://releases.ubuntu.com/16.04/ Ubuntu 16.04 (Xenial Xerus)]
  
 
== Creation of the icub user ==
 
== Creation of the icub user ==
Line 10: Line 10:
 
Add the icub user to the sudoers group, by editing in /etc/group the following line
 
Add the icub user to the sudoers group, by editing in /etc/group the following line
 
   sudo:x:27:icub
 
   sudo:x:27:icub
 +
 +
== Required and useful Packages ==
 +
Please install the following packages (names are correct for Ubuntu 16.04, please check the corresponding package in your distribution):
 +
  nfs-common python-tk libopencv-dev ntpdate ssh cmake-curses-gui
 +
Also install (optional, but very useful) the following packages:
 +
vim iperf
 +
 +
== Software repository ==
 +
'''NOTE''' : this step is required only for a Debian machine.<br />
 +
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 ==
 +
'''NOTE''' : skip this step in case of icub server<br />
 +
Configure the iCub software repository, by creating the file /etc/apt/sources.list.d/icub.list as following example
 +
*for a Debian 7 (Wheezy) machine :
 +
  deb http://www.icub.org/debian wheezy contrib/science
 +
*for a Ubuntu 16.04 LTS (Trusty) machine :
 +
  deb http://www.icub.org/ubuntu xenial contrib/science
 +
 +
Download the packages signature
 +
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 57A5ACB6110576A6
 +
 +
After adding a new source, remember to update the packages list:
 +
apt-get update
 +
 +
Install the following packages from icub repository
 +
  icub-common
 +
 +
=== Optional : install QT libraries ===
 +
'''NOTE''': ''this step is not required if you installed the icub-common package with version > 1.1.15''<br />
 +
 +
Please install the following packages (please check the corresponding package in your distribution):
 +
*for a Debian 7 (Wheezy) machine (''in this release packages are from backports repository''):
 +
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qml-module-qtquick2 qml-module-qtquick-window2 qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls libqt5svg5
 +
*for a Ubuntu 14.04 LTS (Trusty) machine :
 +
  qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-qtmultimedia-plugin qtdeclarative5-controls-plugin qtdeclarative5-dialogs-plugin libqt5svg5
  
 
== Network configuration ==
 
== Network configuration ==
Line 19: Line 63:
 
To configure a dynamic IP adress, edit /etc/network/interfaces, as follows (where ''eth0'' is the interface to configure)
 
To configure a dynamic IP adress, edit /etc/network/interfaces, as follows (where ''eth0'' is the interface to configure)
 
   # The primary network interface
 
   # The primary network interface
   auth0 eth0
+
   auto eth0
 
   allow-hotplug eth0
 
   allow-hotplug eth0
 
   iface eth0 inet dhcp
 
   iface eth0 inet dhcp
 +
 
=== Static IP configuration ===
 
=== Static IP configuration ===
 
To configure a static IP adress, edit /etc/network/interfaces, as follows (where ''eth0'' is the interface to configure)
 
To configure a static IP adress, edit /etc/network/interfaces, as follows (where ''eth0'' is the interface to configure)
 
   # The primary network interface
 
   # The primary network interface
   auth0 eth0
+
   auto eth0
 
   allow-hotplug eth0
 
   allow-hotplug eth0
 
   iface eth0 inet static
 
   iface eth0 inet static
Line 34: Line 79:
 
     dns-domain icub.local
 
     dns-domain icub.local
 
     dns-search 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
+
and replace '''MACHINE_IP''' '''NETMASK''' '''DNS_IP''' '''GATEWAY_IP''' with the appropriate values for you network.<br />
 +
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
 
   # The primary network interface
   auth0 eth0
+
   auto eth0
 
   allow-hotplug eth0
 
   allow-hotplug eth0
 
   iface eth0 inet static
 
   iface eth0 inet static
Line 53: Line 99:
 
and replace '''MACHINE_HOSTNAME''' with the hostname of you machine, that should match the file /etc/hostname
 
and replace '''MACHINE_HOSTNAME''' with the hostname of you machine, that should match the file /etc/hostname
  
== Required Packages ==
+
== mount remote NFS shares ==
Please install the following packages (names are correct for Debian 7, please check the corresponding package in your distribution):
+
'''NOTE''' : ''skip this step in case of icub server or icub "standalone" latop (without iCub rack servers)''<br />
  nfs-common python-tk libopencv-dev ntp vim ssh
+
To mount the remote NFS shares, edit /etc/fstab, by adding the folowing lines
 
+
  '''NFS_SERVER_IP''':/exports/code /usr/local/src/robot nfs soft,retry=1,timeo=60,_netdev,auto  0 0
== Software repository ==
+
  '''NFS_SERVER_IP''':/exports/local_yarp    /home/icub/.local/share/yarp nfs soft,retry=1,timeo=60,_netdev,auto 0 0
''NOTE'' : this step is require only for a Debian machine.
+
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
Enable the '''non-free''' and '''contrib''' sources, by editing the file /etc/apt/sources.list
+
  10.0.0.1:/exports/code /usr/local/src/robot nfs soft,retry=1,timeo=60,_netdev,auto 0 0
Exaple:
+
  10.0.0.1:/exports/local_yarp    /home/icub/.local/share/yarp nfs soft,retry=1,timeo=60,_netdev,auto 0 0
deb http://mi.mirror.garr.it/mirrors/debian/ wheezy main non-free contrib
+
Then create the two above mountpoints as follows  
  deb-src http://mi.mirror.garr.it/mirrors/debian/ wheezy main non-free contrib
+
   mkdir -p /home/icub/.local/share/yarp
deb http://security.debian.org/ wheezy/updates main non-free contrib
+
   mkdir -p /usr/local/src/robot
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 follows (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
 
  
 
== NTP configuration ==
 
== NTP configuration ==
 +
'''NOTE''' : ''skip this step in case of icub server or icub latop''<br />
 
Edit the file /etc/ntp.conf by adding the following lines
 
Edit the file /etc/ntp.conf by adding the following lines
 
   server '''NTP_SERVER_IP'''
 
   server '''NTP_SERVER_IP'''
Line 82: Line 118:
 
   server 10.0.0.1
 
   server 10.0.0.1
  
== icub user enviroment variables ==
+
== iCub user environment variables ==
 +
'''NOTE''' : skip this step in case of iCub server<br />
 +
 
 +
=== iCub .bashrc ===
 +
Add the file /home/icub/.bashrc_iCub
 +
as [https://git.robotology.eu/mbrunettini/icub-environment/blob/master/bashrc_iCub here]
 +
 
 +
Then add the following lines
 +
#Load the iCub custom bashrc
 +
if [ "$HOME" != "" ]; then
 +
  ICUBRC_FILE="${HOME}/.bashrc_iCub"
 +
else
 +
  ICUBRC_FILE="/home/icub/.bashrc_iCub"
 +
fi
 +
if [ -f "$ICUBRC_FILE" ]; then
 +
  source $ICUBRC_FILE
 +
fi
 +
at the beginning of file /home/icub/.bashrc just BEFORE the following lines:
 +
 
 +
# If not running interactively, don't do anything
 +
case $- in
 +
    *i*) ;;
 +
      *) return;;
 +
esac
 +
 
 +
You can also download the .bashrc_iCub file here: <br />
 +
''(please remember to rename it by adding a starting ".")''
 +
*[https://git.robotology.eu/MBrunettini/icub-environment/raw/master/home/bashrc_iCub .bashrc_iCub]
 +
 
 +
=== iCub bashrc customization ===
 +
There are several customization you need to apply to the file .bashrc_iCub:
 +
* The YARP_ROBOT_NAME - you must insert your robot name, in the following line
 +
#export YARP_ROBOT_NAME=
 +
* The build path - the folder name where you object are created by cmake, in the following line
 +
#export OBJ_SUBDIR="build"
 +
 
 +
=== iCub Environment debugging ===
 +
In case of any problem with environment, see also the page [[Debugging_problems_with_yarprun]]
  
 
== ''Optional'' - Configure remote desktop ==
 
== ''Optional'' - Configure remote desktop ==
 
If you want to setup a VNC remote desktop, execute from a graphical session the following command
 
If you want to setup a VNC remote desktop, execute from a graphical session the following command
 
   vino-preferences
 
   vino-preferences
 +
If you get this error ''The authentication mechanism requested can not be provided by the computer''
 +
please launch the following command, from a shell terminal
 +
  gsettings set org.gnome.Vino enabled true
  
 
== ''Optional'' - disable the screen power off ==
 
== ''Optional'' - disable the screen power off ==
Line 98: Line 174:
 
*Install the following packages
 
*Install the following packages
 
   nvidia-glx nvidia-settings nvidia-xconfig
 
   nvidia-glx nvidia-settings nvidia-xconfig
*Run nvidia-xconfig*
+
*Run nvidia-xconfig
Reboot
+
*Reboot
  
 
== ''Optional'' - Fix the the .local domains resolution problems ==
 
== ''Optional'' - Fix the the .local domains resolution problems ==
'''NOTE''': only on clients, NOT on icub server.
+
'''NOTE''': only on clients, NOT on icub server.<br />
 
Edit /etc/nsswitch replacing the following line
 
Edit /etc/nsswitch replacing the following line
 
   hosts:          files mdns4_minimal '''[NOTFOUND=return]''' dns mdns4
 
   hosts:          files mdns4_minimal '''[NOTFOUND=return]''' dns mdns4
Line 125: Line 201:
 
   /etc/resolv.conf
 
   /etc/resolv.conf
 
so both, server and client must match.
 
so both, server and client must match.
 +
 +
== Special computers ==
 +
In case of special machines (such as the cuda workstation or icub laptop) you must follow further steps in order to complete the installation:
 +
* [[ICub server laptop installation instructions|The icub server laptop]]
 +
* [[NVidia CUDA Worksation installation instructions | The nVidia CUDA workstation]]

Latest revision as of 12:31, 17 April 2020

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.

Operating System

You can choose both a Debian or Ubuntu Linux, the currently suggested OS is Ubuntu 16.04 (Xenial Xerus)

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

Required and useful Packages

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

 nfs-common python-tk libopencv-dev ntpdate ssh cmake-curses-gui

Also install (optional, but very useful) the following packages:

vim iperf

Software repository

NOTE : this step is required 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

NOTE : skip this step in case of icub server
Configure the iCub software repository, by creating the file /etc/apt/sources.list.d/icub.list as following example

  • for a Debian 7 (Wheezy) machine :
 deb http://www.icub.org/debian wheezy contrib/science
  • for a Ubuntu 16.04 LTS (Trusty) machine :
 deb http://www.icub.org/ubuntu xenial contrib/science

Download the packages signature

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 57A5ACB6110576A6

After adding a new source, remember to update the packages list:

apt-get update

Install the following packages from icub repository

 icub-common

Optional : install QT libraries

NOTE: this step is not required if you installed the icub-common package with version > 1.1.15

Please install the following packages (please check the corresponding package in your distribution):

  • for a Debian 7 (Wheezy) machine (in this release packages are from backports repository):
qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qml-module-qtquick2 qml-module-qtquick-window2 qml-module-qtmultimedia qml-module-qtquick-dialogs qml-module-qtquick-controls libqt5svg5
  • for a Ubuntu 14.04 LTS (Trusty) machine :
 qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin qtdeclarative5-qtmultimedia-plugin qtdeclarative5-controls-plugin qtdeclarative5-dialogs-plugin libqt5svg5

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

mount remote NFS shares

NOTE : skip this step in case of icub server or icub "standalone" latop (without iCub rack servers)
To mount the remote NFS shares, edit /etc/fstab, by adding the folowing lines

 NFS_SERVER_IP:/exports/code /usr/local/src/robot nfs soft,retry=1,timeo=60,_netdev,auto  0 0
 NFS_SERVER_IP:/exports/local_yarp    /home/icub/.local/share/yarp nfs soft,retry=1,timeo=60,_netdev,auto 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 soft,retry=1,timeo=60,_netdev,auto  0 0
 10.0.0.1:/exports/local_yarp    /home/icub/.local/share/yarp nfs soft,retry=1,timeo=60,_netdev,auto 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 or icub latop
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 environment variables

NOTE : skip this step in case of iCub server

iCub .bashrc

Add the file /home/icub/.bashrc_iCub as here

Then add the following lines

#Load the iCub custom bashrc
if [ "$HOME" != "" ]; then
  ICUBRC_FILE="${HOME}/.bashrc_iCub"
else
  ICUBRC_FILE="/home/icub/.bashrc_iCub"
fi
if [ -f "$ICUBRC_FILE" ]; then
  source $ICUBRC_FILE
fi

at the beginning of file /home/icub/.bashrc just BEFORE the following lines:

# If not running interactively, don't do anything
case $- in
   *i*) ;;
     *) return;;
esac

You can also download the .bashrc_iCub file here:
(please remember to rename it by adding a starting ".")

iCub bashrc customization

There are several customization you need to apply to the file .bashrc_iCub:

  • The YARP_ROBOT_NAME - you must insert your robot name, in the following line
#export YARP_ROBOT_NAME=
  • The build path - the folder name where you object are created by cmake, in the following line
#export OBJ_SUBDIR="build" 

iCub Environment debugging

In case of any problem with environment, see also the page Debugging_problems_with_yarprun

Optional - Configure remote desktop

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

 vino-preferences

If you get this error The authentication mechanism requested can not be provided by the computer please launch the following command, from a shell terminal

 gsettings set org.gnome.Vino enabled true

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.

Special computers

In case of special machines (such as the cuda workstation or icub laptop) you must follow further steps in order to complete the installation: