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

StackOverflow https://stackoverflow.com/questions/22146860

Вопрос

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,2014­03­03 10:09:40

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

CMMotionActivity @ 14077.466468,<startDate,2014­03­03 10:09:43

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

CMMotionActivity @ 14080.024116,<startDate,2014­03­03 10:09:46

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

CMMotionActivity @ 14082.582084,<startDate,2014­03­03 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!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top