ICub machines configuration/Archive: Difference between revisions

From ISRWiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
''Go back to the [[VisLab machines configuration]] page''.
''Go back to the [[iCub machines configuration]] page''.


= Operating system installation =
= Operating system installation =

Revision as of 13:13, 12 February 2015

Go back to the iCub machines configuration page.

Operating system installation

Operations after first boot

  • choose Main server (rather than Portugal server, which is not always reliable) as the software repository:
    • on desktop machines, System -> Administration -> Synaptic Package Manager -> Settings -> Repositories -> Download from: Main server
    • on server machines, remove all the "pt." strings from /etc/apt/sources.list with the following command: sudo sed -i 's/pt.//g' sources.list

Other operations

Environment variables

  • Create a file called ~/.bash_env (used by both interactive and non-interactive sessions, such as commands launched via yarprun from another machine) like this one:
 export YARP_ROOT=/home/icub/yarp2
 export YARP_DIR=$YARP_ROOT/build
 export ICUB_ROOT=/home/icub/iCub
 export ICUB_DIR=$ICUB_ROOT/main/build
 export PATH=$PATH:$YARP_DIR/bin:$ICUB_DIR/bin
 export ICUB_ROBOTNAME=iCubLisboa01 # only for machines that connect to the real robot
 export IPOPT_DIR=/home/icub/Ipopt-3.10.0 # only for servers (IK solver)
 source $YARP_ROOT/scripts/yarp_completion  

If you need software from icub-contrib (most likely you don't, as most of that repository has been migrated to GitHub), some lines need to be added or changed:

export ICUBcontrib_DIR=$code/icub-contrib-common/build
export PATH=$PATH:$YARP_DIR/bin:$ICUB_DIR/bin:$ICUBcontrib_DIR/bin
export YARP_DATA_DIRS=$YARP_DIR/share/yarp:$ICUB_DIR/share/iCub:$ICUBcontrib_DIR/share/ICUBcontrib
  • 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

Subversion (older versions)

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

Manual compilation

This is needed for some iCub vision modules (e.g. motionCUT, stereo-vision). 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