Install on (K)UBUNTU
This is intended as a guidance to install MOBOTWARE
The platform tested is KUBUNTU, UBUNTU and XUBUNTU.
Sofar only 32-bit LINUX distributions are tested successfully.
KUBUNTU version 10.4/10.10/11.04/11.10
Valid for ubuntu, kubuntu and xububtu
- From version 11.04 of UBUNTU, KUBUNTU or XUBUNTU there is no support for USB-webcam until a new vesion of campool plug-in is generated.)
- install the 32 bit version of - most works on 64-bit the version, but there are unsolved issues.
After successfully installing KUBUNTU, UBUNTU or XUBUBTU, install the following packages
e.g. install a package from the command-prompt like:
sudo apt-get install cmake
Needed packages:
- subversion - gcc - g++ - cmake - doxygen (for documentation only) - libcv-dev (must be openCV version 2.1, not 2.2, as it has another library structure) - libhighgui-dev (to run (and compile) client) - libraw1394-dev - libdc1394-22-dev - libpng-dev - libexpat-dev - ncurses-dev - pciutils-dev - libreadline-dev - libsdl-dev - bison (for MRC) - libudev-dev - icedtea6-plugin (to run MARG) - libusb-1.x.x-dev MUST be version 1.0.3 or better (used for Kinect only) - ffmpeg (to convert a recorded image sequence to a video - see camera server) - libv4l-dev (pt. only for auv4l2 plug-in, that is not released yet) - putty (useful serial terminal emulator) - kdevelop or eclipse (integrated development environment - not strictly needed (and not with XUBUNTU)) - lsof (to track open files - also device files)
If your distribution (like UBUNTU 10.10) has libusb version 1.0.0, you must install libusb from the libusb-1.0 homepage http://www.libusb.org/wiki/libusb-1.0 - see below.
G++44
A bit of the Kinect code needs G++ compiler version 4.4 (or newer), this should be no problem on newer linux installations, but on our Jensen and Nyquist servers the default compiler is not version 4.4, so a nickname is generated g++44 to solve this issue, you should either change the g++44 to g++ in the Makefile (in the aukinect subdirectory) or make a link:
sudo ln -s /usr/bin/g++ /usr/bin/g++44
OpenNI
Install openNI driver for Kinect requires additional packages:
- freeglut3-dev (3D graphics with openGL API)
- sun-java6-jdk (required to compile openNI - sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" and apt-get update
LIBUSB-1.0.x
See http://www.libusb.org/wiki/libusb-1.0, one way is to install from git-source.
If you installed libusb from
git clone git://git.libusb.org/libusb.git
then default is verbose logging to console. One way to remove is to edit the configure script:
in the file configure find and remove these two lines (about line 770): enable_log enable_debug_log
Then run - as usual:
./configure make sudo make install
Freenect LIB
Latest version requires this packages:
- libxmu-dev
- libxi-dev
To compile from git source - not needed in mobotware
ROS (openCV) issues
NB! do not install ROS unless you need it, if you do need ROS, then continue.
- ROS replaces default versions of OPENCV, we try to let Mobotware use the same version.
Installation of ros on ubuntu (kubuntu) see http://www.ros.org/wiki/electric/Installation/Ubuntu The first part about adding source repository and "sudo apt-get update" is fine for installing openCV version 2.3.1 (sudo apt-get install libopencv2.3-dev) too. The same is probably true for the linear algebra template library (sudo apt-get install libeigen3-dev).
ROS electric installes (pt) openCV version 2.3.1, and this includes a pkg-config file with errors, all link directives "-l" includes the full path, which is a syntax error, so
edit the "Libs:" part of /usr/lib/pkgconfig/opencv-2.3.1.pc
from:
# Package Information for pkg-config prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir_old=${prefix}/include/opencv-2.3.1/opencv includedir_new=${prefix}/include/opencv-2.3.1 Name: OpenCV Description: Open Source Computer Vision Library Version: 2.3.1 Libs: -l${exec_prefix}/lib/libopencv_contrib.so.2.3.1 -l${exec_prefix}/lib/libopencv_legacy.so.2.3.1 \ -l${exec_prefix}/lib/libopencv_objdetect.so.2.3.1 -l${exec_prefix}/lib/libopencv_calib3d.so.2.3.1 \ -l${exec_prefix}/lib/libopencv_features2d.so.2.3.1 -l${exec_prefix}/lib/libopencv_video.so.2.3.1 \ -l${exec_prefix}/lib/libopencv_highgui.so.2.3.1 -l${exec_prefix}/lib/libopencv_ml.so.2.3.1 \ -l${exec_prefix}/lib/libopencv_imgproc.so.2.3.1 -l${exec_prefix}/lib/libopencv_flann.so.2.3.1 \ -l${exec_prefix}/lib/libopencv_core.so.2.3.1 Cflags: -I${includedir_old} -I${includedir_new}
to:
# Package Information for pkg-config prefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir_old=${prefix}/include/opencv-2.3.1/opencv includedir_new=${prefix}/include/opencv-2.3.1 Name: OpenCV Description: Open Source Computer Vision Library Version: 2.3.1 Libs: -lopencv_contrib -lopencv_legacy -lopencv_objdetect -lopencv_calib3d \ -lopencv_features2d -lopencv_video -lopencv_highgui -lopencv_ml \ -lopencv_imgproc -lopencv_flann -lopencv_core Cflags: -I${includedir_old} -I${includedir_new}
Then further, the Mobotware must know that what openCV version to use. Define an environment variable OPENCV to the version number.
export OPENCV=2.3.1
or put this into either ~/.bashrc or -- as root -- just "OPENCV=2.3.1" into /etc/environment (the last one works on ubuntu, kubuntu and xubuntu).
All relevant Makefiles should now be modified - since SVN version 1768.
Thanks to: http://mpt-internal.uni-hohenheim.de/doku.php?id=robotsoftware:mobotware:mobotware-ros
SVN Source
Get the source from our repository:
You need logon access to timmy.elektro.dtu.dk - talk to Nils Nielsen building 326.
make a directory for the mobotware:
mkdir ~/mobotware cd ~/mobotware
Get the source (checkout)
svn co svn+ssh://[timmy username]@timmy.elektro.dtu.dk/home/project-users/rse/svnrepo .
You will need to supply password 3-4 times!, to avoid this you may look at RSE SVN SSH shared keys
Source on jensen, nyquist or bode
In /usr/local/smr there should be a mobotware-2.XXXX.tar.gz with the current stable source from /opt/smr, or other versions from e.g. /opt/smr.2012g/mobotware-2.yyyy.tar.gz).
Prepare to compile
Some of the current camera drivers are not compatible with latest firewire drivers in ubuntu, so disable, as instructed in AU Robot Servers section installation without FIREWIRE
The OpenCV version 2.1 (default) and 2.3.1 is (pt) supported through an environment variable, so add one of the following cammands (e.g. to .bashrc):
export OPENCV=2.1 export OPENCV=2.3.1
goto the created mobotware directory and make the package
make
This should now compile the set of needed libraries and applications (some need a "make" in its own sub-directory - i.e. some examples and some seldom needed modules)
IDE
From an Integrated Development Environment (IDE) all parts of the project can be loaded, compiled and debugged using the provided Makefiles
KDEvelop and Eclipse can be recommended.
(for Eclipse see Remote Development of Mobotware Using Eclipse)
Maintain SVN source
New version is fetched from command prompt by:
cd ~/mobotware svn update
When you have changed a file send it back to the svn-repository from the directory with the file, or one of the parent folders known to svn (svn will ask for a note for the change log):
svn commit
To add a new set of files, just make a new set of source files - preferably in a new directory (inside the mobotware file tree) - and add the new directory by (e.g. called foo):
svn add foo A foo A foo/Makefile A foo/bar.cpp A foo/bar.cpp~ A (bin) foo/bar.o
This adds the directory and all the files in it, if too many files were added the surplus can be removed by e.g.:
svn rm --force foo/bar.cpp~ foo/bar.o
Then the additions must be committed to go to the repository (starts an editor for a commit remark)
svn commit
or to skip the step with the remark editor:
svn commit -m "in-line commit remark"
XUBUNTU
NB! on official boot-flash that uses switchtool, see Switchtool.
Experiments of running XUBUNTU on the robot (mercury) on a 4GB flash disk
startup files
Add a script to start rhd in the file /etc/rc.local
/etc/rc.local:
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # start rhd export LD_LIBRARY_PATH="/usr/local/lib" export PATH="$PATH:/usr/local/bin" rhd /usr/local/bin/rhdconfig/rhdconfig.mercury.xml 1>/home/chr/log/rhd.out 2>/home/chr/log/rhd.err & #aukeeper -a -s /home/chr/live/aukeeper.ini >/home/chr/log/aukeeper.out & # exit 0
Test
(to be continued with test and example instructions)