probably bug at sensor fusion beta-03
Hi Eric,
I think there is probably a bug at sensor fusion by configurate the mode.
source code of configuration the sensor fusion:
https://github.com/mbientlab/Metawear-SampleAndroidApp/blob/3.0_beta/app/src/main/java/com/mbientlab/metawear/app/SensorFusionFragment.java
Thank you for helping.
Best reguards
Tobias
I think there is probably a bug at sensor fusion by configurate the mode.
source code of configuration the sensor fusion:
boardHandRight.connectAsync().onSuccessTask(task -> {and start the logging:
sensorFusionHandRight = boardHandRight.getModule(SensorFusionBosch.class);
sensorFusionHandRight.configure().mode(SensorFusionBosch.Mode.NDOF).
accRange(SensorFusionBosch.AccRange.AR_2G).
gyroRange(SensorFusionBosch.GyroRange.GR_500DPS).commit();
return sensorFusionHandRight.eulerAngles().addRoute(source -> {
source.log((msg, env) -> {
record.getHandRightData().addEuler(msg.timestamp(), msg.value(EulerAngle.class));
Log.i("HAND RIGHT", "EULER " + msg.formattedTimestamp() + msg.value(EulerAngle.class));
});
});
});
ledHandRight.editPattern(Led.Color.BLUE);Here the message:
ledHandRight.play();
logModuleHandRight.clearEntries();
logModuleHandRight.start(false);
sensorFusionHandRight.eulerAngles().start();
sensorFusionHandRight.start(); // At this Line I have the problems
12-14 12:18:41.864 31188-31188/com.gaitapp.steinmetzer.gaitapp E/AndroidRuntime: FATAL EXCEPTION: mainI look also in the source code from the sample app beta-03. In my Opinion you don't update this code to the beta version. Here the link:
Process: com.gaitapp.steinmetzer.gaitapp, PID: 31188
java.lang.NullPointerException: Attempt to invoke virtual method 'int com.mbientlab.metawear.module.SensorFusionBosch$Mode.ordinal()' on a null object reference
at com.mbientlab.metawear.impl.SensorFusionBoschImpl.start(SensorFusionBoschImpl.java:491)
at com.gaitapp.steinmetzer.gaitapp.fragments.InsoleFragment$7.onClick(InsoleFragment.java:358)
at android.view.View.performClick(View.java:5698)
at android.view.View$PerformClick.run(View.java:22570)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7231)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
https://github.com/mbientlab/Metawear-SampleAndroidApp/blob/3.0_beta/app/src/main/java/com/mbientlab/metawear/app/SensorFusionFragment.java
Thank you for helping.
Best reguards
Tobias
This discussion has been closed.
Comments
But in this demo you use the beta-01. In my project i use the beta-03. In this version you modified many class names. I think there is propably a mistake. Because in beta-03 I can only select the class SensorFusionBosch and not the super class SensorFusion.
I found a mistake in my code too but not the main mistake. In the last days I try some stuff but nothing work for me. Now I have build a new sampleapp based on your starter project.
Here my sourcecode: Link
If I stream the data the app run perfect, but if I want log the data nothing work. I hope you can help me.
Hi Eric,
thank you for your fast support! Now the source code work very fine.
P.S. version 3.x.x of the api works very well