I am trying to capture Accel, Gyro, Mag data at 100hz which is a sampling rate every 10 milliseconds, the usual rates do not fit this pattern GAME is 20ms, and NORMAL is 200ms then you have FASTEST which is 0ms.
I can see that Android introduced Sensor direct channels and sensor reporting mode contiuous which can be set using sampling_period_ns. However i cannot see any documentation or examples anywhere on how to fully implement this. Can anyone who has experience please let me know. at the moment i am using the onChange callback with is unsuitable:
private void registerListener() {
SensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_GAME);
SensorManager.registerListener(this, gyroscope, SensorManager.SENSOR_DELAY_GAME);
SensorManager.registerListener(this, pressure, SensorManager.SENSOR_DELAY_GAME);
SensorManager.registerListener(this, magnetic, SensorManager.SENSOR_DELAY_GAME);
}
Then I handle the events in onSensorChanged, however this is 20ms not the required 10