O'Reilly logo

Making Things See by Greg Borenstein

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

Chapter 6

Complete Forward Kinematics Example

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 ...

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