使用iphone中的加速计功能行走时计算步数的逻辑 [英] logic to count steps while walking using accelerometer feature in iphone

查看:116
本文介绍了使用iphone中的加速计功能行走时计算步数的逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用iPhone中的加速计功能计算行走时的距离?

How can I use the accelerometer feature in the iPhone to calculate distances while walking?

推荐答案

你不能使用加速度计确定距离。

You can't use the accelerometer to determine distance.

如果我处于静止状态,加速度计仅检测重力引起的加速度。这显然将行走距离设置为0.

If I'm at rest, the accelerometer detects only acceleration due to gravity. This obviously set the walking distance to 0.

但如果我以恒定速度行走,并在行走时启动你的应用程序,我的加速度也为零,因此加速度计仅检测由于重力引起的加速度。情况与上述相同,步行距离为0,这是不正确的。

But if I'm walking at constant velocity, and start your app while walking, my acceleration is also zero, thus the accelerometer detects only acceleration due to gravity again. The situation is same as above, and the walking distance is 0, which is incorrect.

更不用说由于方向的原因而难以处理加速度的变化设备。

Not to mention the difficulty in dealing with changes of acceleration due to the orientation of the device.

需要核心位置来计算与距离相关的任何内容。您可以使用加速度计来实现计步器,但只计算步数,而不是距离。

You need Core Location to compute anything related to distance. You can use the accelerometer to implement a pedometer but that only counts steps, not distance.

这篇关于使用iphone中的加速计功能行走时计算步数的逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆