Kintinuous 在Ubuntu16.04下编译安装过程(附带所有用到的源码)

写在前面:很多Kintinuous安装教程都是手动安装依赖的方式,过程繁琐,容易出错,其实Kintinuous官方提供傻瓜式自动安装的方式,但必须是纯净系统(刚装的系统,还没有使用过),但我没有实验过

以下是官方给出的Easy Way

Is there an easier way to build it?

Understandably, building all of the dependencies seems quite complicated. If you run the build.sh script on a fresh clean install of Ubuntu 14.04 or 15.04, enter your password for sudo a few times and wait a few minutes all dependencies will get downloaded and installed and it should build everything correctly. This has not been tested on anything but fresh installs, so I would advise using it with caution if you already have some of the dependencies installed.

 

正文开始!!!(手动安装各个依赖)

 

Nvidia驱动、CUDA等网上有很多教程,所以这里只给出一些参考文章,不过要注意安装顺序应当和这里一致

一、安装必备组件

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

二、安装Nvidia驱动

    参考:https://blog.csdn.net/Max_Loo/article/details/81304949

三、安装CUDA(版本大于等于7.0)

    参考:https://blog.csdn.net/qq_35379989/article/details/80147630

    说明:Nvidia驱动和CUDA的安装根据不同的软将硬件环境,有的安装会很费事,比如我(各种莫名其妙的错误),有的安装很顺利,所以以上仅供参考

四、安装OpenNI2

    参考:https://blog.csdn.net/renhaofan/article/details/80991095

五、安装PCL 1.7

sudo apt-get install libpcl-dev pcl-tools

六、安装OpenCV 2.4.13 (3.X版本不能用,2.4.9没测试,2.4.13肯定能用)   

    下载 OpenCV2.4.13 源码(这里下载很慢,文末附件包含)

    解压后进入含有CMakeList.txt的目录下执行以下命令:

mkdir build
cd build
ccmake ..

  确保BUILD_opencv_features2d  和 BUILD_opencv_nonfree 为ON

  按g键会生成Makefile文件,然后

make
编译完成后执行
sudo make install

七、安装DLib 1.0 版本(必须为1.0,否则后面会很麻烦)

   从这里下载(这里下载很慢,文末附件包含)

   进入包含CMakeList.txt文件的目录下,执行一下命令:

mkdir build
cd build
cmake ..
make
sudo make install

八、  安装DBoW2-1.0 版本

   安装过程同DLib

   如果在后来的Kintinuous编译过程中出现类似下面的错误:

libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::getFlannStructure(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::FlannBasedMatcher&) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE17getFlannStructureERKS1_IS3_SaIS3_EERN2cv17FlannBasedMatcherE[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE17getFlannStructureERKS1_IS3_SaIS3_EERN2cv17FlannBasedMatcherE]+0xc9):对‘DBoW2::FSurf64::toMat32F(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::Mat&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::transform(std::vector<float, std::allocator<float> > const&, unsigned int&, double&, unsigned int*, int) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji]+0xc6):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE9transformERKS3_RjRdPji]+0xf9):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::isGeometricallyConsistent_Flann(unsigned int, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::FlannBasedMatcher&) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE31isGeometricallyConsistent_FlannEjRKS1_IN2cv8KeyPointESaIS8_EERKS1_IS3_SaIS3_EERNS7_17FlannBasedMatcherE[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE31isGeometricallyConsistent_FlannEjRKS1_IN2cv8KeyPointESaIS8_EERKS1_IS3_SaIS3_EERNS7_17FlannBasedMatcherE]+0x128):对‘DBoW2::FSurf64::toMat32F(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, cv::Mat&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::load(cv::FileStorage const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’中:
DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4loadERKN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4loadERKN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2d1):对‘DBoW2::FSurf64::fromString(std::vector<float, std::allocator<float> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DLoopDetector::TemplatedLoopDetector<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::getMatches_neighratio(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > > const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<unsigned int, std::allocator<unsigned int> >&, std::vector<unsigned int, std::allocator<unsigned int> >&) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_]+0x158):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
DBowInterfaceSurf.cpp:(.text._ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_[_ZNK13DLoopDetector21TemplatedLoopDetectorISt6vectorIfSaIfEEN5DBoW27FSurf64EE21getMatches_neighratioERKS1_IS3_SaIS3_EERKS1_IjSaIjEESA_SE_RSC_SF_]+0x312):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::initiateClustersKMpp(std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >&) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE]+0x1f8):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE20initiateClustersKMppERKS1_IPKS3_SaIS7_EERS1_IS3_SaIS3_EE]+0x26b):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::HKmeansStep(unsigned int, std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, int)’中:
DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x282):对‘DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x2cd): 跟着更多未定义的参考到 DBoW2::FSurf64::distance(std::vector<float, std::allocator<float> > const&, std::vector<float, std::allocator<float> > const&)
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::HKmeansStep(unsigned int, std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, int)’中:
DBowInterfaceSurf.cpp:(.text._ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi[_ZN5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE11HKmeansStepEjRKS1_IPKS3_SaIS7_EEi]+0x4e1):对‘DBoW2::FSurf64::meanValue(std::vector<std::vector<float, std::allocator<float> > const*, std::allocator<std::vector<float, std::allocator<float> > const*> > const&, std::vector<float, std::allocator<float> >&)’未定义的引用
libbackend.a(DBowInterfaceSurf.cpp.o):在函数‘DBoW2::TemplatedVocabulary<std::vector<float, std::allocator<float> >, DBoW2::FSurf64>::save(cv::FileStorage&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const’中:
DBowInterfaceSurf.cpp:(.text._ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4saveERN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZNK5DBoW219TemplatedVocabularyISt6vectorIfSaIfEENS_7FSurf64EE4saveERN2cv11FileStorageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1fe):对‘DBoW2::FSurf64::toString[abi:cxx11](std::vector<float, std::allocator<float> > const&)’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/Kintinuous.dir/build.make:471: recipe for target 'Kintinuous' failed
make[2]: *** [Kintinuous] Error 1
make[2]: Leaving directory '/home/Kintinuous/Kintinuous-master/src/build'
CMakeFiles/Makefile2:180: recipe for target 'CMakeFiles/Kintinuous.dir/all' failed
make[1]: *** [CMakeFiles/Kintinuous.dir/all] Error 2
make[1]: Leaving directory '/home/Kintinuous/Kintinuous-master/src/build'
Makefile:83: recipe for target 'all' failed

  我的解决方法是卸载DBoW2-1.0,安装DBoW2-1.1-nonfree版本,只是不能编译DBoW2的demo,在这里会出错

九、安装DLoopDetector-1.0(必须为1.0版本)

  从这里下载(这里下载很慢,文末附件包含)

  安装过程与DLib一致

十、安装iSAM 1.7 版本

   从这里下载(这里下载很慢,文末附件包含)

   安装过程与DLib一致

十一、安装Pangolin最新版本(截至目前的最新版本,若不行请下载文末附件里面的)

   从这里下载  安装过程与DLib一致

十二、安装Kintinuous 终于到了这一步了^_^

   下载源码:https://github.com/mp3guy/Kintinuous (最好下载文末附件里面的,防止源码被更新不适用此教程)

   安装过程与DLib一致

经验:务必要注意上述各种依赖的版本,否则会出现各种各样的问题,这是我尝试了很多个版本后才总结出来的,血的教训啊

遇到的错误:

DBowInterfaceSurf.cpp:77:16: error: ‘SURF’ in namespace‘ cv’ does not name a type

解决:打开src/backend/DBowInterfaceSurf.h,添加以下两句:

#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/nonfree/features2d.hpp>

  源码附件:https://download.csdn.net/download/lzrush/11097275  (系统默认5个积分,我改不了)

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值