Added the quaternion difference to qmsg
parent
b2536f2b92
commit
618547af52
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue