Created
December 7, 2018 17:41
-
-
Save jdiez17/dcba17ef2907441b811503a99274beeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [yaw pitch roll] = quat2eul(q) | |
qs = q(1); | |
qx = q(2); | |
qy = q(3); | |
qz = q(4); | |
yaw = atan(2 * (qs * qx + qy * qz) / (1 - 2 * (qx^2 + qy^2))); | |
pitch = asin(2 * (qs * qy - qz * qx)); | |
roll = atan(2 * (qs * qz + qx * qy) / (1 - 2 * (qy^2 + qz^2))); | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment