Sensor Fusion

I have a question about the Sensor Fusion (https://mbientlab.com/androiddocs/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;
}
});

Comments

  • What do you mean by "NDoF is not working"?  How does your app behave when you use select NDoF?

    Is the magnetometer properly functioning?
  • https://mbientlab.com/androiddocs/2.8.0/sensor_fusion.html

    In the SensorFusion module, there are four modes.

    ModeDescription
    NDoFCalculates absolute roeintation from accelerometer, gyro, and magnetometer
    IMUPlusCalculates relative orientation in space from accelerometer and gyro data
    CompassDetermines geographic direction from th Earth’s magnetic field
    M4GSimilar to IMUPlus except rotation is detected with the magnetometer
    I am not sure the magnetometer whether works or not.

  • Yes, I know there are 4 modes and that information does not answer my questions.  Please provide more detail to your issue by answering the questions in my previous post.

    Have you at least tried to use the magnetometer?
  • I only tested NDoF mode and IMUPlus mode. 

    NDoF is not working. 


  • Saying "NDoF is not working" does not provide me with any meaningful information to help diagnose your problem and I cannot help you until you provide more details.  Please answer the questions from my earlier post.

    You also mentioned that you had removed some of the code.  Please post the full source code.
This discussion has been closed.