• Stars
    star
    875
  • Rank 52,157 (Top 2 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tools for using the Kinect One (Kinect v2) in ROS

IAI Kinect2

Maintainer

Read this first

Please read this README and the ones of the individual components throughly before asking questions. We get a lot of repeated questions, so when you have a problem, we urge everyone to check the github issues (including closed ones). Your issue is very likely discussed there already.

The goal of this project is to give you a driver and the tools needed to receive data from the Kinect-2 sensor, in a way useful for robotics. You will still need to know how to use ROS to make use of it. Please follow the ROS tutorials. You will also need to learn how to work with point-clouds, or depth-clouds, or images (computer vision) to do useful things with the data.

Note: Please use the GitHub issues for questions and problems regarding the iai_kinect2 package and its components. Do not write emails.

Table of contents

Description

This is a collection of tools and libraries for a ROS Interface to the Kinect One (Kinect v2).

It contains:

FAQ

If I have any question or someting is not working, what should I do first?

First you should look at this FAQ and the FAQ from libfreenect2. Secondly, look at issue page from libfreenect2 and the issue page of iai_kinect2 for similar issues and solutions.

Point clouds are not being published?

Point clouds are only published when the launch file is used. Make sure to start kinect2_bridge with roslaunch kinect2_bridge kinect2_bridge.launch.

Will it work with OpenCV 3.0

Short answer: No.

Long answer: Yes, it is possible to compile this package with OpenCV 3.0, but it will not work. This is because cv_bridge is used, which itself is compiled with OpenCV 2.4.x in ROS Indigo/Jade and linking against both OpenCV versions is not possible. Working support for OpenCV 3.0 might come with a future ROS release.

kinect2_bridge is not working / crashing, what is wrong?

There are many reasons why kinect2_bridge might not working. The first thing to find out whether the problem is related to kinect2_bridge or libfreenect2. A good tool for testing is Protonect, it is a binary located in libfreenect2/build/bin/Protonect. It uses libfreenect2 directly with a minimal dependency on other libraries, so it is a good tool for the first tests.

Execute:

  • ./Protonect gl to test OpenGL support.
  • ./Protonect cl to test OpenCL support.
  • ./Protonect cpu to test CPU support.

Before running kinect2_bridge please make sure Protonect is working and showing color, depth and ir images. If some of them are black, than there is a problem not related to kinect2_bridge and you should look at the issues from the libfreenect2 GitHub page for help.

If one of them works, try out the one that worked with kinect2_bridge: rosrun kinect2_bridge kinect2_bridge _depth_method:=<opengl|opencl|cpu>. You can also change the registration method with _reg_method:=<cpu|opencl>.

Protonect works fine, but kinect2_bridge is still not working / crashing.

If that is the case, you have to make sure that Protonect uses the same version of libfreenect2 as kinect2_bridge does. To do so, run make and sudo make install in the build folder again. And try out kinect2_bridge again.

cd libfreenect2/build
make & sudo make install

Also make sure that you are not using OpenCV 3.0.

If it is still crashing, compile it in debug and run it with gdb:

cd <catkin_ws>
catkin_make -DCMAKE_BUILD_TYPE="Debug"
cd devel/lib/kinect2_bridge
gdb kinect2_bridge
# inside gdb: run until it crashes and do a backtrace
run
bt
quit

Open an issue and post the problem description and the output from the backtrace (bt).

kinect2_bridge hangs and prints "waiting for clients to connect"

This is the normal behavior. 'kinect2_bridge' will only process data when clients are connected (ROS nodes listening to at least one of the topics). This saves CPU and GPU resources. As soon as you start the kinect_viewer or rostopic hz on one of the topics, processing should start.

rosdep: Cannot locate rosdep definition for [kinect2_bridge] or [kinect2_registration]

rosdep will output errors on not being able to locate [kinect2_bridge] and [kinect2_registration]. That is fine because they are all part of the iai_kinect2 package and rosdep does not know these packages.

Protonect or kinect2_bridge outputs [TransferPool::submit] failed to submit transfer

This indicates problems with the USB connection.

I still have an issue, what should I do?

First of all, check the issue pages on GitHub for similar issues, as they might contain solutions for them. By default you will only see the open issues, but if you click on closed you will the the ones solved. There is also a search field which helps to find similar issues.

If you found no solution in the issues, feel free to open a new issue for your problem. Please describe your problem in detail and provide error messages and log output.

Dependencies

  • ROS Hydro/Indigo
  • OpenCV (2.4.x, using the one from the official Ubuntu repositories is recommended)
  • PCL (1.7.x, using the one from the official Ubuntu repositories is recommended)
  • Eigen (optional, but recommended)
  • OpenCL (optional, but recommended)
  • libfreenect2 (>= v0.2.0, for stability checkout the latest stable release)

Install

  1. Install the ROS. Instructions for Ubuntu 14.04

  2. Setup your ROS environment

  3. Install libfreenect2:

    Follow the instructions and enable C++11 by using cmake .. -DENABLE_CXX11=ON instead of cmake ... If you are compiling libfreenect2 with CUDA, use cmake .. -DENABLE_CXX11=ON -DCUDA_PROPAGATE_HOST_FLAGS=off.

    If something is not working, check out the latest stable release, for example git checkout v0.2.0.

  4. Clone this repository into your catkin workspace, install the dependencies and build it:

    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"

    Note: rosdep will output errors on not being able to locate [kinect2_bridge] and [depth_registration]. That is fine because they are all part of the iai_kinect2 package and rosdep does not know these packages.

    Note: If you installed libfreenect2 somewhere else than in $HOME/freenect2 or a standard location like /usr/local you have to specify the path to it by adding -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2 to catkin_make.

  5. Connect your sensor and run kinect2_bridge:

    roslaunch kinect2_bridge kinect2_bridge.launch
  6. Calibrate your sensor using the kinect2_calibration. Further details

  7. Add the calibration files to the kinect2_bridge/data/<serialnumber> folder. Further details

  8. Restart kinect2_bridge and view the results using rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud.

GPU acceleration

OpenCL with AMD

Install the latest version of the AMD Catalyst drivers from https://support.amd.com and follow the instructions. Also install opencl-headers.

sudo apt-get install opencl-headers

OpenCL/CUDA with Nvidia

Go to developer.nvidia.com/cuda-downloads and select linux, x86_64, Ubuntu, 14.04, deb(network). Download the file and follow the instructions. Also install nvidia-modprobe and opencl-headers.

sudo apt-get install nvidia-modprobe opencl-headers

You also need to add CUDA paths to the system environment, add these lines to you ~/.bashrc:

export LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
export PATH="/usr/local/cuda/bin:${PATH}"

A system-wide configuration of the libary path can be created with the following commands:

echo "/usr/local/cuda/lib64" | sudo tee /etc/ld.so.conf.d/cuda.conf
sudo ldconfig

OpenCL with Intel

You can either install a binary package from a PPA like ppa:floe/beignet, or build beignet yourself. It's recommended to use the binary from the PPA.

sudo add-apt-repository ppa:floe/beignet && sudo apt-get update
sudo apt-get install beignet beignet-dev opencl-headers

Citation

If you used iai_kinect2 for your work, please cite it.

@misc{iai_kinect2,
  author = {Wiedemeyer, Thiemo},
  title = {{IAI Kinect2}},
  organization = {Institute for Artificial Intelligence},
  address = {University Bremen},
  year = {2014 -- 2015},
  howpublished = {\url{https://github.com/code-iai/iai\_kinect2}},
  note = {Accessed June 12, 2015}
}

The result should look something similar to this (may depend on the bibliography style used):

T. Wiedemeyer, β€œIAI Kinect2,” https://github.com/code-iai/iai_kinect2,
Institute for Artificial Intelligence, University Bremen, 2014 – 2015,
accessed June 12, 2015.

Screenshots

Here are some screenshots from our toolkit: color image depth image point cloud image viewer

More Repositories

1

ROSIntegration

Unreal Engine Plugin to enable ROS Support
C++
348
star
2

ROSIntegrationVision

Support for ROS-enabled RGBD data acquisition in Unreal Engine Projects
C++
62
star
3

pico_flexx_driver

ROS driver for the pmd CamBoard pico flexx
C++
50
star
4

snap_map_icp

Module for relocalizing a ROS-enabled robot based on it's base laser readings and matching them with the currently advertised /map topic.
C++
23
star
5

ros_emacs_utils

Emacs tools for ROS
Common Lisp
17
star
6

asimov

ROS Clojure Repository
Clojure
14
star
7

iai_maps

The semantic and ground lab and environment maps for projects in the IAI group in the University of Bremen
CMake
12
star
8

iai_robots

Repo holding descriptions and launch-files for robots in the iai lab.
CMake
10
star
9

knowrob_dev

Private development repository for the KnowRob knowledge base
Java
5
star
10

robot_scenarios_sim

Simulated Robot Scenarios for Testing various Robot Activities
Prolog
5
star
11

roslisp_tutorials

Common Lisp
4
star
12

knowrob_webtools

Collection of open-source modules and tools for building web-based robot apps based on the robot web tools (http://robotwebtools.org/)
JavaScript
4
star
13

unreal_interface

ROS package is intended to provide a low-level interface to interact with a UE4 world
C++
3
star
14

rosjava_jni

TBD
Java
3
star
15

iai_common_msgs

Holds various ROS message definitions used by the IAI group, UniversitΓ€t Bremen.
CMake
3
star
16

semrec

Semantic Hierarchy Recorder for (autonomous) hierarchical experiment data that is semantically annotated
C++
3
star
17

lisp_course_material

Emacs Lisp
2
star
18

ias_perception

Perception modules developed in the IAS group at TUM
C++
2
star
19

ConvertMeshToFBX

Python
2
star
20

rviz_plugin_moveit_collisionmap

RViz display plugin for moveit_msgs::CollisionMap messages
C++
2
star
21

UE4Bson

C
2
star
22

kiba_tutorials

C++
2
star
23

iai_gazebo_pkgs

Various gazebo plugins and configurations created by the IAI group, University Bremen, Germany.
C++
2
star
24

turtlebot_roomba

Launch files and drivers for using the turtlebot 1 robot with a Roomba 5xx base instead of an iRobot create.
Python
2
star
25

unreal_vision_bridge

Unreal to ROS bridge for UnrealVision / URoboVision
C++
2
star
26

longterm_fetch_and_place

Longterm Fetch and Place scenario
Common Lisp
2
star
27

UnrealUrdfExporter

C++
2
star
28

ias_perception_aux

Auxiliary packages for the ias_perception stack, containing perception modules developed by the IAS group at TUM
C++
2
star
29

iai_cad_tools

Tools for interacting with the IAI CAD model repository
Python
2
star
30

iai_table_robot_description

DEPRECATED: URDF description of the table-mounted UR5 robots in the lab of the IAI.
CMake
2
star
31

iai_control_pkgs

Collection of various robot control packages, written/maintained by the iai group at Universitaet Bremen.
C++
2
star
32

UnrealInterfaceObjectPlugin

Functionality specific to the unreal_interface ROS package
C++
1
star
33

iai-grasping-type-inference

Python
1
star
34

openEASE-flask

JavaScript
1
star
35

robot_wrist_ft_tools

Tools for dealing with force-torque sensors installed at robot wrists
Python
1
star
36

iai_tiago

CMake
1
star
37

iai_manual_tool_calib

A ROS utility to manually calibrate a tool with respect to the end-effector of a robot.
Python
1
star
38

iai_pr2

Installation, configuration, and launch files specific to IAI's PR2 robot.
Common Lisp
1
star
39

iai_photo

ROS Package for capturing images from a camera using llibgphoto2
C++
1
star
40

iai_shapelets

Python
1
star
41

iai_kmr_iiwa

Python
1
star
42

shopping_scenario

Shopping Scenario related repositories, holding code, models, and executives
Common Lisp
1
star
43

topic_relay

Tool for relaying information for specific topics between two different ROS masters
C++
1
star
44

narrative2vec

Python
1
star
45

UnrealApartment

1
star
46

saphari_final_review

Configurations, launch files, and source code for the final SAPHARI review.
Common Lisp
1
star
47

UAivatar

Avatar's Plugin for UE4
C++
1
star
48

iai_naive_kinematics_sim

naive, lightweight, and ROS-based robot kinematics simulation
C++
1
star
49

omni_teleop

Utility to teleoperator an omni-directional base in ROS.
C++
1
star
50

iai_perception

C++
1
star
51

iai_robot_drivers

Various robot driver packages forked and maintained by the IAI group, University Bremen, Germany.
C++
1
star
52

designator_integration

C++ and Lisp code for integrating designator communication (mainly serialization/deserialization) via ROS messages. Depends on designator_integration_msgs found in iai_common_msgs.
C++
1
star
53

grasping-learning-data-generator

Python
1
star
54

omni_pose_follower

Offers FollowJointTrajectoryAction and sends vel twist commands for an omni directional robot base
Python
1
star