MPU6050 Tait–Bryan angles #18

Closed
etoestja opened this Issue Jun 27, 2013 · 2 comments

Projects

None yet

1 participant

@etoestja
Member

http://en.wikipedia.org/wiki/Euler_angles
http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

// yaw: (about Z axis)
data[0] = atan2(2 * (q->w * q->z + q->x * q->y), 1 - 2 * (q->y * q->y + q->z * q->z));
// pitch: (nose up/down, about Y axis)
data[1] = asin(2 * (q->w * q->y - q->z * q->x));
// roll: (tilt left/right, about X axis)
data[2] = atan2(2 * (q->w * q->x + q->y * q->z), 1 - 2 * (q->x * q->x + q->y * q->y));
@etoestja
Member

Нам нужны именно ZYX, как на картинке http://commons.wikimedia.org/wiki/Tait-Bryan_angles

@etoestja
Member

ОК, они работают.

@etoestja etoestja closed this Aug 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment