Movesense-加速度计采样率更改失败 [英] Movesense - Accelerometer Sampling Rate change fails

查看:96
本文介绍了Movesense-加速度计采样率更改失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用移动API更改加速度计采样率:
我正在使用以下命令进行订阅:

I am unable to change the Accelerometers sampling rate using the mobile API: I am subscribing using these commands:

 String strContract = sb.append("{\"Uri\": \"").append(connectedSerial).append(URI_MEAS_ACC_26).append("\"}").toString();
        Log.d(LOG_TAG, "subscribeToSensor 1" + strContract);

        subscribedDeviceSerial = connectedSerial;

        mdsSubscription = mMds.builder().build(this).subscribe(URI_EVENTLISTENER, strContract, new MdsNotificationListener() {

我尝试了以下字符串:

static private String URI_MEAS_ACC_13 = "/Meas/Acc/13";
static private String URI_MEAS_ACC_26 = "/Meas/Acc/26";
static private String URI_MEAS_ACC_52 = "/Meas/Acc/52";
static private String URI_MEAS_ACC_104 = "/Meas/Acc/104";
static private String URI_MEAS_ACC_208 = "/Meas/Acc/208";

将字符串更改为26、52和104可以进行订阅,但是检查来自传感器的时间戳之间的差异仍始终为77 [ms]-即始终保持13 [Hz]的采样率。

Changing the string to 26, 52 and 104 the subscription works. However checking the delta between timestamps from the sensor it is still always 77[ms] - i.e. the sampling rate of 13 [Hz] always remain. Please assist!

带有URI_MEAS_ACC_52的某些日志打印输出:

Some Log printouts with URI_MEAS_ACC_52:

01-26 15:13:00.811 10469-10469/com.Activity: Starting Scan 
01-26 15:13:00.811 10469-10469/com.Activity:  onScanClicked 1 
01-26 15:13:01.121 10469-10469/com.Activity: scanResult: ScanResult{bleDevice=RxBleDeviceImpl{bluetoothDevice=Movesense 174430000143(0C:8C:DC:20:EE:13)}, rssi=-52, timestampNanos=99177277644328, callbackType=CALLBACK_TYPE_ALL_MATCHES, scanRecord=com.polidea.rxandroidble.internal.scan.ScanRecordImplNativeWrapper@34583822}
01-26 15:13:01.181 10469-10469/com.Activity: scanResult: ScanResult{bleDevice=RxBleDeviceImpl{bluetoothDevice=Movesense 174430000143(0C:8C:DC:20:EE:13)}, rssi=-52, timestampNanos=99177372142661, callbackType=CALLBACK_TYPE_ALL_MATCHES, scanRecord=com.polidea.rxandroidble.internal.scan.ScanRecordImplNativeWrapper@36f672b3}
01-26 15:13:02.571 10469-10469/com.Activity: scanResult: ScanResult{bleDevice=RxBleDeviceImpl{bluetoothDevice=Movesense 174430000143(0C:8C:DC:20:EE:13)}, rssi=-52, timestampNanos=99178753134171, callbackType=CALLBACK_TYPE_ALL_MATCHES, scanRecord=com.polidea.rxandroidble.internal.scan.ScanRecordImplNativeWrapper@1b36cfe9}
01-26 15:13:03.961 10469-10469/com.Activity: After Scan
01-26 15:13:03.971 10469-10469/com.Activity: 2: scanResult: [0C:8C:DC:20:EE:13 - Movesense 174430000143 [-52]]
01-26 15:13:03.971 10469-10469/com.Activity: connectBLEDevice 1: Connecting to BLE device: 0C:8C:DC:20:EE:13
01-26 15:13:06.621 10469-10469/com.Activity: connectBLEDevice 2: onConnect:0C:8C:DC:20:EE:13
01-26 15:13:07.921 10469-10469/com.Activity: connectBLEDevice 3: onConnectionComplete:0C:8C:DC:20:EE:13 - Movesense 174430000143 [-52]
01-26 15:13:07.921 10469-10469/com.Activity: subscribeToSensor 1: {"Uri": "174430000143/Meas/Acc/52"}
01-26 15:13:08.451 10469-10469/com.Activity: subscription onNotification(): {"Body": {"Timestamp": 43, "ArrayAcc": [{"x": -0.043072346597909927, "y": -0.53601139783859253, "z": 9.8563880920410156}, {"x": 0.01914326474070549, "y": -0.56711924076080322, "z": 9.8348522186279297}, {"x": -0.021536173298954964, "y": -0.6436922550201416, "z": 9.8348522186279297}, {"x": 0.7346227765083313, "y": -1.3184924125671387, "z": 9.7606725692749023}]}, "Uri": "174430000143/Meas/Acc/52", "Method": "PUT"}
01-26 15:13:08.601 10469-10469/com.Activity: subscription onNotification(): {"Body": {"Timestamp": 120, "ArrayAcc": [{"x": -0.31347095966339111, "y": -0.75137311220169067, "z": 9.9879980087280273}, {"x": -0.23689790070056915, "y": -0.60779863595962524, "z": 9.6601696014404297}, {"x": -0.11964540183544159, "y": -0.56472629308700562, "z": 9.7319574356079102}, {"x": -0.10528795421123505, "y": -0.56233340501785278, "z": 9.8468170166015625}]}, "Uri": "174430000143/Meas/Acc/52", "Method": "PUT"}
01-26 15:13:08.631 10469-10469/com.Activity: subscription onNotification(): {"Body": {"Timestamp": 197, "ArrayAcc": [{"x": -0.16750356554985046, "y": -0.61737030744552612, "z": 9.949711799621582}, {"x": -0.021536173298954964, "y": -0.61737030744552612, "z": 9.7941732406616211}, {"x": -0.093323417007923126, "y": -0.58626246452331543, "z": 9.8611745834350586}, {"x": -0.14836029708385468, "y": -0.61497735977172852, "z": 9.8539953231811523}]}, "Uri": "174430000143/Meas/Acc/52", "Method": "PUT"}
01-26 15:13:08.671 10469-10469/com.Activity: subscription onNotification(): {"Body": {"Timestamp": 273, "ArrayAcc": [{"x": -0.1411815732717514, "y": -0.6436922550201416, "z": 9.8683528900146484}, {"x": -0.13878867030143738, "y": -0.59583413600921631, "z": 9.7726364135742188}, {"x": -0.074180148541927338, "y": -0.65565681457519531, "z": 9.8276739120483398}, {"x": -0.14357449114322662, "y": -0.61258447170257568, "z": 9.8683528900146484}]}, "Uri": "174430000143/Meas/Acc/52", "Method": "PUT"}
01-26 15:13:08.731 10469-10469/com.Activity: subscription onNotification(): {"Body": {"Timestamp": 350, "ArrayAcc": [{"x": -0.12203831225633621, "y": -0.49772489070892334, "z": 9.8468170166015625}, {"x": -0.18664683401584625, "y": -0.55036884546279907, "z": 9.9664621353149414}, {"x": -0.25364825129508972, "y": -0.60540574789047241, "z": 9.7726364135742188}, {"x": -0.19861137866973877, "y": -0.60061991214752197, "z": 9.8348522186279297}]}, "Uri": "174430000143/Meas/Acc/52", "Method": "PUT"}


推荐答案

您将获得具有相同包装速率但包装尺寸不同的数据。一个探头用于13Hz,两个探头用于26Hz等。逻辑比较复杂,但是您始终应该检查包装中有多少个探头。

You will get data with the same package rate but different package size. One probe for 13Hz, 2 probes for 26Hz etc. The logic is more complicated but you always should check how many probes you have in package.

这篇关于Movesense-加速度计采样率更改失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆