Kintinuous源码链接:https://github.com/mp3guy/Kintinuous
编译安装最好要严格按照官方给的流程来,这样才能少走弯路.
在配置的过程中,确实遇到了很多各种各样的问题,感谢CSDN的各位前辈,基本上遇到的问题,百度或者google 都能解决的,只要耐心就好.
贴两个对我挺有帮助的博客,show respect:
https://blog.csdn.net/lzRush/article/details/89089233
https://blog.csdn.net/u012455577/article/details/88309649
由于Kintinuous是好几年前的工作,所以Ubuntu18.04 和opencv3/4以及CUDA 10就很不友好.
一定不要使用opencv3,只能用opencv2!
我是用ubuntu 18.04装opencv2.4.11,好像还是先装的CUDA 10.2再装的opencv2.4.11,所以走了点弯路,但是万能的谷歌都有相关问题的解决方法,耐心的去找问题就好.因为昨天ubuntu18.04装opencv2.4.11遇到的问题有点多而且杂,但都能谷歌到,这里就不复盘了.
Step 1:安装依赖的库
sudo apt-get install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann-dev libeigen3-dev libsuitesparse-dev libboost-all-dev libvtk5-qt4-dev libvtk6.2 libvtk5-dev libqhull* libusb-dev libgtest-dev git-core freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphviz mono-complete qt-sdk openjdk-7-jdk openjdk-7-jre
Step 2:安装OpenCV2
这里贴一个在进行make的时候,找不到opencv库报错的解决办法.
问题:
CMake Warning at /home/kevin/opencv-2.4.11/cmake/OpenCVConfig.cmake:161 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
iai_kinect2/kinect2_viewer/CMakeLists.txt:25 (find_package)
CMake Error at iai_kinect2/kinect2_viewer/CMakeLists.txt:25 (find_package):
Found package configuration file:
/home/kevin/opencv-2.4.11/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
解决办法:
打开报错的CMakeList.txt,找到find_package(OpenCV REQUIRED)
,在前面加三行,注意,OpenCV_DIR的地址是你安装编译opencv的build文件夹地址
set(OpenCV_FOUND 1)
include_directories( ${OpenCV_INCLUDE_DIRS})
set(OpenCV_DIR /home/kevin/opencv-2.4.11/build)
Step 3:安装CUDA
按照官网给的流程走:https://developer.nvidia.com/cuda-downloads
这里贴一篇对我有用的博客:
https://blog.csdn.net/qq_32408773/article/details/84112166
我的显卡是MX150,可以装CUDA10.2,并测试成功了.
Step 4:安装PCL
我是之前就装了的PCL1.8.谷歌pcl github,然后cmake && make && sudo make install就行了吧,
https://github.com/PointCloudLibrary/pcl
sudo apt-get install g++ cmake cmake-gui doxygen mpi-default-dev openmpi-bin openmpi-common libflann-dev libeigen3-dev libboost-all-dev libvtk5-qt4-dev libvtk6.2 libvtk5-dev libqhull* libusb-dev libgtest-dev git-core freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev graphviz mono-complete qt-sdk openjdk-7-jdk openjdk-7-jre
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_GPU=OFF -DBUILD_apps=OFF -DBUILD_examples=OFF ..
make -j8
sudo make install
sudo ldconfig
Step 5:安装OpenNi2
安装依赖项
$ sudo apt-get install -y g++ python libusb-1.0-0-dev freeglut3-dev doxygen graphviz
$ sudo apt-get install libudev-dev
$ apt-cache search openni2
libopenni2-0 - framework for sensor-based 'Natural Interaction'
libopenni2-dev - headers for OpenNI 'Natural Interaction' frameworks
openni2-doc - developer documentation for OpenNI frameworks
openni2-utils - debug and test utilities OpenNI2 framework
$ sudo apt-get install libopenni2-dev
测试是否安装成功
pkg-config --modversion libopenni2
在后来联调Kintinuous+KinectV2,执行.\Kintinuous
,报了一个错:
DeviceOpen using default: no devices found
就出在了这个OpenN,解决方法:
sudo apt-get install openni2-utils && sudo make install-openni2 && NiViewer2
Step 6:安装DLib, DBoW2, DLoopDetector
在Kintinuous进行make的时候,报错里面有,DVision,DBow2,DLoopDetector什么的,就直接重新安装这三个包就行了,别问我为什么知道的,按照下面给的链接咔咔往上安就行了.
为什么把这三个库放在一块,因为是一样的方法,直接按照Kintinuous官方给的链接下载,然后编译安装就行了.
https://github.com/dorian3d/DLib DLib 1.0 版本(必须为1.0,否则后面会很麻烦)
https://github.com/dorian3d/DBoW2
https://github.com/dorian3d/DLoopDetector 安装DLoopDetector-1.0(必须为1.0版本)
Step 7:安装iSAM
http://people.csail.mit.edu/kaess/isam/
下载,然后安装编译
Step 8:安装Pangolin
http://people.csail.mit.edu/kaess/isam/
下载,然后安装编译
Step 9:编译Kintinuous
具体参见官方文档
配置Kinect V2
流程按照官方github:
https://github.com/OpenKinect/libfreenect2/blob/master/README.md#linux
注意:
Kinect要使用USB 3.0的接口,连接成功的话应该是这样的,有3个Microsoft Crop,不然就是没连好
kevin@wanghan:~$ lsusb
Bus 002 Device 028: ID 045e:02c4 Microsoft Corp.
Bus 002 Device 027: ID 045e:02d9 Microsoft Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:56c6 IMC Networks
Bus 001 Device 005: ID 8087:0aaa Intel Corp.
Bus 001 Device 011: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 010: ID 058f:6459 Alcor Micro Corp.
Bus 001 Device 015: ID 045e:02d9 Microsoft Corp.
Bus 001 Device 008: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
要是连接好了,还是no device connected!
,可能是没有root的原因,需要sudo一下.
至此,就已经完成ubuntu18.04+Kintinuous+KinectV2的环境配置,再放效果图之前,想插播一句
千万不要轻易sudo apt-get autoremove,谁用谁知道
简书传不了视频,具体的效果还是看youtube吧