标签:
相比于kinect for xbox 360(v1)通过结构光来获取深度,Kinect for Xbox one(v2) 采用time flight技术,极大改善了深度图像的性能。kinect for xbox 360(v1)提供的原始图彩色图像是640×480,深度图是320×240,在ubuntu下,只需要安装openni即可获的registered的彩色图和深度图。而kinect for xbox one(v2)原始彩色图像是1920×1080,深度图像是512×424。目前在ubuntu下还没有像较好的驱动,获得registered图像一般通过libfreenect2(https://github.com/OpenKinect/libfreenect2)和iai_kinect2(https://github.com/code-iai/iai_kinect2)在ros下读取数据。好啦,不啰嗦了,我们开始安装吧。
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
cd depends
./download_debs_trusty.sh
sudo apt-get install build-essential cmake pkg-config
sudo apt-add-repository ppa:floe/libusb
sudo apt-get update
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libturbojpeg libjpeg-turbo8-dev
sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f; sudo apt-get install libgl1-mesa-dri-lts-vivid freeglut3-dev libxrandr-dev libxi-dev
sudo apt-get install nvidia-modprobe opencl-headers ocl-icd-dev
我是去下载ocl-icd-2.2.4,并安装的,不然后面会有warning提示版本低
sudo apt-get install openni2-utils && sudo make install-openni2 && NiViewer2
cd ..
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
make make install
sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
sudo chmod +x ./bin/Protonect
./bin/Protonect cpu
./bin/Protonect gl
./bin/Protonect cl
如果运行都成功,那么恭喜你,驱动安装好啦!
cd ~/catkin_ws/src/
git clone https:
//github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=
"Release"
roslaunch kinect2_bridge kinect2_bridge.launch
你也可以选择深度图获取方式和registration方式:
rosrun kinect2_bridge kinect2_bridge _depth_method:=<opengl|opencl|cpu> _reg_method:=<cpu|opencl>
rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud
rosrun kinect2_viewer kinect2_viewer kinect2 sd image
提示:如果想要取得更好的效果,记得按照iai_kinect2校准教程https://github.com/code-iai/iai_kinect2/tree/master/kinect2_calibration#calibrating-the-kinect-one 校准自己的相机参数哦!
Kinect for Xbox one(v2) + Ubuntu 14.04 +ROS
标签:
原文地址:http://www.cnblogs.com/kunyuanjushi/p/5204436.html