之前基于Win7搭建了kinect的开发环境,由于本人的机子太慢,编一个qt的hello world都要半分钟,所以为了方便以后的开发调试,尝试在ubuntu 12.04下搭建开发环境。
注意,如果你在尝试了好几次失败之后看到这篇文章,那么请先参考最下面的“可能出现的问题”,解决之后再按这篇文章的方法。
Attention, if you come here after several failure of try, please firstly refer to the 'Possible Problem' below. After solving the possible problem and then following the steps in this post.
另外,在安装之前不要连接Kinect
1. 安装需要的工具
libusb-1.0-0-dev freeglut3-dev g++
除了这个之外还有别的,下面继续介绍
2. 下载OpenNI, NITE和AVIN2
OpenNI
unstable build v1.5.4 https://github.com/OpenNI/OpenNI/tree/unstable
NITE
unstable build v1.5.2.21 http://www.openni.org/openni-sdk/openni-sdk-history-2/#.UUyp4LK012M
Avin2
https://github.com/avin2/SensorKinect/zipball/unstable.
3. 安装OpenNI
参考下载地址里面的readme,其中需要安装一些库还有小工具
4. 安装avin2
cd ~/kinect/sensorkin/Platform/Linux/CreateRedist/
chmod a+x RedistMaker
sudo ./RedistMaker
cd ../Redist/Sensor-Bin-Linux-x64-v5.1.0.25
sudo chmod a+x install.sh
sudo ./install.sh
5. 安装NITE
cd ~/kinect/nite/
chmod a+x install.sh
sudo ./install.sh
6. 测试
连接上Kinect,在OpenNI里面,Platform/Linux/Bin里面有一些例子,比如测试一个例子
sudo ./Sample-NiSimpleSkeletonz
在NITE中Samples/bin/ 中也有一些例子,可以试试。
可能遇到的问题:
Possible problem:
1. 安装过程中出现permission denied
2. 运行例子的过程中出现 Xiros OS failed to wait on event
3. 运行例子出现nodes could not be enumerated
出现这些问题应该是因为之前安装过类似的包,导致出现错误,我的建议是,想办法删掉之前的东西,然后重新按这篇文章的装,如果删不掉,那就重装系统。
这么说这些的原因的原因是以上问题我都遇到过。另外,有问题欢迎讨论。
Those problems happen probably because you have installed the similar package before and this cause some conflict. My suggestion is simple, just uninstall those you have installed before, and try to follow the steps in this post. If uninstalling is hard, you can just re install the OS.
The reason of the solution is that I have met all those problems before. BTW, feel free to contact me for discussion.
参考资料:
How to install Kinect in Linux(Mint 12, Ubuntu 12.04)
http://igorbarbosa.com/articles/how-to-install-kin-in-linux-mint-12-ubuntu/