Using a posture estimation algorithm, the posture angle (estimated value) is calculated based on the output from the cube's motion sensor (6-axis detection system). Because this posture angle is not a raw value from the motion sensor but a value calculated in the cube with the acceleration and angular velocity, it always contains a certain amount of error or drift.
This feature is disabled by default. It becomes operational only once enabled in Configuration - Posture angle detection settings.
|Properties||Write, Read, Notify|
Posture angle information can be requested by writing the following data. Once the cube receives a request, it makes a notification on the posture angle once.
The types of notifications are as follows
|Type of notification content||Definition|
|Notifications in Euler angles|
|Notifications in quaternions|
When the posture angle of the cube changes, this characteristic notifies the BLE central of this information. The notified information can also be obtained through read operations.
This characteristic is the same for Motion detection and Magnetic sensor. Since this information is also obtained, please also see Motion detection - Read operations / Notifications and Magnetic sensor - Read operations / Notifications when using this characteristic.
The following data can be obtained when the type of notification content is set to Euler angle notifications.
|2||Int16||Roll (X axis)|
|4||Int16||Pitch (Y axis)|
|6||Int16||Yaw (Z axis)|
The angle range is -179°(0xFF4D) to 180°(0x00B4) for roll and yaw, and -90°(0xFFA6) to 90°(0x005A) for pitch.
The rotation order is yaw (Z axis), pitch (Y axis), roll (X axis). The roll angle and pitch angle are 0° when the cube is placed horizontally on a surface with the wheel side on the bottom. The yaw angle is 0° when the cube is facing the direction it faced when it was turned on.
Because rotation around the Z axis (yaw angle in Euler angles) cannot be corrected using gravitational acceleration, errors will accumulate. The following is a concrete example of this effect.
- The yaw angle shifts by about 1° every few seconds even though the cube is not moving.
- The yaw angle shifts by several degrees when the cube rotates by one rotation with the Z axis as the central axis.
When the notification content type is set to notifications in quaternions, the following data can be obtained.
The value range is -10,000 to 10,000. In general, the quaternion range is -1 to 1. However, because notification data is expressed with the same precision as a 4-digit fixed point number, it is multiplied by 10,000 and expressed as an integer without a fractional component.