gpt4 book ai didi

iphone - iPhone捕捉运动的Roll、Pitch、Yaw的最大值和最小值

转载 作者:行者123 更新时间:2023-12-03 19:09:11 34 4
gpt4 key购买 nike

该程序用于检测陀螺仪的值(Roll、Pitch 和 Yaw)。

请问我想知道横滚、俯仰和偏航的最大值和最小值是多少。 (陀螺仪数值)

<小时/>

初始化:

[[UIAccelerometer sharedAccelerometer] setUpdateInterval:0.2f];

[[UIAccelerometer sharedAccelerometer] setDelegate:self];

motionManager = [[CMMotionManager alloc] init];

motionManager.accelerometerUpdateInterval = 0.01; // 100Hz

motionManager.deviceMotionUpdateInterval = 0.01; // 100Hz

[motionManager startDeviceMotionUpdates];

<小时/>

motionManager.deviceMotion.attitude.roll // Max and Min Value ?

motionManager.deviceMotion.attitude.yaw // Max and Min Value ?

motionManager.deviceMotion.attitude.Pitch // Max and Min Value ?

如何传递到 Values -> Degree ?

谢谢

最佳答案

这是解决方案:

如果你放

#define degrees(x) (180 * x / M_PI)

然后是 Degree 的值:

Vroll = degrees(motionManager.deviceMotion.attitude.roll);
Vyaw = degrees(motionManager.deviceMotion.attitude.yaw);
Vpitch= degrees(motionManager.deviceMotion.attitude.pitch);

所以:

Vroll Min : -180°, Max : 180°

Vyaw Min : -180°, Max : 180°

Vpitch Min : -90°, Max : 90°

谢谢 stackoverflow :)

关于iphone - iPhone捕捉运动的Roll、Pitch、Yaw的最大值和最小值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9143161/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com