Snark for dummies, on ubuntu debian - acfr/snark GitHub Wiki

Table of Contents

Ubuntu 14.04, 16.04, and Debian 7.0 (Wheezy)

  sudo apt-get install libeigen3-dev
  sudo apt-get install libtbb-dev
  sudo apt-get install zlib1g-dev libbz2-dev
  • install optional dependencies:
  # if you plan to use imaging (for example cv-cat)
  sudo apt-get install libopencv-dev libopencv-highgui-dev
  # if you plan to use velodyne
  sudo apt-get install libpcap-dev
  • if you plan to use graphics, follow instructions below to install qt4 and qt3d
  • install snark:
  cd ~/src/
  git clone https://github.com/acfr/snark.git
  cd ~/build/snark
  ccmake ~/src/snark
  cmake . && make -j 4 && sudo make install
  • test graphics:
  # a fancy dataset
  wget http://perception.acfr.usyd.edu.au/data/samples/riegl/rose.st/rose.st.nonground.csv.gz
  gunzip rose.st.nonground.csv.gz
  cat rose.st.nonground.xyzrgb.csv | view-points – --fields=x,y,z,r,g,b # visualise one of the Rose St datasets
  # a simple dataset
  echo 0,0,0 > test.csv
  echo 0,0,1 >> test.csv
  echo 0,1,0 >> test.csv
  echo 0,1,1 >> test.csv
  echo 1,0,0 >> test.csv
  echo 1,0,1 >> test.csv
  echo 1,1,0 >> test.csv
  echo 1,1,1 >> test.csv
  view-points test.csv --weight=5 # you should see 8 3d points forming a cube

eigen

If necessary, eigen can be installed from source by following instructions at http://eigen.tuxfamily.org/index.php?title=Main_Page. If installing from source, make sure to remove the installed version first:

  sudo apt-get remove libeigen3-dev

Qt

This sections is relevant only if you intend to use snark/graphics. Due to a breaking change in Qt5.5 and higher, snark/graphics does not work with it (we will fix it, once we have time). If your version of Qt is 5.5 or higher, please install Qt4 (it co-exists happily with Qt5).

Qt4 is also currently the best tested version.

Installation

Qt4:

  sudo apt-get install libqt4-dev
  cd ~/src/
  git clone https://github.com/acfr/qt3d.git
  cd qt3d
  sudo /usr/share/qt4/bin/qmake /home/(your user)/src/qt3d/qt3d.pro
  sudo mkdir /usr/include/qt4/Qt3D
  sudo mkdir /usr/include/qt4/Qt3DQuick
  sudo make -j 4

Test if it works:

  ~/src/qt3d/bin/teapot

Qt5:

  sudo apt-get install qtbase5-dev qt5-default qt3d5-dev libassimp-dev

Qt5.7:

  Download Qt5.7 from Qt:
  Download installer from http://www.qt.io/download-open-source/
  $ ./qt-unified-linux-x64-2.0.3-1-online.run
  Select:
    Desktop gcc 64-bit

If you have multiple installations either ensure that QT_QMAKE_EXECUTABLE points to the qmake executable for the appropriate qt version (test with "/path/to/qmake --version") or use the qt4-default / qt5-default packages to switch between versions and use /usr/bin/qmake as the QT_QMAKE_EXECUTABLE path.

Available versions

OS Qt Versions Package
Debian 7 4.8.2
5.3.2
libqt4-dev
qtbase5-dev
Debian 8 4.8.6
5.3.2
libqt4-dev
qtbase5-dev
Ubuntu 14.04 4.8.5
5.2.1
libqt4-dev
qtbase5-dev
Ubuntu 16.04 4.8.7
5.5.1
libqt4-dev
qtbase5-dev

Note: Qt 5.3.2 for Debian 7 is only available if backports are enabled

python

To use python, install python 2.7, numpy 1.9, and python-opencv, then enable python in both comma and snark via ccmake.

  sudo apt-get install python python-numpy python-opencv

If PYTHON_PACKAGE_INSTALL_PREFIX is set to a non-standard location, e.g. /opt/acfr, then PYTHONPATH should be set like this:

  export PYTHONPATH=/opt/acfr/jenkins/lib/python2.7/dist-packages

where lib/python2.7/dist-packages is a python specific relative path that depends on the python version and the OS. To find out what the relative path should be, run this command:

  python -c "import sys, distutils.sysconfig; print distutils.sysconfig.get_python_lib().lstrip(sys.prefix)" 

Note that PYTHONPATH, if used, ought to be the same for both comma and snark.

ROS

To use ros utilities you need to install ROS Kinetic: http://wiki.ros.org/kinetic/Installation/Ubuntu

then turn on snark_build_ros in cmake; you would also need to run

  source /opt/ros/kinetic/setup.bash

or included it in ~/.bashrc before running the utilities

Note that ROS will install Qt5. If you currently have Qt4 installed see the Qt section above for the implications of this.

Ubuntu 16.04

Additionally to the sections above:

  • building graphics:
    • graphics card driver: A fresh Ubuntu install will set graphics card driver to a generic xorg Nouvuea which doesn't have the required GL version for view-points. To change the driver, open Software & Updates from system settings and under Additional Drivers select the latest version of propriety driver for your graphics card then select Apply Changes
⚠️ **GitHub.com Fallback** ⚠️