ICub machines configuration: Difference between revisions
m (→Ubuntu packages: add libopencv-gpu-dev (solves dataDumper linking problem)) |
(→Essential packages: git) |
||
Line 60: | Line 60: | ||
sudo apt-get install gcc g++ ssh libace-dev libgsl0-dev libncurses5-dev gfortran libgtkmm-2.4-dev libtinyxml-dev | sudo apt-get install gcc g++ ssh libace-dev libgsl0-dev libncurses5-dev gfortran libgtkmm-2.4-dev libtinyxml-dev | ||
sudo apt-get install subversion make cmake-curses-gui | sudo apt-get install git-core subversion make cmake-curses-gui | ||
== Environment variables == | == Environment variables == |
Revision as of 16:48, 15 September 2014
In this page we will list configurations that are commonplace to machines used at Vislab, particularly Linux machines that work with the iCub robot.
See VisLab machines configuration/Archive for obsolete information and environment variables.
Operating system installation
Nothing fancy here - follow Ubuntu defaults and partitioning. For servers, use LTS releases. Machines involved in demos must have a user named 'icub', to make the distributed setup easier (so that the graphical application manager, gyarpmanager, can manage applications on remote machines).
Operations after first boot
- update packages:
- either with Ubuntu graphical frontends
- or from a Terminal:
sudo apt-get update
;sudo apt-get upgrade
- add 'icub' user if not done already:
- either with Ubuntu graphical frontends
- or from a Terminal:
sudo adduser icub
followed bysudo usermod -aG admin icub
to give it sudo privileges
Other operations
Network configuration
See also: VisLab network, ISR computing resources.
Manually configure your internet connection as detailed in one of the following subsections, depending if the machine is a desktop or a server one.
Optionally, you may also customize the /etc/hosts
file like we did on Chico3; this would allow us to quickly access other machines, as in: ping cortex1
. Alternatively, we can do nothing and just use ping cortex1.visnet
(i.e., attach the .visnet
part after a machine name, see VisLab network for details).
Desktop machines
With the graphical Network Manager (https://help.ubuntu.com/12.04/ubuntu-help/net-fixed-ip-address.html), configure the connection "Auto eth0" IPv4 as follows:
Address | Netmask | Gateway | DNS Servers | notes |
---|---|---|---|---|
10.10.1.x | 255.255.255.0 | 10.10.1.254 | 10.0.0.1, 10.0.0.2 | visnet (iCub machines) |
10.0.x.y | 255.255.0.0 | 10.0.0.254 | 10.0.0.1, 10.0.0.2 | isrnet (rest of ISR) |
Servers
Edit /etc/network/interfaces
like this:
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.x.y.z # put your IP here, see above table netmask 255.255.x.y # see above table network 10.10.1.0 broadcast 10.10.1.255 gateway 10.10.1.254
Edit /etc/resolv.conf
like this:
nameserver 10.0.0.1 nameserver 10.0.0.2
Essential packages
sudo apt-get install gcc g++ ssh libace-dev libgsl0-dev libncurses5-dev gfortran libgtkmm-2.4-dev libtinyxml-dev sudo apt-get install git-core subversion make cmake-curses-gui
Environment variables
- Create a file called ~/.bash_env like this one:
# /usr/local/src/robot directory can be mounted from NFS, or created manually with permissions: sudo chown icub.icub /usr/local/src/robot -R export code=/usr/local/src/robot export YARP_ROOT=$code/yarp export YARP_DIR=$YARP_ROOT/build export ICUB_ROOT=$code/icub-main export ICUB_DIR=$ICUB_ROOT/build export YARP_ROBOT_NAME=iCubLisboa01 # only for machines that connect to the real robot export IPOPT_DIR=/home/icub/Ipopt-3.10.2/build # only for servers (IK solver) - see http://wiki.icub.org/wiki/Installing_IPOPT export OpenCV_DIR=$code/OpenCV-2.4.8/build # manually installed, with TBB support - see below export PATH=$PATH:$YARP_DIR/bin:$ICUB_DIR/bin # if you only need main iCub binaries; for contrib, see http://mediawiki.isr.ist.utl.pt/wiki/RobotCub_software#Getting_the_iCub_repository_in_Linux source $YARP_ROOT/scripts/yarp_completion
- 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
The reason why we use the above custom file (as opposed to the standard ~/.bashrc) is that we want to enforce the variables both during interactive and non-interactive sessions, such as commands launched via yarprun
from another machine.
Subversion
For security, uncomment (thus enabling) the following parameter in /etc/subversion/config
:
store-passwords = no
This implies that SVN will ask you for your password every time you do a commit, as opposed to storing it in plain text on the system. (Don't worry about changing your personal ~/.subversion/config
file: the parameter is not actually set there, so the global /etc
setting is used.)
Additional software
OpenCV
Ubuntu packages
sudo apt-get install libcv-dev libhighgui-dev libcvaux-dev libopencv-gpu-dev
This is the easiest way to install OpenCV, however some machines may require a custom manual compilation instead (see below).
Manual compilation
This is needed for some iCub vision modules (e.g. motionCUT, stereoDisparity). Instructions:
- download TBB Source, make
- download OpenCV 2.4.3 or higher, CMake, set WITH_TBB=ON and insert the paths obtained with the TBB compilation, such as
TBB_INCLUDE_DIR=/usr/local/src/robot/tbb41_20130314oss/include TBB_LIB_DIR=/usr/local/src/robot/tbb41_20130314oss/build/linux_intel64_gcc_cc4.6_libc2.15_kernel3.2.0_release
- compile OpenCV
- set OpenCV_DIR to the path of OpenCV-x.y.z/build, for example:
export OpenCV_DIR=$code/OpenCV-2.4.3/build
If the above fails, try BUILD_TBB=ON (i.e. automatically "Download and build TBB from source"). More information about TBB support in the latest OpenCV here.
Possible problems with manual compilation
error: ‘ptrdiff_t’ does not name a type
Solution: edit OpenCV-x.y.z/modules/core/include/opencv2/core/core.hpp, add #include <stddef.h>
fatal error: linux/videodev.h: No such file or directory
Solution:
sudo apt-get install libv4l-dev cd /usr/include/linux sudo ln -s ../libv4l1-videodev.h videodev.h
undefined reference to `cvCreateCameraCapture_V4L(int)'
Solution: see here (including the change suggested in the comments)
error: ‘AVERROR_NUMEXPECTED’ was not declared in this scope
Solution: apply the two patches located here with the following commands.
wget https://code.ros.org/trac/opencv/raw-attachment/ticket/1020/ffmpeg_build.patch https://code.ros.org/trac/opencv/raw-attachment/ticket/1020/ffmpeg_build_2.patch patch -p1 < ffmpeg_build.patch # when asked for which file to patch, give the full path to OpenCV-x.y.z/modules/highgui/src/cap_ffmpeg.cpp patch -p1 < ffmpeg_build_2.patch # ditto
error: ‘av_rescale_q’ was not declared in this scope
Solution: edit OpenCV-x.y.z/modules/highgui/src/cap_ffmpeg.cpp, add #include <libavutil/mathematics.h> before #include <ffmpeg/avcodec.h> (source)
error: #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core.
Solution: apply the patch located here with the following commands.
wget https://code.ros.org/trac/opencv/raw-attachment/ticket/805/diff.txt patch -p1 < diff.txt # when asked for which file to patch, give the full path to OpenCV-x.y.z/modules/features2d/src/matchers.cpp
No rule to make target `/usr/lib/python3.0/config/libpython3.0.so', needed by `lib/cv.so'.
Solution: ccmake ., toggle advanced options (press 't'), set
PYTHON_LIBRARY /usr/lib/python2.7/config/libpython2.7.so
error: ‘avformat_free_context’ was not declared in this scope
Solution: remove any manually installed ffmpeg version, then
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev
YARP and iCub
Follow the instructions on the RobotCub software article. For compilation on servers, do not use sudo make install
but simply make
(we have configured the PATH variable to find the latest compiled binaries, and we do not want two copies of the same thing on the system).
- usual yarp CMake flags
CMAKE_BUILD_TYPE Release CREATE_LIB_MATH
- usual iCub CMake flags
CMAKE_BUILD_TYPE Release
Special machines such as pc104 or robot computation servers need additional flags. In addition, machines that work with the physical robot need the following setup:
yarp namespace /icub
- in order to find the yarpserver running on chico3, write
10.10.1.53 10000
into the file specified byyarp conf