0

Before I get comments about the version of Simple-OpenNI that I'm using, I installed the only one that was on the Google Downloads page (v 1.96). I saw in another thread that I have to replace the line kinect.enableGesture() with kinect.startGesture(...) but then the other methods get messed up. I am following the book Arduino and Kinect Projects by Enrique Ramos Melgar, but that code doesn't seem to be up-to-date.

My affected code is as follows:

void setup() {
  kinect = new SimpleOpenNI(this);
  // enable mirror
  kinect.setMirror(true);
  // enable depth map, hands, and gestures
  kinect.enableDepth();
  kinect.enableGesture();
//  kinect.startGesture(SimpleOpenNI.GESTURE_WAVE);
  kinect.enableHands();
  // add focus gesture to start tracking
  kinect.addGesture("Wave");

  size(kinect.depthWidth(), kinect.depthHeight());
  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 9600);
}

void onRecognizeGesture(String strGesture, PVector idPosition, PVector endPosition) {
  kinect.removeGesture(strGesture);
  kinect.startTrackingHands(endPosition);
}

With the following errors:

The method enableGesture() is undefined for the type SimpleOpenNI
The method enableHands() is undefined for the type SimpleOpenNI
The method addGesture(String) is undefined for the type SimpleOpenNI
The method removeGesture(String) is undefined for the type SimpleOpenNI
The method startTrackingHands(PVector) is undefined for the type SimpleOpenNI
Eric Roch
  • 125
  • 2
  • 10

1 Answers1

1

Be sure to start your code with

import SimpleOpenNI.*;
SimpleOpenNI kinect;

Then, you use methods which don't exist anymore in SimpleOpenNI 1.96, check the doc. Since the big update of OpenNi/Nite, SimpleOpenNi is totally different:

enableHands() is now enableHand(),

addGesture(String) is now startGesture(int gesture),

removeGesture(String) is endGesture(int gesture),

startTrackingHands(PVector) is startTrackingHand(float[] pos)

Nite is not yet implemented in simpleOpenNi 1.96, so as far as I know, I think there are only 3 gestures you can use, GESTURE_CLICK, GESTURE_HAND_RAISE, GESTURE_WAVE

LGCreative
  • 26
  • 1
  • Thanks, my program runs now, but its not doing what I expect. Firstly, the IR image displayed during Draw loop seems to lag. Objects appear in the image even after having been moved. Also, it can't track my hand. I tried each of the 3 gestures, but it doesn't recognize any of them. could this be a problem with Nite? – Eric Roch Jan 23 '14 at 21:37
  • Nite is not implemented yet in SimpleOpenNi 1.96 (and I suspect it never will), so you sadly have to try with what there is for the moment, and I think these functions are quite different of what they were before.. The documentation is very poor, so I suggest you to look the "Hand" example (in Processing->File->Examples->ContributedLibraries->SimpleOpenNi->OpenNi) which provide an example (the user has to do the "Wave" gesture and then can draw with his hands). Otherwise, if you can, you should rather use the previous SimpleOpenNi version, where Nite was implemented. – LGCreative Jan 24 '14 at 16:38
  • Oh, I didn't know there were examples. Thank you. If Nite is not implemented in SimpleOpenNI, how will skeleton tracking work? – Eric Roch Jan 26 '14 at 23:46