Programming Kinect with Python using ROS, OpenCV, and OpenNI
Let's look at how we can interface and work with the Kinect sensor in ROS. ROS is bundled with the OpenNI driver, which can fetch the RGB and depth image of Kinect. The OpenNI and OpenNI 2 package in ROS can be used for interfacing with Microsoft Kinect, Primesense Carmine, Asus Xtion Pro, and Pro Live.
When we install ROS's openni_launch
package, it will also install its dependent packages, such as openni_camera
. The openni_camera
package is the Kinect driver that publishes raw data and sensor information, whereas the openni_launch
package contains ROS launch files. These launch files launch multiple nodes at a time and publish data such as the raw depth, RGB, and IR images, and the point cloud.
How to launch the OpenNI driver
You can connect the Kinect sensor to your computer using a USB interface and make sure it is detected on your PC using the dmesg
command in the terminal. After setting up Kinect, we can start ROS's OpenNI driver...