Skip to content

Commit

Permalink
Proper float constants
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Mar 15, 2016
1 parent 4391754 commit 6edf8ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MahonyAHRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class Mahony {
Mahony();
void update(float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz);
void updateIMU(float gx, float gy, float gz, float ax, float ay, float az);
float getPitch(){return atan2f(2 * q2 * q3 - 2 * q0 * q1, 2 * q0 * q0 + 2 * q3 * q3 - 1);};
float getRoll(){return -1 * asinf(2 * q1 * q3 + 2 * q0 * q2);};
float getYaw(){return atan2f(2 * q1 * q2 - 2 * q0 * q3, 2 * q0 * q0 + 2 * q1 * q1 - 1);};
float getPitch(){return atan2f(2.0f * q2 * q3 - 2.0f * q0 * q1, 2.0f * q0 * q0 + 2.0f * q3 * q3 - 1.0f);};
float getRoll(){return -1.0f * asinf(2.0f * q1 * q3 + 2.0f * q0 * q2);};
float getYaw(){return atan2f(2.0f * q1 * q2 - 2.0f * q0 * q3, 2.0f * q0 * q0 + 2.0f * q1 * q1 - 1.0f);};
};

#endif
Expand Down

0 comments on commit 6edf8ba

Please sign in to comment.