SensorFusion problem
Hello,
I am trying to use the SensorFusion module, but I get the following error:
W/System.err: com.mbientlab.metawear.UnsupportedModuleException: Module 'SensorFusion' not supported for this firmware version
W/System.err: at com.mbientlab.metawear.impl.DefaultMetaWearBoard.getModule(DefaultMetaWearBoard.java:8568)
W/System.err: at com.mbientlab.metawear.starter.DeviceSetupActivityFragment.onServiceConnected(DeviceSetupActivityFragment.java:154)
W/System.err: at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1335)
W/System.err: at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1352)
W/System.err: at android.os.Handler.handleCallback(Handler.java:739)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err: at android.os.Looper.loop(Looper.java:158)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7229)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I am using the Meta Motion R board with firmware ver. 1.3.3. I have used the sample Metawear Android app and it works without problems, i.e. it opens the SensorFusion module without giving the error. Therefore I am very sure it's not a problem related to board or firmware.
My code for opening the SensorFusion module looks like this:
public class DeviceSetupActivityFragment extends Fragment implements ServiceConnection {
private MetaWearBoard mwBoard= null;
private SensorFusion sensorFusionModule;
...
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mwBoard = ((MetaWearBleService.LocalBinder) service).getMetaWearBoard(settings.getBtDevice());
try {
sensorFusionModule = mwBoard.getModule(SensorFusion.class);
}
catch (UnsupportedModuleException e)
{
e.printStackTrace();
}
if (sensorFusionModule != null) {
sensorFusionModule.configure()
.setMode(SensorFusion.Mode.NDOF)
.setAccRange(SensorFusion.AccRange.AR_2G)
.setGyroRange(SensorFusion.GyroRange.GR_500DPS)
.commit();
sensorFusionModule.routeData().fromQuaternions().stream("sensor_fusion_stream").commit()
.onComplete(onCompleteSensorFusionHandler);
}
}
...
}
Why do I get this error?
Please help, I'm going crazy because of this problem!!!
This discussion has been closed.
Comments
getModule
function and step through it to determine which operand of the boolean "and" expression fails at this line of code: