QRotationReading#

The QRotationReading class represents one reading from the rotation sensor. More

Inheritance diagram of PySide6.QtSensors.QRotationReading

Synopsis#

Properties#

  • x - The rotation around the x axis

  • y - The rotation around the y axis

  • z - The rotation around the z axis

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QRotationReading Units#

The rotation reading contains 3 angles, measured in degrees that define the orientation of the device in three-dimensional space. These angles are similar to yaw, pitch and roll but are defined using only right hand rotation with axes as defined by the right hand cartesian coordinate system.

../../_images/sensors-rotation.jpg

The three angles are applied to the device in the following order.

  • Right-handed rotation z (-180, 180]. Starting from the y-axis and incrementing in the counter-clockwise direction.

  • Right-handed rotation x [-90, 90]. Starting from the new (once-rotated) y-axis and incrementing towards the z-axis.

  • Right-handed rotation y (-180, 180]. Starting from the new (twice-rotated) z-axis and incrementing towards the x-axis.

Here is a visualization showing the order in which angles are applied.

../../_images/sensors-rotation-anim.gif

The 0 point for the z angle is defined as a fixed, external entity and is device-specific. While magnetic North is typically used as this reference point it may not be. Do not attempt to compare values for the z angle between devices or even on the same device if it has moved a significant distance.

If the device cannot detect a fixed, external entity the z angle will always be 0 and the hasZ property will be set to false.

The 0 point for the x and y angles are defined as when the x and y axes of the device are oriented towards the horizon. Here is an example of how the x value will change with device movement.

../../_images/sensors-rotation2.jpg

Here is an example of how the y value will change with device movement.

../../_images/sensors-rotation3.jpg

Note that when x is 90 or -90, values for z and y achieve rotation around the same axis (due to the order of operations). In this case the y rotation will be 0.

class PySide6.QtSensors.QRotationReading(parent)#
Parameters:

parentPySide6.QtCore.QObject

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtSensors.QRotationReading.x: float#

This property holds the rotation around the x axis..

Measured as degrees.

See also

QRotationReading Units

Access functions:
  • x ()

property PᅟySide6.QtSensors.QRotationReading.y: float#

This property holds the rotation around the y axis..

Measured as degrees.

See also

QRotationReading Units

Access functions:
  • y ()

property PᅟySide6.QtSensors.QRotationReading.z: float#

This property holds the rotation around the z axis..

Measured as degrees.

See also

QRotationReading Units

Access functions:
  • z ()

PySide6.QtSensors.QRotationReading.setFromEuler(x, y, z)#
Parameters:
  • x – float

  • y – float

  • z – float

Sets the rotation from three euler angles.

This is to be called from the backend.

The angles are measured in degrees. The order of the rotations matters, as first the z rotation is applied, then the x rotation and finally the y rotation.

PySide6.QtSensors.QRotationReading.x()#
Return type:

float

Getter of property x .

PySide6.QtSensors.QRotationReading.y()#
Return type:

float

Getter of property y .

PySide6.QtSensors.QRotationReading.z()#
Return type:

float

Getter of property z .