Need a reliable way to get real time accelerometer data

Originator:jasdeep.saini
Number:rdar://26500546 Date Originated:5-26-16
Status:Duplicate Resolved:
Product:Apple Watch Product Version:Watch OS 2.2 & 2.2.1
Classification:Enhancement Reproducible:Always
 
Summary:
Recently, I worked on a workout app which needed real time accelerometer data to analyze a user's movement.

I tried using a combination of updates from the CMMotionManager and recorded data from the CMSensorRecorder to achieve this.

The behavior of the CMSensorRecorder varied by Watch.  On some watches, getting recorded data was almost instantaneous, on other watches it took up to 3 minutes.

It would be nice if all watches returned recorded data in a reasonable amount of time.  Three minutes is too long for an user to wait to see the results of the action they just took.
 
Other possible solutions:
1. Allow accelerometer updates to continue in the background if the user gives permission.
2. Pass in all accelerometer updates which occur when the watch face is off when the watch face comes back on.

Steps to Reproduce:
1. When the watch face is on, get accelerometer updates using the startAccelerometerUpdatesToQueue method of CMMotionManager.

2. When the watch face is off, record data using CMSensorRecorder.  The recorder is started once when a workout is started.

3. Once the watch face is on again, poll the CMSensorRecorder until the data gap caused by the watch face is filled in.  Ignore gaps that are smaller than a set amount.  Through testing, I ignored gaps smaller than 3 seconds.  Getting the batch could take many retries, but when data finally came, the remaining gap was usually less than 3 seconds.

4. Go back to using live data.


Expected Results:
A continous stream of data for the watch to process whenever the watch face is on without a long wait time to continue processing when the watch face turns off and then back on.

Actual Results:
A continous stream of accelerometer data is returned, but there are delays of up to 3 minutes getting data from the CMSensorRecorder every time the watch face turns off and then back on.

Version:
Watch OS 2.2 & 2.2.1

Notes:


Configuration:
Watch OS 2.2
 iOS 9.3.1
XCode 7.3 

Watch OS 2.2.1
iOS 9.3.2
XCode 7.3.1

Comments

Fixed in WatchOS3

By jasdeep.saini at March 28, 2017, 12:40 a.m. (reply...)

Marked as a duplicate

Duplicate of 18068975 (Open)

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.

If you have any questions or concerns, please update your report directly here: http://bugreport.apple.com/.

By jasdeep.saini at June 2, 2016, 4:03 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!