计算沿y轴方向(角度测量)的变化率? [英] Compute rate of change of orientation(angular measurement) along y axis?

查看:333
本文介绍了计算沿y轴方向(角度测量)的变化率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想计算iPhone沿y轴方向的变化率. 1.首先,我需要将参考定义为y轴, 2.然后从定义的参考中测量方向的变化率(角度测量).

I want to compute rate of change of orientation of the iPhone along y axis. 1. Initially i need to define the reference as y axis, 2. Then measure the rate of change of orientation(angular measurement) from the defined reference.

CMAttitude是否提供可靠的角度测量来实现这一目标?或者我可以使用旋转矩阵或整合陀螺仪数据(我实现了此方法,但由于陀螺仪的漂移而无法使用).因此,请向我建议一种可靠的方法来完成此任务?

Does CMAttitude provides a reliable angular measurements to implement this? Or Can i use rotational matrix or integrate gyroscope data(I implement this method, but it's not going to work due to the drift of the gyroscope). So please suggest me a reliable method to get this done?

提前谢谢!

推荐答案

首先,需要澄清一下:旋转速率不是从"任何轴测量的,而是围绕"轴的测量.您不必提供初始参考系,因为您只是担心随着时间的推移会发生变化.

First, just to clarify: Rotation rates are not measured "from" any axis, they're measured "around" an axis. You don't need to provide an initial reference frame, since you're just worried about change over time.

无论如何,最好的方法是

Anyways, The best you'll get is CMDeviceMotion's rotationRate property, about which the docs say:

CMRotationRate结构包含指定设备速率的数据 绕三个轴旋转.此属性的值包含一个 测量的陀螺仪数据已被Core消除了偏差 运动算法.

A CMRotationRate structure contains data specifying the device’s rate of rotation around three axes. The value of this property contains a measurement of gyroscope data whose bias has been removed by Core Motion algorithms.

这是说,它集成了来自多个源(加速度计)的传感器数据,试图消除读数中的陀螺仪漂移,这与

It's saying that it integrates sensor data from multiple sources (Accelerometer) in an attempt to remove the gyro drift from the readings, as opposed to the CMGyroData class, about which the docs say:

此属性可以测量设备的旋转速度 绕三个轴.而此属性会提供来自 陀螺仪,CMDeviceMotion的同名属性提供了一个 CMRotationRate结构测量陀螺仪数据,其偏差为 被Core Motion算法删除.

This property yields a measurement of the device’s rate of rotation around three axes. Whereas this property gives the raw data from the gyroscope, the identically named property of CMDeviceMotion gives a CMRotationRate structure measuring gyroscope data whose bias has been removed by Core Motion algorithms.

从这些参考文献中得出的结论是,如果您想要最准确的转速数据,则应使用类似以下内容的东西:

The takeaway from those references is that, if you want the most accurate rotation rate data, you should use something like:

CMMotionManager* manager = [[CMMotionManager alloc] init];
[manager startDeviceMotionUpdates];

// Later, in some other scope...
double rotationAroundY = [[manager deviceMotion] rotationRate].y;

这篇关于计算沿y轴方向(角度测量)的变化率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆