w = 0.7071
x = 0
y = 0
z = 0.7071
heading = atan2(2*qy*qw-2*qx*qz , 1 - 2*qy2 - 2*qz2)
attitude = asin(2*qx*qy + 2*qz*qw)
bank = atan2(2*qx*qw-2*qy*qz , 1 - 2*qx2 - 2*qz2)
heading = atan2(0 , 0)
attitude = asin(1)
bank = atan2(0 , 0)
this is at singularity (straight up) atan2(0,0) is not useful, so instead,
use:
heading = 2 * atan2(x,w) =0
bank = 0
heading = 0
attitude = 90 degrees
bank = 0 |
w = 0.5
x = 0.5
y = 0.5
z = 0.5
heading = atan2(2*qy*qw-2*qx*qz , 1 - 2*qy2 - 2*qz2)
attitude = asin(2*qx*qy + 2*qz*qw)
bank = atan2(2*qx*qw-2*qy*qz , 1 - 2*qx2 - 2*qz2)
heading = atan2(0 , 0)
attitude = asin(1)
bank = atan2(0 , 0)
this is at singularity (straight up) atan2(0,0)
is not useful, so instead, use:
heading = 2 * atan2(x,w)
= 2 * 45=90degrees
bank = 0
heading = 90 degrees
attitude = 90 degrees
bank = 0 |
w = 0
x = 0.7071
y = 0.7071
z = 0
heading = atan2(2*qy*qw-2*qx*qz , 1 - 2*qy2 - 2*qz2)
attitude = asin(2*qx*qy + 2*qz*qw)
bank = atan2(2*qx*qw-2*qy*qz , 1 - 2*qx2 - 2*qz2)
heading = atan2(0 , 0)
attitude = asin(1)
bank = atan2(0 , 0)
this is at singularity (straight up) atan2(0,0)
is not useful, so instead, use:
heading = 2 * atan2(x,w)
= 2 * atan2(0.7071,0) = 2*90degrees
bank = 0
heading = 180 degrees
attitude = 90 degrees
bank = 0 |
w = 0.5
x = -0.5
y = -0.5
z = 0.5
heading = atan2(2*qy*qw-2*qx*qz , 1 - 2*qy2 - 2*qz2)
attitude = asin(2*qx*qy + 2*qz*qw)
bank = atan2(2*qx*qw-2*qy*qz , 1 - 2*qx2 - 2*qz2)
heading = atan2(0 , 0)
attitude = asin(1)
bank = atan2(0 ,0)
this is at singularity (straight up) atan2(0,0)
is not useful, so instead, use:
heading = 2 * atan2(x,w)
= 2 * -45degrees
bank = 0
heading = -90 degrees
attitude = 90 degrees
bank = 0 |