Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accelerometer cannot be summarized in transformer anymore #336

Closed
sc00n opened this issue Sep 21, 2023 · 4 comments
Closed

accelerometer cannot be summarized in transformer anymore #336

sc00n opened this issue Sep 21, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@sc00n
Copy link
Contributor

sc00n commented Sep 21, 2023

In the previous versions (pre 1.0.0), the accelerometer was a multidatum. This was usefull as I could add a transformer that immedieately took the average of all the values (and average of the squared values). Therefore I wouldn't need to safe the countless individual values.

In the new version the accelerometer (e.g. NON_GRAVITATIONAL_ACCELERATION) does not give a multidatum anymore. Therefore, the previous approach doesn't really work anymore. Is there away to avoid saving all individual values and to save only the average, using a transformer or some other way?

@bardram bardram self-assigned this Sep 27, 2023
@bardram bardram added the question Further information is requested label Sep 27, 2023
@bardram
Copy link
Contributor

bardram commented Sep 27, 2023

Good question - I will think about this.

@bardram
Copy link
Contributor

bardram commented Oct 1, 2023

Now I have been thinking (and even implemented a prototype for buffering of data -- see #338).

But I've come to the conclusion that introducing a buffer of data (similar to the old MultiDatum) is the wrong approach.

Instead, we need to define a new Measure which defines what we want to measure. And then provide a probe for doing this. This is similar to the LightProbe which is a BufferingPeriodicStreamProbe that buffers light data and returns metadata on light (incl. max lux and average lux).

This measure and its probe should be part of a sampling package. You can either create your own sampling package or you can provide me with the code and I can add is as part of the sensor sampling package?

-o-

In general - can you provide some (scientific) description of how to process accelerometer/gyroscope data in a standard way? We could implements this as part of CAMS.

@sc00n
Copy link
Contributor Author

sc00n commented Oct 3, 2023

I created some (actually 4, I wasn't able to figure out how to combine everything for the non master branch) pull requests for a new sensor, the NON_GRAVITATIONAL_ACCELERATION_AVERAGE:

In general it works just like the Ambient Light sensor, where the accelerometer is averaged over a period of time. I summarized it in 7 variables:

    // xm, ym, zm: normal averages (or means)
    // xms, yms, zms: averages of squared values
    // n: number of values included
  double? xm; 
  double? ym;
  double? zm;
  double? xms;
  double? yms;
  double? zms;
  int? n;

using the normal average and average of squared value, the standard deviation can also be computed later:
image

bardram added a commit that referenced this issue Oct 8, 2023
@bardram
Copy link
Contributor

bardram commented Oct 8, 2023

Now the new AVERAGE_NON_GRAVITATIONAL_ACCELERATION measure
is added as part of carp_mobile_sensing 1.3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants