Sensor Fusion
I have a question about the Sensor Fusion (https://mbientlab.com/android docs/2.8.0/sensor_fusion.html)
I have a MetaMotionC.
I made the APP on the Android phone to collect a Gyroscope data, Magnetometer data and an Acceleration data using the Sensor Fusion library.
When I used the Sensor Fusion library in the program, the NDoF (Mode) is not working.
But, the IMUPlus mode works fine.
I don't know why NDoF Mode doesn't work to collect the data.
Is there anyone who have same problems?
Here is my code: ( I removed some code because of the limitation of body characters length.
public class MainActivity extends AppCompatActivity implements ServiceConnection {
SensorFusionBosch sensorFusion;
public void retrieveBoard() {
board= serviceBinder.getMetaWearBoard(remoteDevice) ;
board.connectAsync().onSuccessTask(new Continuation<Void, Task<Route>>(){
@Override
public Task<Route> then(Task<Void> task) throws Exception{
sensorFusion = board.getModule(SensorFusionBosch.class);
sensorFusion.configure()
.mode(SensorFusionBosch.Mode.IMU_PLUS) ///NDoF //// not work
.accRange(SensorFusionBosch.AccRange.AR_16G)
.gyroRange(SensorFusionBosch.GyroRange.GR_2000DPS)
.commit();
sensorFusion.quaternion().addRouteAsync(new RouteBuilder() {
@Override
public void configure(RouteComponent source) {
source.stream(new Subscriber() {
@Override
public void apply(Data data, Object... env) {
Log.i("MainActivity", "Quaternion = " + data.value(Quaternion.class));
}
});
}
}).continueWith(new Continuation<Route, Void>() {
@Override
public Void then(Task<Route> task) throws Exception {
sensorFusion.quaternion().start();
sensorFusion.start();
return null;
}
});
This discussion has been closed.
Comments