Skip to content

Commit bf3c639

Browse files
authored
Merge pull request #6 from SimLeek/get_quat
Added ability to get an array of the 4 quaternion values.
2 parents 64e8ec9 + f7eb290 commit bf3c639

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ getRoll KEYWORD2
1515
getRollRadians KEYWORD2
1616
getPitchRadians KEYWORD2
1717
getYawRadians KEYWORD2
18+
getQuat KEYWORD2
1819

1920
#######################################
2021
# Constants (LITERAL1)

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SensorFusion
2-
version=1.0.2
2+
version=1.0.3
33
author=aster94
44
maintainer=aster94
55
sentence=A library that makes using a IMU a breeze.

src/SensorFusion.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ class SF {
7070
if (!anglesComputed) computeAngles();
7171
return yaw;
7272
}
73+
float* getQuat() {
74+
memcpy(_copyQuat, &q0, sizeof(float)*4);
75+
return _copyQuat;
76+
}
7377

7478
private:
7579
float beta; //Madgwick: 2 * proportional gain
@@ -82,6 +86,7 @@ class SF {
8286
void computeAngles();
8387
float roll, pitch, yaw;
8488
float Now,lastUpdate,deltat;
89+
float _copyQuat[4]; // copy buffer to protect the quaternion values since getters!=setters
8590

8691
};
8792

0 commit comments

Comments
 (0)