3 Sensor Module - Tabjones/pacman_vision GitHub Wiki

Sensor Module


Sensor module provides a convenient way to provide point cloud streams to PaCMaN Vision basic node and it is always built and included regardless of the build configuration.

It provides four predefined point cloud subscribers to the most common topics providing point clouds (Kinect v1 and Kinect v2) along with a custom subscriber of your choice. The wanted subscriber can be modified at runtime via the Gui "Point Cloud Acquisition" tab, see the picture below.

Sensor Gui

The acquired stream of "raw" point clouds is then sent to PaCMaN Vision Basic Node for filtering and republishing and optionally used by other modules, if they are activated.

Kinect 2 Processor

Optionally Sensor module can be equipped with a built-in kinect 2 processor which processes a point cloud stream directly from Microsoft Kinect One (Kinect v2) by using LibFreenect2. This functionality removes the need of a subscriber to get a raw stream, or any additional processing packages like openni2_launch or kinect2_bridge, on the other hand it introduces another dependency to the build process. The processor can be dynamically enabled or disable with the Gui and, once built, it becomes an option the user can select, along with other subscribers.

If you are interested in building the processor follow the next section.

Kinect 2 Processor Build

First enable the corresponding CMake variable

PACV_BUILD_KINECT2 = 1

Either permanently, by modifying the top-level CMakeLists.txt of the project or temporary by passing command line argument to CMake (catkin_make -DPACV_BUILD_KINECT2=1)

Then you need LibFreenect2 as an additional dependency. To install it, follow their install instructions on the project page, which can be essentially resumed (for Ubuntu 14.04 with NVidia GPU) as:

sudo apt-get install build-essential libturbojpeg libjpeg-turbo8-dev libtool autoconf libudev-dev mesa-common-dev freeglut3-dev libxrandr-dev libxi-dev automake
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-add-repository ppa:floe/libusb 
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install nvidia-352-dev opencl-headers
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2/depends
sh install_ubuntu.sh
sudo dpkg -i libglfw3*_3.0.4-1_*.deb
cd .. && mkdir build && cd build
cmake ..
make && sudo make install

You can test if libfreenect2 is working by pluggin a Kinect One to your USB3 port and executing Protonect program inside the build/bin directory:

./bin/Protonect

If protonect is working, PaCMaN Vision Kinect2 processor should build without any issue.


Sensor Module Summary
Subscribers topics Subscribe to a stream of raw point clouds.
Sensor frame Tf Broadcasts the internal sensor reference frame transformation, if activated.
Kinect2 Processor functionality Create point clouds from Kinect2 internally.
dependency LibFreenect2