Merge pull request #42 from Every-Flavor-Robotics/master
Fix Gravity Vector Calculation (#35)
This commit is contained in:
commit
b14657f111
2 changed files with 2 additions and 2 deletions
|
|
@ -300,6 +300,6 @@ void Adafruit_Madgwick::computeAngles() {
|
|||
yaw = atan2f(q1 * q2 + q0 * q3, 0.5f - q2 * q2 - q3 * q3);
|
||||
grav[0] = 2.0f * (q1 * q3 - q0 * q2);
|
||||
grav[1] = 2.0f * (q0 * q1 + q2 * q3);
|
||||
grav[2] = 2.0f * (q1 * q0 - 0.5f + q3 * q3);
|
||||
grav[2] = 2.0f * (q0 * q0 - 0.5f + q3 * q3);
|
||||
anglesComputed = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ void Adafruit_Mahony::computeAngles() {
|
|||
yaw = atan2f(q1 * q2 + q0 * q3, 0.5f - q2 * q2 - q3 * q3);
|
||||
grav[0] = 2.0f * (q1 * q3 - q0 * q2);
|
||||
grav[1] = 2.0f * (q0 * q1 + q2 * q3);
|
||||
grav[2] = 2.0f * (q1 * q0 - 0.5f + q3 * q3);
|
||||
grav[2] = 2.0f * (q0 * q0 - 0.5f + q3 * q3);
|
||||
anglesComputed = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue