环境:Ubuntu16.04 64bit
Kinect V1 XBOX 360
1.安装OpenNI2并试运行
https://fredfire1.wordpress.com/2016/09/23/install-and-setup-kinect-xbox-360-1473-debian-ubuntu-64bit/
基本历程参照该链接配置。这里注意在/OpenNI-Linux-x64-2.2/Tools/OpenNI2/Drivers路径下也复制一个libFreenectDriver.so驱动NiViewer才能运行。
2.安装相关依赖项和库
1)一起写到这里,先都装了吧,早晚都要用。
sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev sudo add-apt-repository ppa:openjdk-r/ppa //新的版本没有这个库了 自己加载 sudo apt-get update sudo apt-get install -y cmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-7-jdk freeglut3-dev libglew-dev libsuitesparse-dev libeigen3-dev zlib1g-dev libjpeg-dev libboost1.58-dev libboost1.58-all-dev libeigen3-dev libflann-dev libvtk5-dev libqhull-dev
sudo apt-get install libopenni-dev libopenni2-dev //主要用于环境配置16.04之前不能直接装
3.安装并运行elasticfusion
在git上下载elasticfusion按照readme和build.sh安装。
最后在GUI的make的过程中用ccmake。
cd ../../GUI
mkdir build
cd build
ccmake ../src
make -j8
按t进入高级配置窗口,OpenNI2的lib路径不要选根目录那个(默认是这个),改成我们自己装的那个libopenni2.so(/home/lsp/kinect/tmp/OpenNI-Linux-x64-2.2/Samples/Bin/libOpenni2.so) (第1步安装的)
个人理解:
为什么要这么做呢,因为新的Ubuntu版本,可以直接install libopenni。但是libopenni2.so没有链接到libFreenectDriver.so Kinect相机驱动,所以需要用已连接好的驱动。