ubuntu16.04 使用kinectv2跑Elasticfusion
Posted panandying
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu16.04 使用kinectv2跑Elasticfusion相关的知识,希望对你有一定的参考价值。
1.安装openni2
参考:https://blog.csdn.net/D206_hero/article/details/78985859?utm_source=blogxgwz3
sudo apt-add-repository ppa:deb-rob/ros-trusty && sudo apt-get update
sudo apt-get install libopenni2-dev
2.安装libfreenect2
参考:http://www.cnblogs.com/hitcm/p/5118196.html
注意:按照上面链接中的方法编译成功,测试./bin/Protonect
,如果没问题,则按照下面方法重新编译一遍:
cmake .. -DBUILD_OPENNI2_DRIVER=ON make sudo make install sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/ 测试: ./bin/Protonect
如果按照上面语句直接编译,可能会出现以下错误:
[Debug] [DepthPacketStreamParser] not all subsequences received 0 [Debug] [DepthPacketStreamParser] not all subsequences received 1020 [Debug] [RgbPacketStreamParser] skipping rgb packet! [Debug] [RgbPacketStreamParser] skipping rgb packet! [Debug] [RgbPacketStreamParser] skipping rgb packet! The viewer is turned off. Received 100 frames. Ctrl-C to stop. The viewer is turned off. Received 200 frames. Ctrl-C to stop. The viewer is turned off. Received 300 frames. Ctrl-C to stop. [Debug] [RgbPacketStreamParser] skipping rgb packet! The viewer is turned off. Received 400 frames. Ctrl-C to stop. The viewer is turned off. Received 500 frames. Ctrl-C to stop. The viewer is turned off. Received 600 frames. Ctrl-C to stop. The viewer is turned off. Received 700 frames. Ctrl-C to stop. The viewer is turned off. Received 800 frames. Ctrl-C to stop. The viewer is turned off. Received 900 frames. Ctrl-C to stop. The viewer is turned off. Received 1000 frames. Ctrl-C to stop.
如果没有问题,则在此路径下执行如下操作:
sudo apt-get install openni2-utils sudo make install-openni2 NiViewer2
如果能显示图像,则可以编译Elasticfusion.
3.编译Elasticfusion
编译Core:
git clone https://github.com/mp3guy/ElasticFusion.git cd ElasticFusion cd Core mkdir build && cd build cmake ../src/ make sudo make install sudo ldconfig
编译GPUTest:
cd ../../GPUTest mkdir build && cd build cmake ../src/ make sudo ldconfig
编译GUI:
cd ../../GUI mkdir build && cd build cmake ../src/ make sudo make install sudo ldconfig
注:跑kinect2时,将MainController.cpp第37行的Resolution::getInstance(640, 480)
改为
Resolution::getInstance(512, 424)
否则可能会出现以下错误:
ElasticFusion: /home/slam/ElasticFusion/GUI/src/Tools/OpenNI2Interface.cpp:119:
OpenNI2Interface::OpenNI2Interface(int, int, int): Assertion `findMode(width, height, fps) && "Sorry, mode not supported!"‘ failed.
总之,非常的玄学。。。。。。
以上是关于ubuntu16.04 使用kinectv2跑Elasticfusion的主要内容,如果未能解决你的问题,请参考以下文章
基于Ubuntu 16.04,手持Kinect v2,实时跑通ORB_SLAM2