AddLine() function, 303
AddShape() function, 304
Arduino
breadboard, 61
circuit diagram
description, 18
electronic symbols, 20
communication protocol
description, 2
electricity
AC/DC, 21
Joule’s law, 21
Ohms Law, 21
feedback
fritzing, 73
loop, 74
NITE callbacks, 76
photocell circuit, 72
setup() function, 74
hand tracking, 71
hardware
analog input pins, 7
boards, 6
digital pins, 7
prototyping shield, 9
pull-up resistors, 8
shields, 9
XBee shield, 9
history of, 2
IDE
Arduino Development Environment, 10–11
description, 10
installation
Linux, 3
Windows, 3
Kinect (see Kinect)
language
description, 12
fundamental data types, 13
loop() function, 13
setup() function, 12
variable declaration and initialization, 13–14
LED circuit, 66
parts, 62
processing sketch, 67
project
loop() function, 18
setup() function, 17
serial communication
description, 62
PWM, 65
structure, 1
testing
blink, 5
serial port, 4
checkSerial() function, 324
forward and backward pulses, 322
goTo(targetAngle), 323
loop() function, 323
potentiometer range, 322
processing code, 324
coordinate system transformations, 332
360-degree scan, 335
drawBoundingBox() function, 330
draw() function, 328
drawObjects() function, 329
drawPointCloud() function, 328
exportPly function, 335
full-color model, 325
keyPressed() function, 334
moveTable(float angle) function, 333
scan() function, 330
scanning process, 330
scanning space, 325
serialEvent() function, 333
setup() function, 327
turnTableAngle, 331
updateObject() function, 331, 333
servo integers, 321
updateServo() function, 324
Arduino LilyPad Simple board, 282
Arduino Nano, 135
Arduino programming
lampNumber, 149
loop() function, 149
setup() function, 149
Arduino serial sender, 287
BeginShape() function, 298
Biometric recognition
CSV file, 270
draw() function, 265
getDate() function, 266
imports and variable declaration, 261–262
reading and drawing the chart, 273–275
serialEvent() function, 276
Simple-OpenNI callbacks, 276–277
updateUserData() function, 267–268
updateUserHeight() function, 268–270
user recognition, 270
Biometric station
sending signal to processing, 254–256
biometric recognition
CSV file, 270
draw() function, 265
getDate() function, 266
imports and variable declaration, 261–262
reading and drawing the chart, 273–275
serialEvent() function, 276
Simple-OpenNI callbacks, 276–277
updateUserData() function, 267–268
updateUserHeight() function, 268–270
components, 244
hacking bathroom scale, 244–245
CAD. See Computer-aided design (CAD)
CalibrateFinger() function, 295
Callback functions
keyPressed() function, 305
serialEvent() function, 305
Simple-OpenNI callback functions, 306–307
Car() function, 220
Computer-aided design (CAD), 296
ControlCar() function, 236
CSV file, 270
Delta robot
base
assembled base, 349
L-bracket, 349
shape, 348
circuit
board finished, 359
cable tidy, 355
diagram, 357
materials, 358
paperclip trick, 360
power supply, 360
servos headers, 358
strip board, 358
definition, 345
deltaLeg class
draw() function, 370
getWorldCoordinates() function, 369
moveTo function, 369
variables, 368
vecRotY() and vecRotZ(), 369
DeltaRobot class
array, 364
base and effector, 364
constructor, 364
diagram, 363
drawEffector() function, 366
draw() method, 366
effector and gripper simulation, 366–368
initialization, 365
moveTo() method, 365
two distant cousins, 363
updateGrip() method, 368
variable, 363
effector, 350
gripper
assemble, 352
motor assembled, 352
parts, 350
servo and LEDs, 353
inverse kinematics
2D and 3D structure, 361
forward kinematics, 361
triangle theory, 362
legs
aluminum rod and ball, 346
articulation, 347
ball joint, 347
servo motors, 345
thigh connection, 346
mouse
driven robot simulation, 372
Import OpenGL, 371
orbit loop, 371
robot hanging
cantilevered MDF board, 353
setup, 355
Depth map
Kinect, 28
Display functions
drawData() function, 295
draw() function, 294
point() function, 295
switch() statement, 294
DisplayArray() function, 259
Distance sensor. See Proximity sensors
DrawArrow() function, 238
DrawCircle() function, 237
DrawClosestPoint() function, 304
DrawData() function, 295
Draw() function, 218–220, 235–236, 259, 265, 294, 297, 301–302
DrawHand() function, 237
DrawVector() function, 220
Enable/disable functions, 224
EndShape() function, 298
Finger-bending test, 289
FTDI Basic Breakout, 282
Gears connections
aluminum angle, 318
base assemble, 316
base element, 317
disc and gear assemble, 317
swivel, 317
turntable assemble, 319
Geometric classes
Line class, 298
GetCalibration() function, 296
GetDate() function, 266
GetNumber() function, 258
Glove interface, 279
GloveInterface class, 292
calibrating the interface, 295–296
Kinect, 28
connection to Arduino, 97
IDE. See Integrated development environment (IDE)
Imports and variable declaration, 261–262
Integrated development environment (IDE)
Arduino Development Environment, 10–11
description, 10
processing, 37
IR sensor. See Proximity sensors
KeyPressed() function, 305
Kinect
AC adapter, standard USB connection, 24
capabilities
depth map, 28
hand and skeleton tracking, 28
IR image, 28
RGB image, 27
description, 23
device, 23
drivers and frameworks
libfreenect drivers, 28
NITE, 30
history of
hacking, 25
official frameworks, 25
Project Natal, 25
networked puppet
network communication, 124–125
parts, 100
updateAngles() function, 122
web puppet, 99
processing
libraries, 41
purchase, 24
controlCar() function, 236
drawArrow() function, 238
drawCircle() function, 237
drawHand() function, 237
sendSerialData() function, 238, 239
textDisplay() function, 238
remote control
hacking, 78
hand tracking (see Hand tracking)
prototype shield assemble, 83–86
robot (see Robot, Kinect)
sensor
features, 26
positioning, 27
structured-light 3D scanning technique, 26
theory
light coding image to depth map conversion, 33
structured-light 3D scanning, 31–32
see also Remote-controlled vehicles
Kinect-controlled delta robot
Arduino code
C function word(), 382
in action, 383
integers and variables, 381
serial port output, 382
servo range, 383
boolean variable, 373
components and materials, 344
data sending
bitwise operations, 380
debugging, 381
grip rotation, 381
MSB and LSB, 380
sendSerialData() function, 380
displayText function, 377
draw() loop, 376
gripper
drawHand() function, 379
gizmo, 379
gripWidth and gripRot, 379
hand width tracking, 377
handVec position, 377
tilt tracking, 378
updateHand(), 378
hand gestures, 373
handOrigin PVector, 375
kinematics, 343
Motive Colloquies, 344
setup() function, 374
simulation and physical robot, 343
XvN Point Control callback function, 375
Lamp class, 150
description, 150
OOP
class declaration, 151
classes and objects, 150
constructor, 152
description, 150
field description, 151
new tab creation, 151
Language processing, 36
LED
communication protocol
serial communication
LilyPad XBee breakout board, 289–290
Line class, 298
Line() function, 298
Loop() function, 222–223, 229–230
Meshlab, Turntable scanner. See Point cloud; Surface reconstruction
Mood lamps
Arduino Nano, 135
circuit building
battery clip, 145
breakout headers, 139
components, 138
lamp circuit, 137
resistors, 139
RGB lamp test, 144
scratched strip board, 138
XBee and battery clip, 144
lamp class
description, 150
parts, 134
RGB
lamp, 133
lamp color change, 165
user control sketch, 154
data storage and retrieval, 160–161
description, 154
serial communication, 161
setup() function, 154
Simple-OpenNI callbacks, 163–164
userControl() function, 157–160
variable declaration, 154
XBee wireless module
description, 145
explorer connected to Arduino, 146
final circuit, 148
pencil holder, 148
strip board, with serial connections, 147
MovePoint() function, 303
Network communication
description, 124
internet, 125
Networked puppet, Kinect
applet
circuit building
Arduino board, 110
headers, 110
power and ground, 111
scratched strip board, 111
network communication
description, 124
internet, 125
shared canvas, 124
parts, 100
puppet
arm/legs assembled, 107
final stage, 107, 108, 117, 118
pieces, 106
servo angles, 116
servos, 106
sendSerialData() function, 130
servos
control technique, 103
object, 101
Servo.attach() function, 101–103
starting position setting, 115–118
skeleton tracking
description, 118
drawSkeleton() function, 119
stages
assembled stage, 104
puppet rotation servo, 104–105
updateAngles() function, 122
web puppet, 99
NITE functions
description, 56
Object-oriented programming (OOP)
accessor methods, 152
lamp class
class declaration, 151
classes and objects, 150
constructor, 152
description, 150
field description, 151
new tab creation, 151
OnPointCreate() function, 306
OnPointUpdate() function, 306
Point() function, 295
PrimeSense
description, 29
NITE, 30
PS1080 system, 33
Processing
Arduino IDE, 35
features of, 36
IDE, 37
installation, 36
Kinect
libraries, 41
language, 36
linear and two-dimensional arrays, 54
NITE functions
description, 56
Simple-OpenNI
description, 41
Windows installation, 42
sketch
description, 38
setup() function, 38
variables, 38
three-dimensional (3D)
camera control libraries, 50
cube, 47
description, 46
move functions, 230
setup() function, 229
Pulse width modulation (PWM)
description, 65
ReadChart() function, 265
Remote control, Kinect
channel gestures, 95
checkSpeed() function, 94
connecting to Arduino
breadboard, 81
prototype shield assembling, 83–86
relay circuit, 82
description, 77
drawHand function, 96
fTimes parameter, 92
hacking, 78
hand tracking and gesture recognition
connection to Arduino, 97
prototype shield
connections, 86
relays, 84
XnVPointControl, 92
Remote-controlled vehicles
components, 208
driving vehicle, 240
electrical motors and H-Bridge, 208–210
controlCar() function, 236
drawArrow() function, 238
drawCircle() function, 237
drawHand() function, 237
sendSerialData() function, 238, 239
textDisplay() function, 238
move functions, 230
setup() function, 229
testing the circuit
car() function, 220
drawVector() function, 220
enable/disable functions, 224
move functions, 224
sendSerial() function, 221
turning functions, 223
XBee Explorer for wireless communication, 230–232
RGB color model
applications, 135
description, 134
RGB lamp, 133
Robot, Kinect
circuit testing
Arduino library, 176
construction
arm, 170
assembled robot, 175
in action
at work, 205
description, 204
patterns, 205
installation visual, 167
point cloud
simulation
angle measuring program, 179–180
angles, 178
span, 178
working area, 179
tangible table interface
calibrated point cloud, 193
rotation equations, 188
setup, 186
uncalibrated point cloud, 187
virtual robot model
description, 198
draw() function method, 200–201
pointer projection, 200
work area, 201
SaveCalibration() function, 295
SendSerial() function, 221
SendSerialData() function, 238, 239
Serial communication
description, 62
PWM, 65
SerialEvent() function, 260, 276, 305
SetFingerValues() function, 293
SetPosition() function, 294
SetState() function, 258
Setter functions
setFingerValues(), 293
setPosition(), 294
setZeroPos(), 294
Setup() function, 218, 222, 234–235, 262–263, 300–301
SetZeroPos() function, 294
Simple-OpenNI
onPointCreate() function, 306
onPointUpdate() function, 306
description, 41
installation
Linux, 43
Windows, 42
description, 118
drawSkeleton() function, 119
Kinect, 28
SoftwareSerial library, 290
SparkFun Arduino prototype shield, 319–321
Structured-light 3D scanning technique
depth map, 32
IR coding image, 32
triangulation principles, 31
Surface reconstruction
blender, 342
color transfer and vertex geometry, 341
delete points, 339
3D triangular meshes, 338
mesh generation, 340
point cloud, 338
vertex colors transfer, 341
Switch() statement, 294
Tangible table interface
calibrated point cloud, 193
rotation equations, 188
setup, 186
uncalibrated point cloud, 187
TextDisplay() function, 238
Third dimensional (3D) modeling interface
Arduino LilyPad, 282
connecting the circuit, 284–286
geometric classes
Line class, 298
glove interface, 279
GloveInterface class, implementation
calibrating the interface, 295–296
main program
addLine() function, 303
addPoint() function, 303
addShape() function, 304
drawClosestPoint() function, 304
movePoint() function, 303
processing callback functions, 305
Simple-OpenNI callback functions, 306–307
unSelectAll() function, 303, 304
testing the circuit
Arduino serial sender, 287
processing glove data receiver, 287–289
wireless communication
LilyPad XBee breakout board, 289–290
SoftwareSerial library, 290
Third dimensional (3D) processing, 46
camera control libraries, 50
cube, 47
description, 46
Tracking
connection to Arduino, 97
Kinect
hand, 28
skeleton, 28
description, 118
drawSkeleton() function, 119
Turning functions, 223
Turntable scanner
assembled system, 309
building
parts, 313
prototype, 313
point cloud
exportPly function, 337
ply and obj extension, 335
surface reconstruction
blender, 342
color transfer and vertex geometry, 341
delete points, 339
3D triangular meshes, 338
mesh generation, 340
point cloud, 338
vertex colors transfer, 341
theory
diagram, 311
Kinect cameras, 310
Meshlab, 310
reconstruction, 311
requirements, 312
SLAM and RANSAC-based reconstruction, 310
SpinScan, 310
trigonometry, 311
see also Arduino code
UnSelectAll() function, 303, 304
UpdateUserData() function, 267–268
UpdateUserHeight() function, 268–270
User control sketch, mood lamps
data storage and retrieval, 160–161
description, 154
serial communication, 161
setup() function, 154
Simple-OpenNI callbacks, 163–164
userControl() function
variable declaration, 154
User interface, 263–265. See also Third dimensional (3D) modeling interface
User recognition, 270
Vertex() function, 298
Virtual robot model
description, 198
draw() function method, 200–201
pointer projection, 200
work area, 201
Voltage divider, 283
Wireless interface
LilyPad XBee breakout board, 289–290
SoftwareSerial library, 290
XBee Explorer for wireless communication, 230–232
XBee Explorer USB, 289
XBee wireless module
description, 145
explorer connected to Arduino, 146
final circuit, 148
pencil holder, 148
strip board, with serial connections, 147