Metamotion R Sensorfusion at less than 100 Hz
Hello,
I have two Metamotion R sensors that I have been testing my UWP application that uses sensor fusion to output quaternions. One of my sensors outputs at the expected 100Hz, but the other outputs at 80Hz. They are both fully charged. Are there any reasons that you know of for this behavior?
Thank you,
Dan
This discussion has been closed.
Comments
https://www.microsoft.com/en-us/store/p/metabase/9nblggh4txj3
The situation has changed a little bit, and now neither of my sensors are working well with my application. Lets call the sensor that I was previously having issues with Sensor 1. The other sensor I had been using successfully at 100 Hz we will call Sensor 2. Previously, Sensor 2 was on FW Rev 1.3.4 and running 100 Hz. After updating to FW Rev. 1.3.6, I now get 77Hz with this sensor, the exact same value that I am now getting with Sensor 1. Sensor 1 has been on FW Rev 1.3.6 this entire time. One more thing of note is that both sensors jump around in frequency for a given second from values 60Hz all the way up to 120Hz. I'm not sure if this is somehow an issue with the timer that I implemented, or what.
I did still run Metabase using both sensors, and got some interesting results. On Sensor 1, running Sensor Fusion on the MetaBase app for 120 seconds, I got 10888 samples for an overall sampling frequency of 90.7 Hz. I did the same for Sensor 2 and got 12170 samples for a sampling frequency of 101.4 Hz. A summary of this info in a more visual way is attached.
This is obviously a confusing scenario. Based on what I've seen, I have a few questions:
Is it possible to roll back the FW Rev to 1.3.4? It seems like this was working better with my application.
Is the code for the Metabase UWP application available online? The sensors appear to be doing better with this application and I would like to be able to compare code. I would also like to see what kind of timer you used to display the number of samples, as it appeared that you did so every second.
Thank you.
Best,
Dan
Check with the Android or iOS MetaBase apps as well. You can use those versions of MetaBase to upload any firmware revision you want.
No, MetaBase code is not publicly available.
Post the code you are currently running to configure the sensors.
Hey Eric,
Thanks for the advice about the MetaBase app. I uploaded firmware 1.3.4 onto Sensor 2 and it didn't actually seem to change anything. I am now getting a streaming frequency of 80-85 Hz with both sensors no matter what using my application.
On the iOS MetaBase app, I tried streaming quaternions from both sensors at a time for 120 seconds. Sensor 1 had a streaming frequency of 95.5 Hz, while Sensor 2 had a streaming frequency of 99.9 Hz. I then tried sensor 1 by itself with the iOS MetaBase app and got a streaming frequency of 98.6 Hz. Any of these frequencies would be great in my UWP. Before the C# SDK got a big overhaul, I believe to fix the Fall Creators Update (and before the Fall Creators Update messed up the Bluetooth connections), my UWP application used to stream from two sensors each at 100 Hz without any issues.
Here's the code I am currently running to configure the sensors and retrieve data --
In the "OnNavigatedTo" function:
var device = e.Parameter as BluetoothLEDevice;
metawear = MbientLab.MetaWear.Win10.Application.GetMetaWearBoard(device);
In the function triggered by pressing the stream switch:
sensorFusion = metawear.GetModule();
sensorFusion.Configure();
await sensorFusion.Quaternion.AddRouteAsync(source => source.Stream(async data =>
{
var quat = data.Value();
}));
sensorFusion.Quaternion.Start();
sensorFusion.Start();
Any help would be greatly appreciated.
Dan
Did you setup the ble connection for high frequency streaming?
https://mbientlab.com/csdocs/latest/advanced_features.html#high-frequency-streaming
Hey Eric,
Thanks so much for that link. I had seen that portion of the documentation, but didn't realize that it was needed for my application given I was having issues streaming just one sensor at 100 Hz. I'm now able to stream data from both sensors at 100 Hz each.
Here's the particular code that fixed my issues:
var settings = board.GetModule();
settings.EditBleConnParams(maxConnInterval: 7.5f);
Dan
I just realized I made a mistake in the code that I posted. Below is the correct code:
var settings = metawears[i].GetModule();
settings.EditBleConnParams(maxConnInterval: 7.5f);