1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Attitude: Keep first element of quaternion positive

This commit is contained in:
James Cotton 2011-08-08 10:36:55 -05:00
parent 247da8c24b
commit ec2121bca8

View File

@ -329,6 +329,13 @@ static void updateAttitude(AttitudeRawData * attitudeRaw)
q[1] = q[1] + qdot[1];
q[2] = q[2] + qdot[2];
q[3] = q[3] + qdot[3];
if(q[0] < 0) {
q[0] = -q[0];
q[1] = -q[1];
q[2] = -q[2];
q[3] = -q[3];
}
}
// Renomalize