如何从加速度计读数删除重力因素,Android的3轴加速度计 [英] How to remove Gravity factor from Accelerometer readings in Android 3-axis accelerometer

查看:582
本文介绍了如何从加速度计读数删除重力因素,Android的3轴加速度计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以从加速度计读数取出g因子的人有所帮助。我使用SensorEventListener与onSensorChanged()方法用于获取Sensor.TYPE_ACCELEROMETER数据。我需要在各个方向上唯一的纯加速度值​​。因此,在任何状态下,如果该设备是稳定的(或定速),它应该给(0.0,0.0,0.0)约。 目前,取决于它的倾斜和滚动,它给我可变输出根据作用在各轴克的力。

Can anyone help on removing the g factor from accelerometer readings. I am using SensorEventListener with onSensorChanged() method for getting Sensor.TYPE_ACCELEROMETER data. I need only pure acceleration values in all directions. So at any state if the device is stable (or in constant speed), it should give (0.0,0.0,0.0) roughly. Currently, depending on its pitch and roll, it gives me variable output depending on the g forces acting on each axis.

我希望有一些公式来消除这一点,因为我也得到Sensor.TYPE_ORIENTATION监听定位值(俯仰和滚转)。我用了一些,但没有奏效。

I hope there is some formula to remove this, as I also get orientation values (pitch and roll) from Sensor.TYPE_ORIENTATION listener. I had used some but didn't work.

任何帮助吗?

推荐答案

看看下面的链接看看。

<一个href="http://developer.android.com/reference/android/hardware/SensorEvent.html">http://developer.android.com/reference/android/hardware/SensorEvent.html

这篇关于如何从加速度计读数删除重力因素,Android的3轴加速度计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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