Ubuntu 16.04 在ros上使用Kinect2教程 (freenect驱动及iai_kinect的安装)
安装libfreenect:
相关依赖:
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libturbojpeg libjpeg-turbo8-dev
sudo apt-get install libglfw3-dev
下用一行表示:
sudo apt-get install build-essential cmake pkg-config libusb-1.0-0-dev libturbojpeg libjpeg-turbo8-dev libglfw3-dev
下载编译:
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
make -j`nproc`
make install
cd ..
cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2
sudo cp ./platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
安装iai_kinect包
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
//或者 :rosrun kinect2_bridge kinect2_bridge
//点云显示 :rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud