简体   繁体   English

如何将加速度传感器数据转换为步数计数器?

[英]How to convert accelerometer sensor data to step counter?

我想用颤动构建一个步数计数器小部件,但不知道如何借助传感器颤振包将X,Y和Z轴的加速度传感器数据转换为步数计数器。

I think trying to do this accurately from accelerometer data may be tricky, so you may be better trying to do it natively in a plugin. 我认为尝试从加速度计数据中准确地做到这一点可能很棘手,因此您最好尝试在插件中本地进行。 For example, Android has a Step Counter sensor type: 例如,Android具有“计步器”传感器类型:

https://developer.android.com/reference/android/hardware/Sensor#TYPE_STEP_COUNTER https://developer.android.com/reference/android/hardware/Sensor#TYPE_STEP_COUNTER

If you insist on doing it from the accelerometer data, I think you probably want to count the direction changes (count every other one), but I expect making it accurate (eg. trying to ignore things that aren't steps) will be non-trivial. 如果您坚持从加速度计数据中执行此操作,我想您可能想计算方向变化(每隔一个方向计数一次),但是我希望使其方向准确(例如,尝试忽略不是台阶的事物)将是不正确的。 -不重要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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