Playing Kinect 2 with ROS in Ubuntu 16.04: Hello World
来源:互联网 发布:linux 查看时钟同步 编辑:程序博客网 时间:2024/04/24 20:38
OS: Ubuntu 16.04.02 x64
ROS: Kinetic
Device: Kinect 2
OpenCV: 2.4.13.3
USB 3.0 Controller is essential
Now we begin to talk about how to play kinect2 with ROS. Note that OpenCV 2.4.X is essential and OpenCV 3 will not work. You can check the verison of your OpenCV by type in:
pkg-config --modversion opencv
Install libfreenect2
There are some ways to drive kinect 2 in linux. Here we only talk about libfreenect2, which is very convenient. You can follow this instruction to install it if you want more details. However, if you would like to play with kinect 2 as soon as possible, just go ahead.
Download libfreenect2:
git clone https://github.com/OpenKinect/libfreenect2.gitcd libfreenect2
Install build tools:
sudo apt-get install build-essential cmake pkg-config
Install libusb: (version >= 1.0.20), TurboJPEG and OpenGL
sudo apt-get install libusb-1.0-0-devsudo apt-get install libturbojpeg libjpeg-turbo8-devsudo apt-get install libglfw3-dev
Build
mkdir build && cd buildcmake .. -DENABLE_CXX11=ON -DCMAKE_INSTALL_PREFIX=$HOME/freenect2makemake install
A Test
Run a program: (Never forget to plug your Kinect 2)
./bin/Protonect
Then you will see the following window if nothing goes wrong.
Install IAI Kinect2
Now go to your catkin workspace. Let’s try to get the iai_kinect2 package and make it.
Follow this instruction if you want more details.
cd $YOUR_CATKIN_WORKSPACE_PATH/srcgit clone https://github.com/code-iai/iai_kinect2.gitcd iai_kinect2rosdep install -r --from-paths .
rosdep will output errors on not being able to locate [kinect2_bridge] and [depth_registration]. Never mind, that is fine because they are all part of the iai_kinect2 package and rosdep does not know these packages.
cd ~/YOUR_CATKIN_WORKSPACE_PATHcatkin_make -DCMAKE_BUILD_TYPE="Release"
Run kinect2_bridge :
roslaunch kinect2_bridge kinect2_bridge.launch
Then you can see that some nodes are running:
/kinect2/kinect2_bridge/kinect2_points_xyzrgb_hd/kinect2_points_xyzrgb_qhd/kinect2_points_xyzrgb_sd/rosout
Go Ahead
Now you can use your kinect 2 in your ROS system to do some robotics research. Here are some references you may need:
- Calibrate your sensor using the kinect2_calibration.
- Add the calibration files to the kinect2_bridge/data.
- Restart kinect2_bridge and view the results using rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud.
- Playing Kinect 2 with ROS in Ubuntu 16.04: Hello World
- Play with OpenAI Gym in Ubuntu 16.04: Hello World
- Install kinect on ubuntu and run kinect in ros
- ROS - “hello world!”
- ros hello world 实现
- ros hello world 实现
- Playing MP3 in Ubuntu
- Develop Leap Motion in ROS Kinetic: Hello World
- Hello,world &Hello Ubuntu
- Kinect on Ubuntu with OpenNI2.2
- 2-1 Tutorials with python -hello world
- Hello World with Ant
- Hello world with LUA
- Hello World With Kotlin
- ubuntu 16.04 安装ROS Kinect v2的驱动
- Hello world in Java
- Hello World in ODE
- Hello World Under Ubuntu
- 文本操作(1)——cut
- 旋转数组的最小数字
- css border属性
- JAVA面试
- valgrind检测内存泄露
- Playing Kinect 2 with ROS in Ubuntu 16.04: Hello World
- 我对Java Serializable(序列化)的理解和总结
- tensorboard找不到文件问题(windows10)
- Spring注解详解
- js中模型定义
- [Leetcode] 380. Insert Delete GetRandom O(1) 解题报告
- Spring Web Mvc (Maven)构建以及hello word
- 剑指offer-19:二叉树的镜像
- 新路程------SN74CB3Q3257的选择