Android的SENSOR_DELAY_FASTEST不够快 [英] Android SENSOR_DELAY_FASTEST isn't fast enough
问题描述
我使用的传感器来平衡一个机器人,但 SENSOR_DELAY_FASTEST
只是提供了一个10Hz的采样率,这简直就是不够快。有抽样的方法更快?
有没有投票的方式感应器,而不是等待 SensorEvent
?
有取样的方式更快?
SENSOR_DELAY_FASTEST
是一个0毫秒的延迟。你不能有负面的时间,至少就物理学家已经确定。因此,没有更快的延迟比 SENSOR_DELAY_FASTEST
。
使用 Traceview ,以确定您的时间被占用。这是可能的,它是你的code,它正在放缓的处理。
轮询的方式感应器,而不是等待SensorEvent?
没有,不好意思。
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.
这篇关于Android的SENSOR_DELAY_FASTEST不够快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!