My project uses the Microsoft Kinect for the Xbox 360 and a human biped robot. I always see companies making humans able to control biped robots, but they always make the user wear sensors. So I thought, why not create a cheap prototype of being able to control a biped robot, but just standing in front of a camera and moving around? So that't exactly what I did!
This Instructable assumes you have basic knowledge of how to use and Arduino.
Please vote this for the Arduino Contest! :)
Step 1: Materials
I warn you beforehand this project does require you to invest about $800 or more with of electronics, based on what you make or may not already have. Below is the list of items that I used.
Feel free to buy parts 2-6 any where you would like.
1. RoboBrothers RoboPhilo Humanoid Robot Kit
- Prebuilt model
- If you choose to buy this model then just follow the online instructions on how to assemble it.
2. Microsoft Kinect 360 Sensor
3. Microsoft Kinect USB Adapter
4. Arduino Uno
5. Male to male wires
Step 2: Setting Up Hardware
This step will a take some time to complete. I will assume you are using the Robophilio robot kit for this Instructable, but the same concept will work for any robot.
1. Start by gutting out the Robophilio and taking out its stock circuit board. Use Philips screws to open up the back of it. For any other robot just take out its main controller board. Remember that these robots have an insane number of servos. The Robophilio, or any humanoid robot, comes with a data sheet which shows you where each servo is connected on the stock circuit board. When you take each servo cable out, MAKE SURE you remember WHICH servo that cable belongs to, otherwise you will have to go through a ton of testing to see which cable goes to which servo.
I would suggest using some system to label each servo cable as it is taken out. I simply used masking tape. I taped a small piece onto each cable and labeled it with the servo it belonged too. So for the left shoulder servo I wrote "L Shoulder",
Next take out the battery that is in the front of the robot (hidden in the crotch area of the robot).
2. Start by taking a small breadboard and attaching the battery leads, positive and negative, to the breadboard. Then connect all the servo cable positives to the battery positive power line. Do the same for ground. Then connect the servo cable signal lines to the appropriate Arduino pins. The schematic diagram shows this all. You can also take a look at the code to see which servo is attached to which Arduino pin.
If you have the Robophilio: The code I have given already handles the degrees for each servo and its min/max.
If you DON'T have the Robophilio then start by also creating the basic circuit as described above. Once you have done that you will manually need to test each servo by assigning it values to figure out its min/max. I would suggest moving the servos in increments of 5 degrees to figure out exact values. This is a pretty basic step and I won't go over it in too much detail.
3. Now that you have everything done for the robot side. Connect your Microsoft Kinect to your computer and make sure you have all the proper drivers you need for it to work.
Step 3: Setting Up Software
For this project you will need the Arduino IDE and the Processing IDE v 2.2.1. Go ahead and download both programs using the linked below. For processing make sure you scroll down a little, under the "Stable Releases" section choose version 2.2.1
If you have Windows you need to install the KinectSDK.
Once you have both of these installed we will need to install the libraries for using the Kinect with Processing.
1. Go to the menu: Sketch-> Import Library...-> Add Library...
2. Select and install SimpleOpenNI
3. Restart Processing
Follow the above three steps to make sure the Processing Serial library is also installed.
Now all of the hardware and software should be set up at this point.
Step 4: Programming
1. Go ahead and open up the Processing IDE and load the following sketch "motionHandlerTest.pde". Make sure your Kinect 360 Sensor is attached with working drivers. Go ahead and run the sketch. If no window pops up then cancel and rerun it. If a window pops up and its static/black/no movement, then simply close the program and rerun it. Usually it takes two runs when you FIRST plug in the Kinect.
2. By this point you should be seeing the video feed of your Kinect on your screen. Go ahead and plug in your Arduino connected to your robot to your laptop. Using the link right below this sketch and load up the program.
3.Go ahead and start moving around, just make sure you stand in form with the blue lines from the processing window.