Configuring TurtleBot and installing the 3D sensor software

There are minor but important environmental variables and software that are needed for the TurtleBot based on your selection of 3D sensors. We have attached a Kinect Xbox 360 sensor to our TurtleBot, but we will provide instructions to configure each of the 3D sensors mentioned in this chapter. These environmental variables are used by the ROS launch files to launch the correct camera drivers. In ROS Indigo, the Kinect and ASUS sensors are supported by different camera drivers, as described in the following sections.

Kinect

The environmental variables for the Kinect sensors are as follows:

export KINECT_DRIVER=freenect
export TURTLEBOT_3D_SENSOR=kinect

These variables should be added to the ~/.bashrc files of both the TurtleBot and the remote computer.

Kinect also requires a special driver for the camera to be downloaded from GitHub. Type the following commands in a terminal window on the TurtleBot netbook:

$ mkdir ~/kinectdriver
$ cd ~/kinectdriver
$ git clone https://github.com/avin2/SensorKinect
$ cd SensorKinect/Bin/
$ tar xvjf SensorKinect093-Bin-Linux-x64-v5.1.2.1.tar.bz2
$ cd Sensor-Bin-Linux-x64-v5.1.2.1/
$ sudo ./install.sh

If your netbook has an 86-bit processor, change the fifth and sixth commands, as follows:

$ tar xvjf SensorKinect093-Bin-Linux-x86-v5.1.2.1.tar.bz2
$ cd Sensor-Bin-Linux-x86-v5.1.2.1/

Libfreenect is an open source library that provides an interface for Microsoft Kinect to be used with Linux, Windows, and Mac. ROS packages for Kinect 360 and Kinect One can be installed with the following commands:

$ sudo apt-get install libfreenect-dev
$ sudo apt-get install ros-indigo-freenect*

This command installs the following packages:

  • freeglut3-dev
  • ros-indigo-depth-image-proc
  • ros-indigo-eigen-conversions
  • ros-indigo-freenect-camera
  • ros-indigo-freenect-launch
  • ros-indigo-freenect-stack
  • ros-indigo-image-proc
  • ros-indigo-libfreenect
  • ros-indigo-rgbd-launch

Kinect for Windows v2 requires a different camera driver named libfreenect2 and the iai_kinect2 software toolkit. The installation of this software is described in Chapter 9, Flying a Mission with Crazyflie.

Note

For the latest information on the ROS freenect software, check the ROS wiki at http://wiki.ros.org/freenect_launch. Maintainers of the freenect software utilize as much of the OpenNi software as possible to preserve compatibility.

ASUS and PrimeSense

The TurtleBot software for ROS Indigo is configured to working with the ASUS Xtion PRO as the default configuration. It is possible to add the following environmental variable:

export TURTLEBOT_3D_SENSOR=asus_xtion_pro

although (at this time) it is not necessary.

The openni2_camera ROS package supports the ASUS Xtion, Xtion PRO, and the PrimeSense 1.08 and 1.09 cameras. The openni2_camera package does not support any Kinect devices. This package provides drivers for the cameras to publish raw rgb, depth, and infrared image streams.

ROS packages for OpenNi2 can be installed with the following command:

$ sudo apt-get install ros-indigo-openni2*

Note

For the latest information on the ROS OpenNi2 software, check the ROS wiki at http://wiki.ros.org/openni2_launch.

Camera software structure

The freenect_camera and openni_camera packages are ROS nodelet packages used to streamline the processing of the enormous quantity of image data. Initially, a nodelet manager is launched and then nodelets are added to the manager. The default 3D sensor data type for the freenect/openni nodelet processing is depth_image. The camera driver software publishes the depth_image message streams. These messages can be converted to point cloud data types to make them more usable for Point Cloud Library (PCL) algorithms. Basic navigation operations on TurtleBot use depth_images for faster processing. Launching nodelets to handle the conversion of raw depth, rgb, and IR data streams to the depth_image, disparity_image, and registered_point_cloud messages is the method of handling all the conversions in one process. Nodelets allow multiple algorithms to be running in a single process without creating multiple copies of the data when messages are passed between processes.

The depthimage_to_laserscan package uses the depth_image data to create sensor_msgs/LaserScan in order to utilize more processing power to generate maps. For more complex applications, converting depth_images to the point cloud format offers the advantage of using the PCL algorithms.

Defining terms

The important terms that are used in configuring TurtleBot are as follows:

Depth cloud: Depth cloud is another name for the depth_image produced by the 3D sensor, such as the Kinect, ASUS, and PrimeSense depth cameras.

Point cloud: A point cloud is a set of points with x, y, and z coordinates that represent the surface of an object.

Registered DepthCloud and Registered PointCloud: These terms are used by ROS for special DepthCloud or PointCloud data colored by the rgb image data. These data streams are available when the depth_registration option is selected (set to true).

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

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