ubuntu14.04安装kinect1驱动

ubuntu 下的kinect1的驱动我知道的有两种方式:
1 openNI+sensor+NITE(可选)
2 openNI2+libFreenect
我使用的是方法2。

下载

libfreenect
openNI2


安装

1.安装openNI2
解压文件
cd /opt/OpenNI/OpenNI-Linux-x64-2.2/
sudo ./install.sh 会生成一个OpenNIDevEnvironment
cat OpenNIDevEnironment >> ~/.bashrc
cd ~&&source .bashrc
2.安装libfreenect
git clone https://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build&&cd build
cmake .. -DBUILD_OPENNI2_DRIVER=ON
make
sudo make install
sudo cp -L ~/Down/libfreenect/build/lib/OpenNI2-FreenectDriver/libFreenectDriver.so /opt/OpenNI/OpenNI-Linux-x64-2.2/Redist/OpenNI2/Drivers/libFreenectDriver.so
3.添加usb的rules
sudo cp libfreenect/platform/linux/udev/51-kinect.rules /etc/udev/rules.d
sudo reboot

cmake的添加openNI2

最后在建立的工程中的CMakeLists.txt中加入Openni2的配置
`#Openni2
FIND_PATH(OpenNI2_INCLUDE_DIRS OpenNI.h HINTS ENVOPENNI2INCLUDE64ENV{OPENNI2_INCLUDE} PATH_SUFFIXES openni2)
FIND_LIBRARY(OpenNI2_LIBRARY NAMES OpenNI2 HINTS ENVOPENNI2LIB64ENV{OPENNI2_LIB} $ENV{OPENNI2_REDIST})

IF (OpenNI2_INCLUDE_DIRS AND OpenNI2_LIBRARY)
SET(OpenNI2_FOUND TRUE)
ENDIF (OpenNI2_INCLUDE_DIRS AND OpenNI2_LIBRARY)

IF (OpenNI2_FOUND)
# show which OpenNI2 was found only if not quiet
SET(OpenNI2_LIBRARIES OpenNI2LIBRARY)MESSAGE(STATUSFoundOpenNI2:{OpenNI2_LIBRARIES}”)
ELSE (OpenNI2_FOUND)
# fatal error if OpenNI2 is required but not found
IF (OpenNI2_FIND_REQUIRED)
MESSAGE(FATAL_ERROR “Could not find OpenNI2. Environment variables OPENNI2_INCLUDE (directory containing OpenNI.h) and OPENNI2_LIB (directory containing OpenNI2 library) could bet set.”)
ENDIF (OpenNI2_FIND_REQUIRED)
ENDIF (OpenNI2_FOUND)`

阅读更多
版权声明:本文为博主原创文章,如若转载,请注明本文的链接作为转载出处 https://blog.csdn.net/StrugglePeach/article/details/53992919
个人分类: kinect
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭