英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论