The quat->radian ‘angle’ chop appears broken in that I’d not expect to see a value larger than PI, yet with continuous smooth quaternion input all but isolated to Y rotation, ‘y’ jumps from 1.36 to -4.48 (basically adding pi) instead of, say, going negative and staying well under pi.

as a result, we wrote our own python script to convert (below), and it behaves better.

import math

def yaw(q0,q1,q2,q3):

return math.atan((2*(q0*q1)+(q3*q2))/(q3**2-q2**2-q1**2+q0**2))

def pitch(q0,q1,q2,q3):

return math.asin(-2*(q0*q2-q1*q3))

def roll(q0,q1,q2,q3):

return atan((2*(q1*q2+q0*q3)/(q3**2+q2**2-q1**2-q0**2)))