使用 Android 加速度计计算距离、海拔? [英] using Android Accelerometer to calculate distance , eleveation?

查看:28
本文介绍了使用 Android 加速度计计算距离、海拔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以确定一个人在哪里,即他在走路吗?他在电梯里吗?还是他在爬楼梯?

can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ?

使用android的加速度计还是有其他方法可以在android中计算?

using android's accelerometer or is there any other way to calculate such in android ?

推荐答案

您可以在配备加速度计和数字罗盘的手机中结合使用它们来确定此 发布.

You can use a combination of the accelerometer and the digital compass, in phones that have them, to determine a speed and direction as mentioned in this post.

如果您只需确定此人是否在走路,那么您只需要加速度计.只需处理其输出的脚步.

If all you need to do is determine if the person is walking, all you need is the accelerometer. Just process its output for foot steps.

网络上有大量使用加速度计检测脚步的教程.

There are plenty of tutorials on the web for detecting foot steps with an accelerometer.

这里有一个应用说明:http://www.analog.com/library/analogDialogue/archives/41-03/pedometer.html 提供了不错的数学背景和示例算法.当然,由您来提取数学并为 Android 重写它(示例代码是用 C 编写的).我目前不知道带有脚步检测算法的开源 Android 库.

There an app note here: http://www.analog.com/library/analogDialogue/archives/41-03/pedometer.html that gives a decent mathematical background and an example algorithm. Its of course up to you to extract the math and rewrite it for Android (the example code is written in C). I don't currently know of an open source android library with a footstep detection algorithm.

如果你实现了什么,我想得到代码,不要忘记回发结果.

If you implement something, I would like to get the code, don't forget to post back the results.

这篇关于使用 Android 加速度计计算距离、海拔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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