Skip to content

ros_kinect2_setup

litterbug23 edited this page Apr 18, 2018 · 5 revisions

Ubuntu+ROS 安装和调试kinect

安装Kinect驱动

Kinect目前有1.0版本和2.0版本的驱动,两个版本分别使用不同版本的驱动。Kinect1.0 使用libfreenect , Kinect2.0使用libfreenect2. 具体安装参考下面的安装中文资料。

ROS Kinect 连接驱动

ROS 下kinect驱动主要是提供ROS从Kinect读取数据的节点和服务。 资料 https://github.com/ros-drivers/openni2_camera

调试Kinect

Linux直接连接Kinect测试

ROS 连接Kinect测试

Linux 不能连接 Kinect 问题汇总

首先检查Usb接口是否有Kinect设备,一般在Usb接口会显示Kinect或OpenNI的提示, 使用如下命令查询:

$ lsusb
Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 093a:2521 Pixart Imaging, Inc. Optical Mouse
Bus 002 Device 002: ID 05e3:0606 Genesys Logic, Inc. USB 2.0 Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 002 Device 007: ID 1d27:0601 ASUS 

详细问题资料:https://blog.csdn.net/billbliss/article/details/56489674

今天将usb接口修改3.0接口后,使用lsusb命令可以找到Kinect设备。 运行libfreenect的测试工具,提示信息如下:

turtlebot@ubuntu:~/libfreenect2/build$ ./bin/Protonect 
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: ./bin/Protonect [-gpu=<id>] [gl | cl | clkde | cuda | cudakde | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 9 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:2 with serial 500669242742
[Info] [Freenect2Impl] found 1 devices
[Error] [OpenGLDepthPacketProcessorImpl] GLFW error 65543 GLX: Failed to create context: GLXBadFBConfig
[Error] [OpenGLDepthPacketProcessor] Failed to create opengl window.

其他人也遇到相似问题:https://github.com/OpenKinect/libfreenect2/issues/350 输出信息 found valid Kinect v2 @4:2 with serial 500669242742 说明已经可以找到Kinect设备。glfw问题,应该是显卡驱动问题,GLX应该需要OpenGL3.0版本以上驱动。 目前驱动版本是:

turtlebot@ubuntu:~$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 2.1 Mesa 10.3.2
OpenGL shading language version string: 1.20
turtlebot@ubuntu:~$ 

更新驱动的相关信息: https://askubuntu.com/questions/501560/how-to-update-opengl-driver-on-ubuntu-14-04-lts/ https://blog.csdn.net/l297969586/article/details/53534807

#参考资料

#后记

Libfreenect is mainly a driver which exposes the Kinect device's features: - depth stream - IR stream - color(RGB) stream - motor control - LED control - accelerometer

It does not provide any advanced processing features like scene segmentation, skeleton tracking, etc.

On the other hand, OpenNI allows generic access to Kinect's feature (mainly the image streams), but also provides rich processing features such as: - scene segmentation - skeleton tracking - hand detection and tracking - gesture recognition - user interface elements etc. but no low level controls to device features like motor/LED/accelerometer.

As opposed to libfreenect which AFAIK works only with the Kinect sensor, OpenNI works with Kinect but with other sensors as well like Asus Xtion Pro, Carmine, etc.

You've mentioned the Kinect SDK. It's good to bare in mind the are multiple Kinect sensors: - Kinect for Xbox - Kinect for Windows The Kinect for Windows sensor for example allows a close mode and has a longer range. I don't know how the skeleton tracking differs. Also, there is a MS Kinect-OpenNI bridge bridge project and OpenNI2 works plays nice with Kinect