01-编译安装Kinect2驱动¶
本教程只针对Ubuntu18.04,其他系统版本,请参考官网文档:https://github.com/OpenKinect/libfreenect2
下载源码¶
git clone https://gitee.com/Ausar/libfreenect2.git
# github源码在 https://github.com/OpenKinect/libfreenect2
cd libfreenect2
初始化环境¶
-
安装编译工具
sudo apt-get install build-essential cmake pkg-config
-
Install libusb,版本必须 >= 1.0.20.
sudo apt-get install libusb-1.0-0-dev
-
Install TurboJPEG
sudo apt-get install libturbojpeg0-dev
-
Install OpenGL
sudo apt-get install libglfw3-dev
-
Install OpenCL (可选)
-
Intel GPU
sudo apt-get install beignet-dev
-
AMD GPU
Install the latest version of the AMD Catalyst drivers from https://support.amd.com and
apt-get install opencl-headers
.
-
编译¶
在libfreenect2目录中执行:
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
make
make install
配置¶
配置udev规则以获取访问设备的权限:
sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
随后拔插设备
测试¶
- 运行测试程序:
./bin/Protonect
如果看到一个窗口打开,内容为四个画面,则说明安装成功!
其他¶
在安装kinect驱动时,如果libusb有问题,需要指定版本,其安装如下,
sudo apt-add-repository ppa:floe/libusb
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev