Easy Training / Mbed 2 deprecated Quaternionen_to_euler

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
MarcelPortmann
Date:
Wed Mar 04 17:49:57 2020 +0000
Commit message:
Aus quanternionen eulerwinkel berechnen;

Changed in this revision

QtoEuler.cpp Show annotated file Show diff for this revision Revisions of this file
QtoEuler.h Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 4824ed76a312 QtoEuler.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QtoEuler.cpp	Wed Mar 04 17:49:57 2020 +0000
@@ -0,0 +1,19 @@
+
+#include "MadgwickAHRS.h" 
+#include "QtoEuler.h"
+#include <math.h>
+
+// Programm zum umrecnen der Quatrionen in die 3 Eulerwinkel
+// Pitch roll und jaw
+
+// Benötigt zum funktionieren den Madgwick Algorythmuss
+
+volatile float pitch = 0.0f, rol = 0.0f, jaw = 0.0f;
+
+void QtoEuler(void){
+    jaw   =   atan2(2*q1*q2 - 2*q0*q3, 2*pow(q0,2)+2*pow(q1,2) - 1);
+    pitch =   -asin(2*q1*q3+2*q0*q2);
+    rol   =   atan2(2*q2*q3-2*q0*q1,2*pow(q0,2)+2*pow(q3,2) - 1);
+    
+    
+    }
\ No newline at end of file
diff -r 000000000000 -r 4824ed76a312 QtoEuler.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QtoEuler.h	Wed Mar 04 17:49:57 2020 +0000
@@ -0,0 +1,19 @@
+
+
+
+
+#ifndef QtoEuler_h
+#define QtoEuler_h
+
+//----------------------------------------------------------------------------------------------------
+// Variable declaration
+
+extern volatile float pitch, rol, jaw ;   // Globale winkelvariablen
+
+//---------------------------------------------------------------------------------------------------
+// Function declarations
+
+void QtoEuler();
+
+
+#endif
\ No newline at end of file
diff -r 000000000000 -r 4824ed76a312 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 04 17:49:57 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file