关闭

ubuntu14.04安装kinect1驱动

标签: kinectopenNI2freenectubuntu
283人阅读 评论(0) 收藏 举报
分类:

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)`

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:13886次
    • 积分:296
    • 等级:
    • 排名:千里之外
    • 原创:14篇
    • 转载:7篇
    • 译文:0篇
    • 评论:3条
    文章分类
    最新评论