reference::
https://github.com/OpenKinect/libfreenect2
https://github.com/code-iai/iai_kinect2
if it is not work, try this:
3.ubuntu16.04与kinectV2 进行连接
参考: http://www.linuxdiyf.com/linux/24563.html
http://www.cnblogs.com/hitcm/p/5118196.html
(1)、通过git下载libfreenect2
$ git clone https://github.com/OpenKinect/libfreenect2.git
(2)、然后安装依赖项如下,最好事先编译安装好OpenCV
$ sudo apt-get install build-essential cmake pkg-config libturbojpeglibjpeg-turbo8-dev mesa-common-dev freeglut3-dev libxrandr-devlibxi-dev
(3)、然后安装libusb。此处需要添加一个PPA,就是下面的第一行命令,不然绝逼是装不上的。
$ sudo apt-add-repository ppa:floe/libusb
$ sudo apt-get update
$ sudo apt-get install libusb-1.0-0-dev
(4)、接着运行下面的命令,安装GLFW3
$ sudo apt-get install libglfw3-dev
如果没有成功的话,使用下面的命令,来代替上面的
$ cd libfreenect2/depends
$sh install_ubuntu.sh
$sudo dpkg -i libglfw3*_3.0.4-1_*.deb
(5)、然后安装OpenCL的支持库(不打算使用GPU,这一步直接跳过没做)
(6)、接着编译库(其实就是在libfreenect2文件夹下新建了build目录,然后再进入build目录执行编译)
$ cd ..
$mkdir build && cd build
$cmake ..
$make
$sudo make install
>>测试
1. 在shell窗口执行libusb可以查看当前连接的USB外设情况。(如果看到有“Microsoft Coop.”的项表示连接上了!)
2. 运行libfreenect2自带的测试程序.
在build下面有个bin文件夹,放置生成的输出文件,插上kinect,然后运行。此时黄灯变成白色的,表示有驱动。注意:只能用于USB3的接口,好在台式机和笔记本都有3.0的口。
$ ./bin/Protonect
提示权限不够,failedto open Kinect V2 Access denied
此时需要把libfreenect2文件夹下面的rules里面的一个90开头的文件复制到/etc/udev/rules.d/下面:
$ cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d
发现此时运行$ ./bin/Protonect还是会提示Access denied。前面加上sudo后可以了。。。
最终使用的命令:$ sudo ./bin/Protonect
===============================================================================
!!! bug fixed::
1,final step:
roscore
rosrun kinect2_bridge kinect2_bridge _depth_method:=opengl _reg_method:=cpu
rosrun kinect2_viewer kinect2_viewer
2,in the process of install libfreenect2 ---->can not open ubuntu
gpu drive issue: in bios change gpu of default or search baidu or google for can not open ubuntu or black screen when open ubuntu