Real time calculations in Python
I'm trying to do some simple calculations with the live data (quaternions) that comes from the MMR+ sensor, but am unable to see how I can put it in a variable.
1) The stream_quat.py example just goes to sleep for 10 seconds (line 47) during which the data is streamed, while I want to grab the quaternion each time it is received (preferably 100 times per second) and perform a "real-time" calculation with it. How do I assign the received quaternion to one/multiple variables?
2) Also, we got MMR#1 (let's call it this quaternion "a") and MMR#2 (let's call it this quaternion "b") streaming data at slightly different intervals(due to missing data), how would I be able to do real-time calculations e.g. a*b=c when a new value for a is not always available at the same time as a new value for b?