mobiledev aquisition problems!!!

2 ビュー (過去 30 日間)
Jonathan Gauthier
Jonathan Gauthier 2018 年 1 月 26 日
回答済み: arushi 2024 年 9 月 2 日
Hello, I am trying getting the sensor data from an Android device (phone) at 100hz. The time given by accellog and orientcell are doing step passing example form 0.01sec at 50.09sec ?? Also, if want to get data load by accellog and orientlog I need to wait (more than 60 sec) to read it! Somebody has an idea about that! here is my las code:
clear all; close all; clc; %%
connector on
m = mobiledev; m.Logging = 0; discardlogs(m); m.SampleRate = 'high'; m.AccelerationSensorEnabled = 1; m.OrientationSensorEnabled = 1; m.PositionSensorEnabled = 0; m.MagneticSensorEnabled = 0; m.AngularVelocitySensorEnabled = 0;
i=1; m.Logging = 1; pause(2) discardlogs(m); pause(5)
m.Logging = 0; %% tic pause(40)
[OO, tOO] = orientlog(m); [AA, tAA] = accellog(m);
toc %% [length(tAA) length(tOO)]
subplot(2,1,1); hold on; plot(tOO-tOO(1),'.'); plot(tAA-tAA(1),'.'); subplot(2,1,2); hold on; plot(tOO-tOO(1),OO,'.'); plot(tAA-tAA(1),AA,'.');

回答 (1 件)

arushi
arushi 2024 年 9 月 2 日
Hi Jonathan,
When working with sensor data from an Android device using MATLAB's mobiledev object, you might encounter issues with timing and data retrieval. Here are some suggestions to address the problems you're experiencing:Issues and Solutions
Inconsistent Timestamps:
  • Sensor data might have inconsistent timestamps due to delays in sensor logging or processing.
  • Ensure that your device is capable of sampling at the desired frequency (100 Hz). Some devices have limitations on maximum sampling rates.
  • Consider logging for a longer period and then analyzing the data to identify patterns or issues in timestamp consistency.
Data Retrieval Delays:
  • Retrieving data with accellog and orientlog might take time due to the amount of data being processed.
  • Logging a large amount of data can lead to delays when MATLAB processes and retrieves it.
Improving Performance:
  • Reduce the logging duration to minimize the data size and improve retrieval speed.
  • Ensure that the MATLAB environment and the mobile device are not overloaded with other processes that could affect performance.
Code Optimization:
  • Avoid unnecessary calls to discardlogs(m) unless you want to clear previous logs intentionally.
  • Ensure that you start and stop logging correctly and efficiently.
Hope this helps.

カテゴリ

Help Center および File ExchangeSensor Data Collection についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by