我想访问Kinect加速度计来确定设备载体是否在移动。是否可以使用Kinect加速度计?如果是这样,我该怎么做? ofxKinect框架对此有用吗?
答案 0 :(得分:1)
microsoft SDK包含一种读取加速度计的方法:KinectSensor.AccelerometerGetCurrentReading
private void OnAllFramesReady(object sender, AllFramesReadyEventArgs e)
{
if (this.KinectSensor == null)
{
return;
}
Vector4 reading = this.KinectSensor.AccelerometerGetCurrentReading();
}
ofxKinect有一些看起来很有希望的方法:
/// get the XYZ accelerometer values
///
/// ... yes, the kinect has an accelerometer
/// raw axis values
ofPoint getRawAccel();
/// axis-based gravity adjusted accelerometer values
///
/// from libfreeenect:
///
/// as laid out via the accelerometer data sheet, which is available at
///
/// http://www.kionix.com/Product%20Sheets/KXSD9%20Product%20Brief.pdf
///
ofPoint getMksAccel();
/// get the current pitch (x axis) & roll (z axis) of the kinect in degrees
///
/// useful to correct the 3d scene based on the camera inclination
///
float getAccelPitch();
float getAccelRoll();