1

オラ族、

 This might not be the right place for this. Let me know where I should post if I should post it elsewhere.

 I want to get the orientation of the device. I am thinking I can use something like this:

float fAngleX = atan2(acceleration.y, acceleration.z);
float fAngleY = atan2(acceleration.x, acceleration.z);
float fAngleZ = atan2(acceleration.y, acceleration.x);


 First, is my formula right?
 Second, is this going to work for the device? 
 Third, I'm going back and forth about filtering out gravity. Any thoughts?
 Lastly, is there a better way to get the devices orientation expressed as rotation for all three axis?

ありがとう

-isdi-

4

2 に答える 2

1

デバイスの回転をこのように 3 つの数値で表すのは、実際にはあいまいです。この種のことは、かなり混乱する可能性があります。ここから始めるのが最適だと思います: http://en.wikipedia.org/wiki/Euler_angles

于 2009-06-18T04:43:41.370 に答える
0

ベクトルを直接使用する方がおそらく簡単ですが、注意している限り角度を使用できます。

ほとんどの場合、フィルタリングを実行する必要があります。単純なローパスは素晴らしいですが、デバイスの向きであるため、重力を除外しないでください:)

于 2009-06-19T08:48:37.053 に答える