Install on (K)UBUNTU: Difference between revisions

From Rsewiki
 
(104 intermediate revisions by 3 users not shown)
Line 3: Line 3:
The platform tested is KUBUNTU, UBUNTU and XUBUNTU.
The platform tested is KUBUNTU, UBUNTU and XUBUNTU.


Sofar only '''32-bit LINUX distributions''' are tested successfully.
All robots run - for now - '''32-bit LINUX distributions''' and thus tested much more than 64-bit.
On '''64-bit Ubuntu''', Mobotware compiles, runs and is tested to some extend.


==KUBUNTU version 10.4/10.10/11.04/11.10==
==UBUNTU version 16.04 -- 20.04==


Valid for ubuntu, kubuntu and xububtu
This description is valid for UBUNTU, KUBUNTU and XUBUNTU


* 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.)
* Preferred version is (K)Ubuntu 16.04 32 bit for Mobotware version >=3.200
* 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
After successfully installing KUBUNTU, UBUNTU or XUBUNTU, install the following packages


e.g. install a package from the command-prompt like:  
e.g. install a package from the command-prompt like:  
  sudo apt-get install cmake
  sudo apt-get install cmake


Needed packages:
Needed packages (ubuntu 20.04):
  - subversion
  build-essential
cmake
subversion
libopencv-dev
libraw1394-dev (maybe already installed?)
libncurses-dev
libreadline-dev
libsdl-dev
libv4l-dev
libusb-dev
libusb-1.0-0-dev (kinect)
libboost-dev
libboost-system-dev
libexpat-dev
libpci-dev
bison
libpcl-dev
libfltk1.3-dev
qt3d5-dev
sudo apt install build-essential cmake subversion libopencv-dev libraw1394-dev libncurses-dev libreadline-dev libsdl-dev libv4l-dev libusb-dev libusb-1.0-0-dev libboost-dev libboost-system-dev libexpat-dev libpci-dev bison libpcl-dev libfltk1.3-dev qt3d5-dev
 
Needed packages (ubuntu 18.04):
build-essential
cmake
subversion
libopencv-dev
libraw1394-dev (maybe already installed?)
ncurses-dev
libreadline-dev
libsdl-dev
libv4l-dev
libusb-dev
libusb-1.0-0-dev (kinect)
libboost-dev
libboost-system-dev
libexpat-dev
libpci-dev
bison
libqt4-dev
libpcl-dev
libfltk1.3-dev
qt3d5-dev
libgstreamer1.0-dev
sudo apt install build-essential cmake subversion libopencv-dev libraw1394-dev ncurses-dev libreadline-dev libsdl-dev libv4l-dev libusb-dev libusb-1.0-0-dev libboost-dev libboost-system-dev libexpat-dev libpci-dev bison libqt4-dev libpcl-dev libfltk1.3-dev qt3d5-dev libgstreamer1.0-dev
 
Needed packages (ubuntu 16.04):
  - gcc
  - gcc
  - g++
  - g++
  - cmake
  - cmake
  - doxygen  (for documentation only)
  - libopencv-dev (ubuntu from 12.4, for earlier versions of ubuntu: try load libhighgui-dev and libcv-dev instead)
- 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
  - libraw1394-dev
- libdc1394-22-dev
- libpng-dev
- libexpat-dev
  - ncurses-dev
  - ncurses-dev
- pciutils-dev
  - libreadline-dev
  - libreadline-dev
  - libsdl-dev
  - libsdl-dev
  - bison (for MRC)
  - bison (for MRC)
  - libudev-dev
  - libudev-dev
  - icedtea6-plugin (to run MARG)
  - libusb-dev
  - libusb-1.x.x-dev MUST be version 1.0.3 or better (used for Kinect only)
- libusb-1.0-0-dev
  - ffmpeg (to convert a recorded image sequence to a video - see camera server)
- libv4l-dev (video usage)
  - libv4l-dev (pt. only for auv4l2 plug-in, that is not released yet)
  - libboost-dev (used by aulocalizer plug-in, but also included in libpcl)
  - libboost-system-dev
- python-dev  (can p.t. do without)
- libpcl-dev (libpcl-all-dev) (see PCL-note)
- libgstreamer0.10-dev (for client and camera interface - NB ubuntu-16.04 only)
  - libgstreamer1.0-dev
- v4l-utils  (used by v4lgst camera plugin - to get cam device info))
- libpci-dev  (To compile Guidebot's RHD plugin)
  - libfltk1.3-dev (Stage Simulator)
- libltdl-dev  (Stage Simulator)
 
Probably not needed
- subversion (if you have access to source on SVN)
- doxygen  (for documentation only)
  - putty (useful serial terminal emulator)
  - putty (useful serial terminal emulator)
  - kdevelop or eclipse (integrated development environment - not strictly needed (and not with XUBUNTU))
  - kdevelop or eclipse (integrated development environment - not strictly needed (and not with XUBUNTU))
  - lsof (to track open files - also device files)
  - lsof (to track open files - also device files)
- libdc1394-22-dev
- libpng-dev
- libexpat-dev
- icedtea-plugin  (to run MARG)
- libopencv-gpu-dev
Packages to compile AVR-C - e.g. motor controller and labyrinth
- gcc-avr
- binutils-avr
- avr-libc
For compiling on 64-bit computers (without PCL), disable the following plugins in <tt>aurobotservers/trunk/plugin/Makefile</tt>
- auviewer
- aupcp
- aupcltest
- autof2
- auptgrey
=== QClient ===
On my 32 bit KUBUNTU at may 2015, qclient failed to compile.
Complaining: fatal error: glibconfig.h not found,
I made this link to solve the problem.
cd /usr/include/glib-2.0
sudo ln -s /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h .
=== PCL ===
The Point Clouds Library (PCL) is in a separate ubuntu repository, so see the instructions on:
http://pointclouds.org/downloads/linux.html
=== Boost ===
====locale.hpp not found====
In some cases compile of auviewer fails complaining that boost/locale.hpp is not found.
changed in source file (in auviewer), from
#include <boost/locale.hpp>
to
#include <boost/typeof/std/locale.hpp>
====Ubuntu 12.10/13.04/13.10 32/64-bit - BOOST compile fails====
p.t. (may 2013) boost do not compile using GCC-4.7, as is default on 64 bit (ubuntu 13.04)
--update (august 2013) on clean install of Ubuntu 13.04 32 bit the problem is the same.
So use update-alternatives to switch to gcc-4.6
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
if update-alternatives has no alternatives,
then add them (taken from from http://askubuntu.com/questions/26498/choose-gcc-and-g-version)
Install compiler version 4.6 (assuming 4.7 is installed):
sudo apt-get install gcc-4.6 g++-4.6 cc-4.6
Install Alternatives
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
Configure Alternatives
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
==== libboost ====
There is a problem during compilation of the plugin auviewer. To solve this problem locate the following file:
  /usr/include/boost/thread/exceptions.hpp
 
Add the following code at line 11


If your distribution (like UBUNTU 10.10) has libusb version 1.0.0, you must install libusb from
  //added by Jens Christian Andersen and Claes Jaeger for MobotWare to compile auviewer-plugin
the libusb-1.0 homepage http://www.libusb.org/wiki/libusb-1.0 .
  //ubuntu 13.04(32bit), gcc 4.6 (downgrade from 4.7 - see rsewiki.elektro.dtu.dk), libboost 1.49
  //produces errors when compiling, because of the attributes defines somewhere else in boost.  
  //the consequences for this hack has not been investigated, the compiled plugin has been tested and is working.
  #define BOOST_SYMBOL_VISIBLE


=== G++44===
As stated in the comments, the consequences have not been investigated, but so far it is working. Please notify us if you experince any problems because of this hack.
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===
===OpenNI===
OpenNI is not used by mobotware (mobotware uses the freenect driver), but part of some of the examples in the PCL library uses the OpenNI driver.


Install openNI driver for Kinect requires additional packages:
Install openNI driver for Kinect requires additional packages:
Line 57: Line 197:
* sun-java6-jdk (required to compile openNI - sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" and apt-get update
* sun-java6-jdk (required to compile openNI - sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" and apt-get update


===ROS (openCV) compatibility issues===
===LIBUSB-1.0.x===
- ROS replaces default versions of OPENCV, we try to let Mobotware use the same version.
 
For distributions older than 12.04:
 
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 (may have changed since i tryed it (ultimo 2011)).
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 these packages:
 
* libxmu-dev
* libxi-dev
 
To compile from git source - not needed in mobotware
 
===Camera driver for uEye IDS===
 
Driver for the IDS ueye camera needs to be installed to use the camera. It does not support video 4 linux, nor openCV directly. Tested on ubuntu 32 bit 14.04 and on ubuntu 64 bit 16.04.
 
Get the driver from https://en.ids-imaging.com/download-ueye-lin32.html (32bit or 64 bit)
 
Download, unpack and run installer as root (for a 32 bit linux)
tar -xf uEye-Linux-4.81-32-bit.tgz
sudo ./ueyesdk-setup-4.81-usb-i686.gz.run
 
This installs the driver and a daemon in /etc/init.d that will start at boot time
 
Start the daemon
sudo /etc/init.d/ueyeusbdrc start
 
The camera can now be configured and pre-viewed using (same as ueyecameramanager)
idscameramanager
 
Or demoed and configured using
ueyedemo
 
There is also a utility to set ID number of camera:
ueyesetid
 
===openCV (and ROS) issues===
 
OpenCV in ubuntu 12.4 is version 2.3.1, and opencv-2.1 is not directly available in the for from openCV-1.0.
 
- ROS replaces default versions of OPENCV.
 
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
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
Line 96: Line 295:
  Version: 2.3.1
  Version: 2.3.1
  Libs:  -lopencv_contrib -lopencv_legacy -lopencv_objdetect -lopencv_calib3d \
  Libs:  -lopencv_contrib -lopencv_legacy -lopencv_objdetect -lopencv_calib3d \
         -lopencv_features2d -lopencv_video - lopencv_highgui -lopencv_ml \
         -lopencv_features2d -lopencv_video -lopencv_highgui -lopencv_ml \
         -lopencv_imgproc -lopencv_flann -lopencv_core
         -lopencv_imgproc -lopencv_flann -lopencv_core
  Cflags: -I${includedir_old} -I${includedir_new}
  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
All relevant Makefiles should now be modified - since SVN version 1768. And updated to detect openCV version 2.1, 2.3.1, and the version installed with ubuntu 12.4.


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.
Thanks to: http://mpt-internal.uni-hohenheim.de/doku.php?id=robotsoftware:mobotware:mobotware-ros


All relevant Makefiles should now be modified - since SVN version 1768.
==IDE==


For earlier versions see: http://mpt-internal.uni-hohenheim.de/doku.php?id=robotsoftware:mobotware:mobotware-ros
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]])
 
==Compile Install Run==


==SVN Source==
Go to the directory with the Mobotware source


Get the source from our repository:
===Unpack===


You need logon access to timmy.elektro.dtu.dk - talk to Nils Nielsen building 326.
If from a packed version (see below for SVN source), then


make a directory for the mobotware:
tar -xzf mobotware-3.XXXX.tar.gz


mkdir ~/mobotware
then go to the created directory
  cd ~/mobotware
 
  cd mobotware-3.XXXX
 
===Compile===


Get the source (checkout)
From the top level Mobotware directory


  svn co svn+ssh://[timmy username]@timmy.elektro.dtu.dk/home/project-users/rse/svnrepo .
  make


You will need to supply password 3-4 times!, to avoid this you may look at [[RSE SVN]] SSH shared keys
This is needed even if you are going to compile a plugin only to make needed libraryies. There is (usually) seperate makefiles for each plugin and utility, that can be used once the libraries are in place.


==Source on jensen, nyquist or bode==
===Install===


In /usr/local/smr there should be a mobotware-XXXX.tar.gz with the current stable source (from kalman:/opt/smr).
To make the compiled version available on the command line (installed under /usr/local):
* on a standalobe development computer:


==Prepare to compile==
sudo make install


Some of the current cameradrivers are not compatible with latest firewire drivers in ubuntu, so
* On a robot you cam make a local version, that can be selected using "switchtool". (reverts back to default version after a reboot)
disable, as instructed in [[AU Robot Servers]] section ''installation without FIREWIRE''


goto the created mobotware directory and make the package
sudo make install VER=2012z


make
* For a new release on our fileserver (for VIP users on kalman only). This exports Mobotware files to a new directory, compiles all needed files, and copies binary files to e.g. "kalman:/opt/smr.2012m". this directory must exist on kalman (usually created as a copy from a previous version).


This should now compile the set of needed libraries and applications (some need a "make" in its own subdirectory)
./exportMobotware    (and type in the SVN revision number, that is used in filenames, e.g. 62)
cd mobotware-3.62
make kalman VER=2012m


==IDE==
===Run===


From an Integrated Development Environment (IDE) all parts of the project can be loaded, compiled and debugged using the provided Makefiles
Further set PATH and LD_LIBRARY_PATH inmake add the following lines to ~/.bashrc (or /etc/bash.bashrc)


KDEvelop and Eclipse can be recommended.
export PATH=$PATH:/home/jca/svn/build/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jca/svn/build/lib


(for Eclipse see [[Remote Development of Mobotware Using Eclipse]])
(restart your terminal to put the lines into effect)


==Maintain SVN source==
==Maintain SVN source==
Line 158: Line 367:
  svn update
  svn update


When you have changed a file send it back to the svn-repository from the directory with the file one of the parent folders known to svn (svn will ask for a note for the change log):
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
  svn commit
Line 171: Line 380:
  A (bin)  foo/bar.o
  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.:
This adds the directory and all the files in it, if too many files were added the surplus can be removed from add-list by e.g.:


  svn rm --force foo/bar.cpp~ foo/bar.o
  svn reveret foo/bar.cpp~ foo/bar.o


Then the additions must be committed to go to the repository (starts an editor for a commit remark)
You may let SVN modify a line in the source code with revision number or an iID with update details, by addinf $Rev$ or $Id$ somewhere in the source file, and make this field active by:
 
svn propset svn:keywords 'Id Revision' foo
 
Then the additions and changes must be committed to go to the repository (starts an editor for a commit remark)


  svn commit
  svn commit
Line 183: Line 396:
  svn commit -m "in-line commit remark"
  svn commit -m "in-line commit remark"


==XUBUNTU==
==Debug==


NB! on official boot-flash that uses switchtool, see [[Switchtool]].
Using debugger to attach to a running process may fail with the message:


Experiments of running XUBUNTU on the robot (mercury) on a 4GB flash disk
Could not attach debugger:
ptrace: Operation not permitted.


'''startup files'''
Most likely, it is solved by changing:


Add a script to start rhd in the file /etc/rc.local
ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf


/etc/rc.local:
==Test==


#!/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)
(to be continued with test and example instructions)

Latest revision as of 09:35, 28 March 2023

This is intended as a guidance to install MOBOTWARE

The platform tested is KUBUNTU, UBUNTU and XUBUNTU.

All robots run - for now - 32-bit LINUX distributions and thus tested much more than 64-bit. On 64-bit Ubuntu, Mobotware compiles, runs and is tested to some extend.

UBUNTU version 16.04 -- 20.04

This description is valid for UBUNTU, KUBUNTU and XUBUNTU

  • Preferred version is (K)Ubuntu 16.04 32 bit for Mobotware version >=3.200

After successfully installing KUBUNTU, UBUNTU or XUBUNTU, install the following packages

e.g. install a package from the command-prompt like:

sudo apt-get install cmake

Needed packages (ubuntu 20.04):

build-essential
cmake
subversion
libopencv-dev
libraw1394-dev (maybe already installed?)
libncurses-dev
libreadline-dev
libsdl-dev
libv4l-dev
libusb-dev
libusb-1.0-0-dev (kinect)
libboost-dev
libboost-system-dev
libexpat-dev
libpci-dev
bison
libpcl-dev
libfltk1.3-dev
qt3d5-dev
sudo apt install build-essential cmake subversion libopencv-dev libraw1394-dev libncurses-dev libreadline-dev libsdl-dev libv4l-dev libusb-dev libusb-1.0-0-dev libboost-dev libboost-system-dev libexpat-dev libpci-dev bison libpcl-dev libfltk1.3-dev qt3d5-dev

Needed packages (ubuntu 18.04):

build-essential
cmake
subversion
libopencv-dev
libraw1394-dev (maybe already installed?)
ncurses-dev
libreadline-dev
libsdl-dev
libv4l-dev
libusb-dev
libusb-1.0-0-dev (kinect)
libboost-dev
libboost-system-dev
libexpat-dev
libpci-dev
bison
libqt4-dev
libpcl-dev
libfltk1.3-dev
qt3d5-dev
libgstreamer1.0-dev
sudo apt install build-essential cmake subversion libopencv-dev libraw1394-dev ncurses-dev libreadline-dev libsdl-dev libv4l-dev libusb-dev libusb-1.0-0-dev libboost-dev libboost-system-dev libexpat-dev libpci-dev bison libqt4-dev libpcl-dev libfltk1.3-dev qt3d5-dev libgstreamer1.0-dev

Needed packages (ubuntu 16.04):

- gcc
- g++
- cmake
- libopencv-dev (ubuntu from 12.4, for earlier versions of ubuntu: try load libhighgui-dev and libcv-dev instead)
- libraw1394-dev
- ncurses-dev
- libreadline-dev
- libsdl-dev
- bison (for MRC)
- libudev-dev
- libusb-dev
- libusb-1.0-0-dev
- libv4l-dev (video usage)
- libboost-dev (used by aulocalizer plug-in, but also included in libpcl)
- libboost-system-dev
- python-dev  (can p.t. do without)
- libpcl-dev (libpcl-all-dev) (see PCL-note)
- libgstreamer0.10-dev (for client and camera interface - NB ubuntu-16.04 only)
- libgstreamer1.0-dev
- v4l-utils   (used by v4lgst camera plugin - to get cam device info))
- libpci-dev  (To compile Guidebot's RHD plugin)
- libfltk1.3-dev  (Stage Simulator)
- libltdl-dev  (Stage Simulator)

Probably not needed

- subversion (if you have access to source on SVN)
- doxygen  (for documentation only)
- 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)
- libdc1394-22-dev
- libpng-dev
- libexpat-dev
- icedtea-plugin  (to run MARG)
- libopencv-gpu-dev

Packages to compile AVR-C - e.g. motor controller and labyrinth

- gcc-avr 
- binutils-avr 
- avr-libc

For compiling on 64-bit computers (without PCL), disable the following plugins in aurobotservers/trunk/plugin/Makefile

- auviewer
- aupcp
- aupcltest
- autof2
- auptgrey


QClient

On my 32 bit KUBUNTU at may 2015, qclient failed to compile.

Complaining: fatal error: glibconfig.h not found, I made this link to solve the problem.

cd /usr/include/glib-2.0
sudo ln -s /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h .


PCL

The Point Clouds Library (PCL) is in a separate ubuntu repository, so see the instructions on: http://pointclouds.org/downloads/linux.html

Boost

locale.hpp not found

In some cases compile of auviewer fails complaining that boost/locale.hpp is not found.

changed in source file (in auviewer), from

#include <boost/locale.hpp>

to

#include <boost/typeof/std/locale.hpp>

Ubuntu 12.10/13.04/13.10 32/64-bit - BOOST compile fails

p.t. (may 2013) boost do not compile using GCC-4.7, as is default on 64 bit (ubuntu 13.04) --update (august 2013) on clean install of Ubuntu 13.04 32 bit the problem is the same.

So use update-alternatives to switch to gcc-4.6

sudo update-alternatives --config gcc
sudo update-alternatives --config g++

if update-alternatives has no alternatives, then add them (taken from from http://askubuntu.com/questions/26498/choose-gcc-and-g-version)

Install compiler version 4.6 (assuming 4.7 is installed):

sudo apt-get install gcc-4.6 g++-4.6 cc-4.6

Install Alternatives

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20

sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc

sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++

Configure Alternatives

sudo update-alternatives --config gcc
sudo update-alternatives --config g++

libboost

There is a problem during compilation of the plugin auviewer. To solve this problem locate the following file:

 /usr/include/boost/thread/exceptions.hpp
 

Add the following code at line 11

 //added by Jens Christian Andersen and Claes Jaeger for MobotWare to compile auviewer-plugin
 //ubuntu 13.04(32bit), gcc 4.6 (downgrade from 4.7 - see rsewiki.elektro.dtu.dk), libboost 1.49
 //produces errors when compiling, because of the attributes defines somewhere else in boost. 
 //the consequences for this hack has not been investigated, the compiled plugin has been tested and is working.
 #define BOOST_SYMBOL_VISIBLE

As stated in the comments, the consequences have not been investigated, but so far it is working. Please notify us if you experince any problems because of this hack.

OpenNI

OpenNI is not used by mobotware (mobotware uses the freenect driver), but part of some of the examples in the PCL library uses the OpenNI driver.

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

For distributions older than 12.04:

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 (may have changed since i tryed it (ultimo 2011)). 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 these packages:

  • libxmu-dev
  • libxi-dev

To compile from git source - not needed in mobotware

Camera driver for uEye IDS

Driver for the IDS ueye camera needs to be installed to use the camera. It does not support video 4 linux, nor openCV directly. Tested on ubuntu 32 bit 14.04 and on ubuntu 64 bit 16.04.

Get the driver from https://en.ids-imaging.com/download-ueye-lin32.html (32bit or 64 bit)

Download, unpack and run installer as root (for a 32 bit linux)

tar -xf uEye-Linux-4.81-32-bit.tgz
sudo ./ueyesdk-setup-4.81-usb-i686.gz.run

This installs the driver and a daemon in /etc/init.d that will start at boot time

Start the daemon

sudo /etc/init.d/ueyeusbdrc start

The camera can now be configured and pre-viewed using (same as ueyecameramanager)

idscameramanager

Or demoed and configured using

ueyedemo

There is also a utility to set ID number of camera:

ueyesetid

openCV (and ROS) issues

OpenCV in ubuntu 12.4 is version 2.3.1, and opencv-2.1 is not directly available in the for from openCV-1.0.

- ROS replaces default versions of OPENCV.

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}


All relevant Makefiles should now be modified - since SVN version 1768. And updated to detect openCV version 2.1, 2.3.1, and the version installed with ubuntu 12.4.

Thanks to: http://mpt-internal.uni-hohenheim.de/doku.php?id=robotsoftware:mobotware:mobotware-ros

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)

Compile Install Run

Go to the directory with the Mobotware source

Unpack

If from a packed version (see below for SVN source), then

tar -xzf mobotware-3.XXXX.tar.gz

then go to the created directory

cd mobotware-3.XXXX

Compile

From the top level Mobotware directory

make

This is needed even if you are going to compile a plugin only to make needed libraryies. There is (usually) seperate makefiles for each plugin and utility, that can be used once the libraries are in place.

Install

To make the compiled version available on the command line (installed under /usr/local):

  • on a standalobe development computer:
sudo make install
  • On a robot you cam make a local version, that can be selected using "switchtool". (reverts back to default version after a reboot)
sudo make install VER=2012z
  • For a new release on our fileserver (for VIP users on kalman only). This exports Mobotware files to a new directory, compiles all needed files, and copies binary files to e.g. "kalman:/opt/smr.2012m". this directory must exist on kalman (usually created as a copy from a previous version).
./exportMobotware     (and type in the SVN revision number, that is used in filenames, e.g. 62)
cd mobotware-3.62
make kalman VER=2012m

Run

Further set PATH and LD_LIBRARY_PATH inmake add the following lines to ~/.bashrc (or /etc/bash.bashrc)

export PATH=$PATH:/home/jca/svn/build/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jca/svn/build/lib

(restart your terminal to put the lines into effect)

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 from add-list by e.g.:

svn reveret foo/bar.cpp~ foo/bar.o

You may let SVN modify a line in the source code with revision number or an iID with update details, by addinf $Rev$ or $Id$ somewhere in the source file, and make this field active by:

svn propset svn:keywords 'Id Revision' foo

Then the additions and changes 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"

Debug

Using debugger to attach to a running process may fail with the message:

Could not attach debugger:
ptrace: Operation not permitted.

Most likely, it is solved by changing:

ptrace_scope to 0 in /etc/sysctl.d/10-ptrace.conf

Test

(to be continued with test and example instructions)