Friday, July 17, 2015

Raw sensor data on the Watch -- fairly limited use

Yes, the accelerometer is accessible to an in-focus application, however, since there is no control over keeping an application in focus, using accelerometer directly is pretty much only for test. Here's a screen dump for your amusement (the code is in the ttl repo).


What you see here is a test where I move the accelerometer event stream activation to a switch. Entering the application only starts the display update. The sensor is fine, but the total count shows the updates stop when the focus goes out of the application. And there appear to be cases where the app itself is terminated -- e.g. re-entering the application shows the state as reset. That the app is suspended or sensor data isn't delivered is pretty much a showstopper for an acquisition system.

A little reading and, oops, I should have been using CMSensorRecorder. This appears to be a way to start a background recorder capturing sensor data. WWDC presentation on CoreMotion suggests up to 3 days of data can be recorded at up to 50hz.  And, Apple warns, this will have some impact on battery life, something I will next measure.


No comments:

Post a Comment