0% found this document useful (0 votes)
161 views6 pages

Kinect Robotics Programming Guide

This document provides a tutorial on how to use the Kinect sensor to control a robot during autonomous mode. It discusses installing the necessary Kinect drivers, describes the Kinect function blocks available in the WPI Robotics library for accessing Kinect data, and provides an example program that uses hand position data from the Kinect to drive a tank drive robot based on different hand detection states.

Uploaded by

Carlos Vaquera
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views6 pages

Kinect Robotics Programming Guide

This document provides a tutorial on how to use the Kinect sensor to control a robot during autonomous mode. It discusses installing the necessary Kinect drivers, describes the Kinect function blocks available in the WPI Robotics library for accessing Kinect data, and provides an example program that uses hand position data from the Kinect to drive a tank drive robot based on different hand detection states.

Uploaded by

Carlos Vaquera
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Kinect Tutorial

Contents 1. 2. 3. 4. 5. Kinect Setup Kinect Function Blocks Programming the Robot to use the Kinect as a Controller Conclusions Additional Resources

Kinect Setup

To setup the Kinect for use with the driver station the Windows drivers will need to be installed. These are available from: http://kinectforwindows.org/. In addition to the Windows drivers the
Kinect Server will need to be installed. This is available from FIRST Forge. When both of these are correctly installed and the Kinect is plugged in to the computer the LED on the Diagnostics page of the Driver Station should turn green. Kinect Function Blocks The WPI Robotics library provides several functions for getting data from the Kinect for use in Autonomous mode. The Get Kinect Vertices command is used to get all the information about the location of the current position of the Kinect Skeleton. You can use the Skeleton Index Control along with an Index Array block to get the coordinates of specific parts of the skeleton.

The Get Kinect Extra VI is used to return status information about the Kinect tracking state. You can use this VI to get information on how well the Kinect is tracking the human player. You can use this VI to get information about the status of each joint in the skeleton. For example you can get information about whether the right hand is being tracked, implicitly inferred, or not visible to the sensor.

The Get Kinect Header VI lets you get general information about the status of the Kinect. It returns data about the version of the Kinect driver as well as the number of players the Kinect detects. This VI also gives information for the Kinect believes the floor is and the direction of the gravity normal.

Programming the Robot to use the Kinect as a Controller The Kinect can be used as a controller to direct the Robot in Autonomous mode. In this tutorial we will go through using the Kinect to drive the robot. If you have not already, set up your motors in Begin.vi and Autonomous Independent.VI. More information on this can be found in the Basic Motor Control Tutorial. For this example we will be using a 2 Motor Tank Drive Robot. The following code initializes the Robot Drive Reference and should be included in Begin.vi

Add a Get Motor Reference VI to get the reference of the drive motors we created. Add a while loop to the VI. We will put all of our autonomous control code inside this loop.

Add a Kinect Get Extra VI to the block diagram. This VI will be used to determine if the left and right hand are visible and being tracked by the Kinect. Use an Index Array block on the Skeleton Tracking State output of the Kinect Get Extra VI to get the state of the left and right hand. This control can be

found on the WPI Driver Station palette for the Kinect.

If both hands are being tracked we want to go into a case of the case structure where we will set the motors to drive forward.

In the case for both hands being tracked add code which sets the motor speed to how far the hands are apart in the x dimension. The x dimension of each hand is gotten by using the Kinect Get Vertices VI.

Add a condition to the case structure to handle when neither hand is seen. In this mode the motors should be stopped.

Add another case to handle when only the left hand is seen. In this state the robot should perform a left hand turn.

Add a final case to handle when only the right hand is seen. In this mode the robot should perform a right turn.

Conclusion Congratulations, you have now used the Kinect API to program a simple driving control for use in Autonomous mode. If you have suggestions on how to improve this tutorial, please add them to the comments section below so that we can continue to improve our documentation and training resources.

You might also like