配置环境
Ubuntu18.04
ros-melodic
Kinect v2
一.安装libfreenect2
安装依赖项
sudo apt-get install build-essential cmake pkg-config libturbojpeg libjpeg-turbo8-dev mesa-common-dev freeglut3-dev libxrandr-dev libxi-dev
sudo apt-get install libglfw3-dev
sudo apt-get install libopenni2-dev
sudo apt-get install libopenni2-dev
安装libfreenect2
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
mkdir build
cd build
cmake ..
make
sudo make install
设定udev rules:
sudo cp libfreenect2/platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
./bin/Protonect
二.安装OpenNI2
安装依赖
sudo apt-get install -y g++ python libusb-1.0-0-dev freeglut3-dev doxygen graphviz
sudo apt-get install libudev-dev
apt-cache search openni2
sudo apt-get install libopenni2-dev
pkg-config --modversion libopenni2
三.OpenNI2问题解决
测试NiViewer2时报错:
SimpleViewer: Device open failed:
DeviceOpen using default: no devices found
raise OpenNIError(res, msg.strip(), logfile)
openni.utils.OpenNIError: (OniStatus.ONI_STATUS_ERROR, 'DeviceOpen using default: no devices found', None)
解决办法:
$ sudo apt-get install openni2-utils
在freenect2/build目录下
$ sudo make install-openni2
$ NiViewer2