mobiledev aquisition problems!!!

2 vues (au cours des 30 derniers jours)
Jonathan Gauthier
Jonathan Gauthier le 26 Jan 2018
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,'.');

Réponses (1)

arushi
arushi le 2 Sep 2024
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.

Catégories

En savoir plus sur Sensor Data Collection dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by