xcode iPhone 捕捉动作的 Roll、Pitch 和 Yaw 的最大值和最小值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9143161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:12:42  来源:igfitidea点击:

Max and Min Values of Roll, Pitch and Yaw of the capture motion of iPhone

iphonexcodemotion

提问by Joe

This proram is to detect values of the gyroscope (Roll, Pitch and Yaw).

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

Please i want to know what is the max and Min values of Roll, Pitch and Yaw. (Values of Gyroscope)

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



Initialising :

初始化:

[[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];

[[UIAccelerometer sharedAccelerometer] setUpdateInterval:0.2f];

[[UIAccelerometer sharedAccelerometer] setDelegate:self];

运动管理器 = [[CMMotionManager 分配] init];

运动管理器.加速度计更新间隔= 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 ?

motionManager.deviceMotion.attitude.roll // 最大值和最小值?

motionManager.deviceMotion.attitude.yaw // 最大值和最小值?

motionManager.deviceMotion.attitude.Pitch // 最大值和最小值?

And how to pass to the Values -> Degree ?

以及如何传递给 Values -> Degree ?

Thanks

谢谢

回答by Joe

This is the solution :

这是解决方案:

if you put

如果你把

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

Then the values in Degree :

然后是 degree 中的值:

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

So :

所以 :

Vroll Min : -180°, Max : 180°

Vyaw Min : -180°, Max : 180°

Vpitch Min : -90°, Max : 90°

Vroll 最小值:-180°,最大值:180°

偏航最小值:-180°,最大值:180°

Vpitch 最小值:-90°,最大值:90°

Thanks stackoverflow :)

谢谢stackoverflow :)