Android的SENSOR_DELAY_FASTEST不够快Android、SENSOR_DELAY_FASTEST

2023-09-05 01:18:53 作者:一倾风月一流年

我使用的传感器来平衡一个机器人,但 SENSOR_DELAY_FASTEST 只是提供了一个10Hz的采样率,这简直就是不够快。有抽样的方法更快?

有没有投票的方式感应器,而不是等待 SensorEvent

解决方案   

有取样的方式更快?

SENSOR_DELAY_FASTEST 是一个0毫秒的延迟。你不能有负面的时间,至少就物理学家已经确定。因此,没有更快的延迟比 SENSOR_DELAY_FASTEST

使用 Traceview ,以确定您的时间被占用。这是可能的,它是你的code,它正在放缓的处理。

  

轮询的方式感应器,而不是等待SensorEvent?

没有,不好意思。

android sensorsimulator安装到android2.2模拟器上后,运行sensor simulator settings出现一片黑,怎么办

I'm using the sensors to balance a robot, but SENSOR_DELAY_FASTEST only provides a 10Hz sampling rate, which is simply not fast enough. Is there a way of sampling even faster?

Is there a way of polling the sensors rather than waiting for a SensorEvent ?

解决方案

Is there a way of sampling even faster?

SENSOR_DELAY_FASTEST is a 0ms delay. You cannot have negative time, at least as far as physicists have determined. Hence, there is no "faster" delay than SENSOR_DELAY_FASTEST.

Use Traceview to determine where your time is being taken up. It is possible that it is your code that is slowing down your processing.

a way of polling the sensors rather than waiting for a SensorEvent ?

No, sorry.