简体   繁体   中英

How to calculate distance travelled , speed , duration in iOS devices with M7 Co-processor?

How to calculate distance travelled , speed , duration in iOS devices with M7 Co-processor?

I have referred apple's CMMotionActivityManager document https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CMMotionActivityManager_class/Reference/Reference.html#//apple_ref/doc/uid/TP40013503

which provides access to motion data stored by device, the data which we get is something like this :

CMMotionActivity @ 14074.912282,<startDate,20140303 10:09:40

+0000,confidence,1,unknown,0,stationary,0,walking,1,running,0,automotive,0>

CMMotionActivity @ 14077.466468,<startDate,20140303 10:09:43

+0000,confidence,0,unknown,0,stationary,0,walking,0,running,1,automotive,0>

CMMotionActivity @ 14080.024116,<startDate,20140303 10:09:46

+0000,confidence,1,unknown,0,stationary,0,walking,0,running,1,automotive,0>

CMMotionActivity @ 14082.582084,<startDate,20140303 10:09:48

+0000,confidence,2,unknown,0,stationary,0,walking,0,running,1,automotive,0>

So, without using GPS /relying only on M7 data can I calculate(eg. for Running) Distance travelled, Duration of Run, Speed etc.

The CMMotionActivity class only supplies information regarding the motion activity type of the user. The iOS motion framework provides abstraction between the hardware and the software API so that regardless of whether a device is equipped with an M7 or not, you should use the same API: CMMotionManager .

Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM