如何从加速度计读数删除重力因素,Android的3轴加速度计加速度计、读数、重力、因素

2023-09-06 01:56:49 作者:给你扛起一片天

可以从加速度计读数取出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.

任何帮助吗?

推荐答案

看看下面的链接看看。

http://developer.android.com/reference/android/hardware/SensorEvent.html

 
精彩推荐