Receiving Kinect Joint Position Data via oscP5
in
Contributed Library Questions
•
10 months ago
Hi there,
I'm currently trying to send data from a Processing sketch using SimpleOpenNI to a sketch using an OpenAL library, and I followed these instructions to send Kinect data:
http://learning.codasign.com/index.php?title=Sending_Kinect_Joint_Position_Data_Via_OSC
My only issue is I'm not sure what to put in the receiving sketch to get the two communicating.
Here's the OSC code that's in my Kinect sketch, the one sending data:
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;
void setup() {
oscP5 = new OscP5(this, 5001);
myRemoteLocation = new NetAddress("127.0.0.1", 5001);
}
void sendBodyCenter(int userId) {
OscMessage myMessage = new OscMessage("/kinect");
myMessage.add(bodyCenter.x);
myMessage.add(bodyCenter.y);
myMessage.add(bodyCenter.z);
oscP5.send(myMessage, myRemoteLocation);
}
In my receiving sketch I have this:
void oscEvent(OscMessage theOscMessage) {
// get the first value as an integer
float firstValue = theOscMessage.get(0).floatValue();
// get the second value as a float
float secondValue = theOscMessage.get(1).floatValue();
// get the third value as a string
float thirdValue = theOscMessage.get(2).floatValue();
// print out the message
print("OSC Message Received: ");
print(theOscMessage.addrPattern() + " ");
println(firstValue + " " + secondValue + " " + thirdValue);
}
I want the bodyCenter coordinates to be constantly sending to the audio sketch. Any tips? Or anything I'm doing incorrectly?
Thanks!
1