Skip to content

Commit c63969c

Browse files
ProExpertProgutamadonny
authored andcommitted
Update MadgwickAHRS.h
Added a function that returns the quaternion
1 parent 9630fb9 commit c63969c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/MadgwickAHRS.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class Madgwick{
4646
//float getPitch(){return atan2f(2.0f * q2 * q3 - 2.0f * q0 * q1, 2.0f * q0 * q0 + 2.0f * q3 * q3 - 1.0f);};
4747
//float getRoll(){return -1.0f * asinf(2.0f * q1 * q3 + 2.0f * q0 * q2);};
4848
//float getYaw(){return atan2f(2.0f * q1 * q2 - 2.0f * q0 * q3, 2.0f * q0 * q0 + 2.0f * q1 * q1 - 1.0f);};
49+
float* getQuaternion() {
50+
return {q0,q1,q2,q3};
51+
}
4952
float getRoll() {
5053
if (!anglesComputed) computeAngles();
5154
return roll * 57.29578f;

0 commit comments

Comments
 (0)