Core Motion - 将局部欧拉角转换为另一个参考系

发布于 2024-10-13 08:29:18 字数 158 浏览 6 评论 0原文

我在将局部欧拉角转换为另一个参考系的角度时遇到了数学问题。假设我们有一部 iPhone 与车辆的轴线对齐,并且我想测量滚动角,那么 iPhone 的滚动角等于设备的滚动角。但如果 iPhone 倾斜安装怎么办?在这种情况下,我必须将局部欧拉角转换为另一个参考系(例如汽车)。有人可以指出我正确的方向吗?

I got a problem with the maths involved in converting local Euler angles into the angles of another reference system. Lets say we have an iPhone aligned with the axis of an vehicle and I want to measure the roll angle, then the roll angle of the iPhone equals the roll angle of the device. But what if the iPhone is mounted tilt. In this case I would have to convert the local Euler angles to another reference frame (e.g. the cars). Could someone please point me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

总以为 2024-10-20 08:29:18

我假设您想知道汽车的滚动情况,而不是电话。手机需要知道初始参考系。因此,假设您一开始就将手机与汽车对齐。然后按手机上的按钮。按下按钮后,您的代码中会存储从 CMDeviceMotion 获得的态度。

如果您想了解此后任何时刻汽车的滚动情况,请采用 CMDeviceMotion 的当前态度。然后对其调用 multiplyByInverseOfAttitude: ,并提供初始参考系作为参数。这将为您提供初始参考系和当前参考系之间的差异

如果从中获取滚动属性,它应该是汽车的滚动角。

I assume you want to know the roll of the car, rather than the phone. The phone needs to known the initial reference frame. So, suppose you line up the phone with the car at the start. Then press a button on the phone. At that button press, in your code store the attitude that you get from CMDeviceMotion.

If you want to know the roll of the car at any point after that, take the current attitude from CMDeviceMotion. Then call multiplyByInverseOfAttitude: on it, supplying the initial reference frame as parameter. That will give you the difference between the initial reference frame and the current one.

If you take the roll property from that, it should be the roll angle of the car.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文