在Ubuntu16.04_ROS_kinetic上安装kinect2的驱动和bridge

官方文档:

libfreenect2:https://github.com/OpenKinect/libfreenect2

iai_kinect2:https://github.com/code-iai/iai_kinect2#opencl-with-amd

libfreenect2

下载文件

git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2

(Ubuntu 14.04 only) Download upgrade deb files

cd depends; ./download_debs_trusty.sh

Install build tools

sudo apt-get install build-essential cmake pkg-config
  • Install libusb. The version must be >= 1.0.20.
    1. (Ubuntu 14.04 only) sudo dpkg -i debs/libusb*deb
    2. (Other) sudo apt-get install libusb-1.0-0-dev
  • Install TurboJPEG
    1. (Ubuntu 14.04 to 16.04) sudo apt-get install libturbojpeg libjpeg-turbo8-dev
    2. (Debian/Ubuntu 17.10 and newer) sudo apt-get install libturbojpeg0-dev
  • Install OpenGL
    1. (Ubuntu 14.04 only) sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f
    2. (Odroid XU4) OpenGL 3.1 is not supported on this platform. Use cmake -DENABLE_OPENGL=OFF later.
    3. (Other) sudo apt-get install libglfw3-dev
  • Install OpenCL (optional)
    • Intel GPU
      1. (Ubuntu 14.04 only) sudo apt-add-repository ppa:floe/beignet; sudo apt-get update; sudo apt-get install beignet-dev; sudo dpkg -i debs/ocl-icd*deb
      2. (Other) sudo apt-get install beignet-dev
      3. For older kernels, # echo 0 >/sys/module/i915/parameters/enable_cmd_parser is needed. See more known issues at https://www.freedesktop.org/wiki/Software/Beignet/.
    • AMD GPU: Install the latest version of the AMD Catalyst drivers from https://support.amd.com and apt-get install opencl-headers.
    • Mali GPU (e.g. Odroid XU4): (with root) mkdir -p /etc/OpenCL/vendors; echo /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so >/etc/OpenCL/vendors/mali.icd; apt-get install opencl-headers.
    • Verify: You can install clinfo to verify if you have correctly set up the OpenCL stack.
  • Install CUDA (optional, Nvidia only):
    • (Ubuntu 14.04 only) Download cuda-repo-ubuntu1404...*.deb ("deb (network)") from Nvidia website, follow their installation instructions, including apt-get install cuda which installs Nvidia graphics driver.
    • (Jetson TK1) It is preloaded.
    • (Nvidia/Intel dual GPUs) After apt-get install cuda, use sudo prime-select intel to use Intel GPU for desktop.
    • (Other) Follow Nvidia website's instructions. You must install the samples package.
  • Install VAAPI (optional, Intel only)
    1. (Ubuntu 14.04 only) sudo dpkg -i debs/{libva,i965}*deb; sudo apt-get install -f
    2. (Other) sudo apt-get install libva-dev libjpeg-dev
    3. Linux kernels 4.1 to 4.3 have performance regression. Use 4.0 and earlier or 4.4 and later (Though Ubuntu kernel 4.2.0-28.33~14.04.1 has backported the fix).
  • Install OpenNI2 (optional)
    1. (Ubuntu 14.04 only) sudo apt-add-repository ppa:deb-rob/ros-trusty && sudo apt-get update (You don't need this if you have ROS repos), then sudo apt-get install libopenni2-dev
    2. (Other) sudo apt-get install libopenni2-dev
  • Build (if you have run cd depends previously, cd .. back to the libfreenect2 root directory first.)
    mkdir build && cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
    make
    make install
    
    You need to specify cmake -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2 for CMake based third-party application to find libfreenect2.
  • Set up udev rules for device access: sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/, then replug the Kinect.
  • Run the test program: ./bin/Protonect
  • Run OpenNI2 test (optional): sudo apt-get install openni2-utils && sudo make install-openni2 && NiViewer2. Environment variable LIBFREENECT2_PIPELINE can be set to clcuda, etc to specify the pipeline.

 

安装iai_kinect2

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"

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值