I can stream gyro data 25hz per second,Is there any way I can stream gyro data 1hz per second.
My second question is if I set my output rate 25hz per seconds, is there any way I can average each axis(x,y,z) data, and bring it to 1hz per second for streaming.
Comments
try {
gyroModule = mwBoard.getModule(Bmi160Gyro.class);
} catch (UnsupportedModuleException e) {
e.printStackTrace();
}
gyroModule.configure()
.setOutputDataRate(OutputDataRate.ODR_25_HZ)
.setFullScaleRange(FullScaleRange.FSR_500)
.commit();
AsyncOperation<RouteManager> routeManagerResultGyro = gyroModule.routeData().fromAxes()
.process(new Time(Time.OutputMode.ABSOLUTE,1000))
.stream(GYRO_STREAM_KEY)
.commit();
routeManagerResultGyro.onComplete(new AsyncOperation.CompletionHandler<RouteManager>() {
@Override
public void success(RouteManager result) {
result.subscribe(GYRO_STREAM_KEY, new RouteManager.MessageHandler() {
@Override
public void process(Message msg) {
final CartesianFloat spinData = msg.getData(CartesianFloat.class);
Log.i(TAG, String.format("Gyroscope: %s", spinData.toString()));
}
});
}
});
gyroModule.start();
failurefunction to see if anything is returned therestartfunction into the CompletionHandler, otherwise the code works fine for me.