January 2012
Beginner to intermediate
440 pages
17h 11m
English
Example A-7 presents the complete Processing sketch for forward kinematics. It calculates both joint angles and then sends the results over serial to the Arduino.
Example A-7. forward_kinematics_serial.pde
import SimpleOpenNI.*; SimpleOpenNI kinect; // import the processing serial library import processing.serial.*; // and declare an object for our serial port Serial port; void setup() { size(640, 480); kinect = new SimpleOpenNI(this); kinect.enableDepth(); kinect.enableUser(SimpleOpenNI.SKEL_PROFILE_ALL); kinect.setMirror(true); // Get the name of the first serial port // where we assume the Arduino is connected. // If it doesn't work, examine the output of // the println, and replace 0 with the correct ...