O'Reilly logo

OpenNI Cookbook by Soroush Falahati

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enumerating a list of connected devices

We learned how to initialize OpenNI and how to retrieve the version number of OpenNI using the openni::OpenNI::getVersion() method and how to ask OpenNI to read all modules and drivers by calling openni::OpenNI::initialize() in the last recipe. In this recipe we will get the list of all the connected devices, their hardware Uri (location), and product ID (that can be used to identify the device).

Getting ready

Create a project in Visual Studio 2010 and prepare it for working with OpenNI using the Creating a project in Visual Studio 2010 recipe in this chapter.

How to do it...

Open your project and then the project's main source code file. Locate this line:

int _tmain(int argc, _TCHAR* argv[])
{

Write the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required