Working with Point Clouds using Kinect, ROS, OpenNI, and PCL

A Point Cloud is a data structure used to represent a collection of multidimensional points and is commonly used to represent 3D data. In a 3D Point Cloud, the points usually represent the x, y, and z geometric coordinates of an underlying sampled surface. When the color information is present, the Point Cloud becomes 4D.

Point Clouds can be acquired from hardware sensors (such as stereo cameras, 3D scanners, or time-of-flight cameras). It can be generated from a computer program synthetically. PCL supports the OpenNI 3D interfaces natively; thus it can acquire and process data from devices (such as Prime Sensor's 3D cameras, Microsoft Kinect, or Asus XTion PRO).

PCL will be installed along with the ROS indigo full desktop installation. Let's see how we can generate and visualize Point Cloud in RViz, a data visualization tool in ROS.

Opening device and Point Cloud generation

Open a new terminal and launch the ROS OpenNI driver along with the Point Cloud generator nodes using the following command:

roslaunch openni_launch openni.launch

This command will activate the Kinect driver and process the raw data into convenient outputs like Point Cloud.

We will use RViz 3D visualization tool to view Point Clouds.

The following command will start the RViz tool:

$ rosrun rviz rviz

Set the RViz options for Fixed Frame (at the top of the Displays panel under Global Options) to camera_link.

On the left-hand side of the RViz panel, click on the Add button and choose the PointCloud2 display option. Set its topic to /camera/depth/points.

Change Color Transformer of PointCloud2 to AxisColor.

The following figure shows a screenshot of RViz Point Cloud data. In this screenshot, the near object is marked in red and the far object is marked in violet and blue. The object in front of Kinect is represented as cylinder and cube:

Opening device and Point Cloud generation

Point Cloud of a robot

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.235.79