简体   繁体   English

使用kinect(libfreenect)加速度计数据

[英]Working with kinect (libfreenect) accelerometer data

I'm accessing the Kinect Accelerometer in c++ via openFrameworks and ofxKinect and am having some issues with certain angles. 我正在通过openFrameworksofxKinect以c ++访问Kinect Accelerometer,并且在某些角度遇到了一些问题。 If I pitch the kinect 90 degrees downwards I get nan values. 如果我将kinect向下倾斜90度,我会得到nan值。 I had a look at the getAccelPitch() method and this kind of makes sense since asin will return 0 when there will be values greater than 9.80665 divided by 10.1/9.80665. 我看了一下getAccelPitch()方法,这种方法很有意义,因为当值大于9.80665除以10.1 / 9.80665时, asin将返回0。

The main problem though is after I pitch the device 90 degrees, the roll doesn't seem reliable(doesn't seem change much). 然而,主要的问题是在我将设备倾斜90度后,滚动似乎不可靠(似乎没有太大变化)。 In my setup I will need to have the device pitched 90 degrees but also know it's new roll. 在我的设置中,我需要让设备倾斜90度,但也知道它是新卷。

Any hints,tips on how I may do that ? 关于我如何做到这一点的任何提示,提示? Is there an easy way to get the data to draw the kinect's orientation with 3 lines(axes). 有没有一种简单的方法可以让数据用3条线(轴)绘制kinect的方向。

I'm trying to detect orientations like these: 我正试图检测这样的方向: K1

K2

K3

K4

The problem is that you are using Euler angles (roll, pitch and yaw). 问题是你正在使用欧拉角 (滚动,俯仰和偏航)。

Euler angles are evil and they screw up the stability of your app, see for example 欧拉角是邪恶的,它们搞砸了你应用的稳定性,例如

They are not useful for interpolation either. 它们也不适用于插值

A solution is to use rotation matrices instead. 解决方案是使用旋转矩阵。 A tutorial on rotation matrices is given in the 关于旋转矩阵的教程在下面给出

Direction Cosine Matrix IMU: Theory 方向余弦矩阵IMU:理论

manuscript. 手稿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM