Added the quaternion difference to qmsg

eulerConversion
Martin Krauser 2022-03-04 13:39:40 +01:00
parent b2536f2b92
commit 618547af52
1 changed files with 11 additions and 1 deletions

View File

@ -160,15 +160,25 @@ void loop() {
#ifdef OUTPUT_READABLE_QUATERNION
// display quaternion values in easy matrix form: w x y z
Quaternion previousQ(q.w,q.x,q.y,q.z);
mpu.dmpGetQuaternion(&q, fifoBuffer);
//oscmsg = qOSC(q.w, q.x, q.y, q.z);
//compute the differential rotation between the previous and new orientation
Quaternion diff = q.getProduct(previousQ.getConjugate());
//oscmsg = qOSC(q.w, q.x, q.y, q.z, diff.w, diff.x, diff.y, diff,z);
qmsg.add(q.w);
qmsg.add(q.x);
qmsg.add(q.y);
qmsg.add(q.z);
qmsg.add(diff.w);
qmsg.add(diff.x);
qmsg.add(diff.y);
qmsg.add(diff.z);
SLIPBTSerial.beginPacket();
qmsg.send(SLIPBTSerial);
SLIPBTSerial.endPacket();