Introduction: Kinect Controlled Arms
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)
The purpose of this class to create something using the programing, 3D modeling and 3D printing skills we acquired throughout the semester. My idea for the final project was to repurpose my old Kinect sensor into something interesting. Using the Microsoft Kinect SDK, Processing, and a few libraries I got started experimenting on different things I could do with my Kinect and concluded with some cool looking Kinect controlled arms.
Things you will need:
Some software: Processing 2, Arduino, Simple Open NI, Microsoft Kinects SDK 1.7
4 servo motors
3D Printed Arms (optional)
Step 1: Downloads
First you will need to download the Arduino software:
Then Processing 2 (needs to be processing 2, won't work on processing 3):
Next is the Microsoft Kinect SDK (this contains the drivers you need to operate the Kinect):
Following that, you will need to download the Simple Open NI library for processing, and add it to the java libraries folder:
Step 2: Setting Up Your Arduino
The setup of the Arduino board is simple, just connect 4 servos to directly to the board as shown in the picture. For power, I used a bread board connected to the Arduino but depending on what servos you want to use you might need a different power supply.
Step 3: Writing Arduino Code
The coding is very simple, all that it needs to do is read the signal being sent by processing which is going to be 4 angles each corresponding to one of the joints.
1. Add the Servo library
2. Name the servos
3. Create local variables to store values sent by processing
4. Attach your servos
5. In the main loop check for signal
6. If the signal exists then start reading the data and writing it out to the servos
Step 4: Writing Processing Code
Writing the code for processing will be the most complicated part, the best way to start the code will be to use one of the examples included in the library, this way all the error messages and error contentions will already be in place. The one I started with was the “User” example; this will already include some of the tracking and user detection functions that we will need.
The first changes you will need to make is to add the “processing.serial.*” library at the top of your code, this will enable processing to talk to the Arduino.
Next you will need to add a way for processing to find the Arduino by adding the following in your set up:
Now the more complicated part. The first step on getting any measurements will be to get the different points that the Kinect will track, for this you will have to make points in the different joints that you will want to track. Here will show you the process for the right side; the left side is the same thing just change all the right for left.
Once you find these points you need to make vectors between them so that you can measure the angle in between them.
Then, find the angles in between them by using the lowing fiction and then entering your vectors as such.
Finally, send the four numbers that you calculated to the Arduino using the following and you are done with the processing code and the most complicated part.
Step 5: Modeling and Printing the Arms
This is mostly an optional step, you can use markers and rubber bands is you wish. The limiting factor for this design is going to be how much torque your servos will be able to put out here, I uploaded the files I used for my arms.
We have a be nice policy.
Please be positive and constructive.