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 ...
Get Making Things See now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.