UWP Quaternions Only Outputs

Hello,

I have a UWP app configured with a start and stop button for streaming quaternions. However, if I start streaming the quaternions, hit "Stop", and then hit "Start" again, the quaternions don't stream again and nothing happens.

When the start button is pressed, the following code is run:

mbl_mw_settings_set_connection_parameters(cppBoard, 7.5F, 7.5F, 0, 6000);
mbl_mw_sensor_fusion_set_mode(cppBoard, SensorFusion.Mode.NDOF);
mbl_mw_sensor_fusion_set_acc_range(cppBoard, SensorFusion.AccRange.AR_16G); ///AR_2G, 4, 8, 16
mbl_mw_sensor_fusion_set_gyro_range(cppBoard, SensorFusion.GyroRange.GR_2000DPS); ///GR_2000DPS, 1000, 500, 250

mbl_mw_sensor_fusion_write_config(cppBoard);

IntPtr fusionsDataSignal = mbl_mw_sensor_fusion_get_data_signal(cppBoard, SensorFusion.Data.QUATERION); //this line works

mbl_mw_datasignal_subscribe(fusionsDataSignal, fusionDataHandler);
mbl_mw_sensor_fusion_enable_data(cppBoard, SensorFusion.Data.QUATERION);
mbl_mw_sensor_fusion_start(cppBoard);

When the stop button is pressed, the following code is run:
 IntPtr quatSignal = mbl_mw_sensor_fusion_get_data_signal(cppBoard, SensorFusion.Data.QUATERION);

 mbl_mw_sensor_fusion_stop(cppBoard);
 mbl_mw_sensor_fusion_clear_enabled_mask(cppBoard);
 mbl_mw_datasignal_unsubscribe(quatSignal);


Do you have any idea what might be going on?

Thanks,
Dan

Comments

  • If you use the same start/stop setup with just raw accelerometer or gyro data, does the same behavior occur?  What about using other sensor fusion outputs?
  • Eric,

    I can log raw accelerometer, magnetometer, and gyroscope data just fine, starting and stopping as a I please. The issue only occurs with quaternions, and it happens with all of the sensor fusion outputs (Compass, NDOF, IMU_PLUS, M4G).

    Dan
  • I should mention that I'm using a Metawear R sensor. I have reset the sensor using the Metawear iOS app and it has not helped.
  • One more piece of information to add -- as soon as the quaternions stop working, streaming all other types of data stops working as well. 
  • So, streaming euler angles or linear acceleration is completely fine?  What if you reduced the accelerometer range to 8g, down from 16g?
  • Hey Eric,

    I was incorrect in what I said. Any Sensor Fusion mode/setting has the same problem, including streaming euler angles or linear acceleration. Reducing the accelerometer range does not help the problem.

    Dan
  • Does quaternion streaming work fine when using the MetaBase app?
This discussion has been closed.