Конвертировать Android getOrientation вывод в поворот scipy - PullRequest
0 голосов
/ 27 марта 2020

Мне нужно преобразовать вывод из функции Android SensorManager.getOrientation в экземпляр scipy.spatial.transform.Rotation.

Это можно сделать с помощью конструктора from_euler, который принимает в качестве аргумента используемое соглашение об угле Эйлера и вектор angles.

R.as_euler(<convention_string>, <OUTPUT_FROM_GET_ORIENTATION>)

У меня есть подходящий вектор, вопрос:

  • Какое соглашение я должен использовать? Extrnisic / intrnsi c, какие оси?
  • я должен сделать и преобразовать на входном векторе (смена знака)

Я не могу получить эту информацию из Android API Документация по API гласит:

values[0]: Azimuth, angle of rotation about the -z axis. This value represents the angle between the device's y axis and the magnetic north pole. When facing north, this angle is 0, when facing south, this angle is π. Likewise, when facing east, this angle is π/2, and when facing west, this angle is -π/2. The range of values is -π to π.
values[1]: Pitch, angle of rotation about the x axis. This value represents the angle between a plane parallel to the device's screen and a plane parallel to the ground. Assuming that the bottom edge of the device faces the user and that the screen is face-up, tilting the top edge of the device toward the ground creates a positive pitch angle. The range of values is -π to π.
values[2]: Roll, angle of rotation about the y axis. This value represents the angle between a plane perpendicular to the device's screen and a plane perpendicular to the ground. Assuming that the bottom edge of the device faces the user and that the screen is face-up, tilting the left edge of the device toward the ground creates a positive roll angle. The range of values is -π/2 to π/2.

Является ли do c этой внешней осью c (внешними) осями или устройством? Другими словами, мои оси вращения вращаются вместе с устройством (таким образом, каждое вращение выполняется относительно уже повернутой оси) или оси постоянны?

Каков будет порядок вращения?

R_roll * R_pitch * R_azimuth*

...