Sending quaternion differential as separate msg

eulerConversion
Martin 2022-03-04 15:52:55 +01:00
parent f0a3c9df44
commit db434f18b7
1 changed files with 24 additions and 8 deletions

View File

@ -84,7 +84,7 @@ OSCMessage msg("/accel/");
OSCMessage gmsg("/gyro/");
OSCMessage emsg("/error/");
OSCMessage kmsg("/keys/");
OSCMessage qmsg("/quaternion/");
OSCMessage quaternionMessage("/quaternion/");
void setup() {
Wire.begin();
@ -170,20 +170,36 @@ void loop() {
//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);
quaternionMessage.add(q.w);
quaternionMessage.add(q.x);
quaternionMessage.add(q.y);
quaternionMessage.add(q.z);
SLIPBTSerial.beginPacket();
qmsg.send(SLIPBTSerial);
quaternionMessage.send(SLIPBTSerial);
SLIPBTSerial.endPacket();
SLIPSerial.beginPacket();
qmsg.send(SLIPSerial);
quaternionMessage.send(SLIPSerial);
SLIPSerial.endPacket();
quaternionMessage.empty();
quaternionDiffMessage.add(diff.w);
quaternionDiffMessage.add(diff.x);
quaternionDiffMessage.add(diff.y);
quaternionDiffMessage.add(diff.z);
SLIPBTSerial.beginPacket();
quaternionDiffMessage.send(SLIPBTSerial);
SLIPBTSerial.endPacket();
SLIPSerial.beginPacket();
quaternionDiffMessage.send(SLIPSerial);
SLIPSerial.endPacket();
quaternionDiffMessage.empty();
qmsg.empty();
#endif