如何从Android设备获取原始、俯仰和偏航数据?

huangapple go评论63阅读模式
英文:

How do I get the Raw, Pitch and Yaw data from an Android device?

问题

亲爱的女士们先生们,

我想为我的Android 11智能手机编写一个应用程序,该应用程序使用设备方向传感器。 API(我使用MAUI Visual Studio 2022)为我提供了一个四元数,描述了设备的方向。 这个四元数由三个旋转角度(偏航、俯仰、滚动)形成,具有四个分量(X、Y、Z、W)。 由于这种转换,不再可能确定原始角度(偏航、俯仰、滚动)。 但这正是我想要使用的! 我现在的问题是,如何获得偏航、俯仰和滚动角度?

顺祝商祺,
Deppenkaiser

英文:

Dear Ladies and Gentlemen,

I would like to write an app for my Android 11 smartphone that uses the sensor for the device orientation. The API (I use MAUI Visual Studio 2022) provides me with a quaternion that describes the orientation of the device. This quaternion is formed from the three rotation angles (Yaw, Pitch, Roll) and has four components (X, Y, Z, W). Due to this conversion, it is no longer possible to determine the original angles (Yaw, Pitch, Roll). But that's exactly what I want to use! My question now is, how do I get to the angles Yaw, Pitch and Roll?

Yours sincerely,
Deppenkaiser

答案1

得分: 0

这是解决方案,它运行良好:

https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

英文:

Here is the solution, it works fine:

https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

huangapple
  • 本文由 发表于 2023年6月22日 14:44:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76529200.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定