Set threshold not working for configure any motion for Bma255Accelerometer

edited January 2017 in Android
Im trying to only log data if the tracker hits a threshold of 1g. However it seems like even if i move it a few cm it logs an anymotion value.
As per my understanding the set threshold method in configureAnyMotionDetection is in Gs (https://mbientlab.com/docs/metawear/android/2/com/mbientlab/metawear/module/Bmi160Accelerometer.AnyMotionConfigEditor.html)
I am using version 2.8.6 of the android api.
Below is my configuration code, Id be grateful for any inputs on what might need to be changed for setThreshold to work.

Bma255Accelerometer accModule = mwBoard.lookupModule(Bma255Accelerometer.class);
accModule.configureAnyMotionDetection()
.setThreshold(1.0f).commit(); //
accModule.enableMotionDetection(Bma255Accelerometer.MotionType.ANY_MOTION);
accModule.routeData()
.fromMotion()
.log(ACC_STREAM_KEY)
.commit().onComplete(accelerometerHandler);
final AsyncOperation.CompletionHandler<RouteManager> accelerometerHandler = new AsyncOperation.CompletionHandler<RouteManager>() {
@Override
public void success(RouteManager result) {
Log.i(TAG, "Received acc log id:" + result.id());
editor.putInt(mwBoard.getMacAddress() + ACC_STREAM_KEY, result.id());
editor.commit();
mwBoard.lookupModule(Bma255Accelerometer.class).start();
}

@Override
public void failure(Throwable error) {
Log.i(TAG, "Adding accelerometer route timed out");
error.printStackTrace();
}
};


Comments

  • edited January 2017

  • edited January 2017
    Not sure how to remove a discussion. But Iv found just looking at the raw data helpful in terms of understanding thresholds for the accelerometer.
  • So things are working as you are expecting now with any motion?
  • I still have not figured out the ideal settings for what I want to do but I think thats more to do with understanding the configuration better.

    What I actually want to do is detect when there has been a fall / tracker hits the ground.
    I tried the https://github.com/mbientlab-projects/AndroidFreeFallDetector/tree/master/app example. But its too easy for me to flip the tracker in my hand and hit the threshold. Right now I am trying low high detection.

    My goal is to detect a real fall rather than me picking up the tracker to show it to someone.

    If you have any suggestions in settings for any of the accelerometer editors / data processors let me know. For now Im still looking at sampling with the metawear app and trying to understand the y-axis accelerometer movements better. What I notice when sampling is there is a nice damped oscillation in the case where its a real fall / hitting the ground. So just trying to figure out the right accelerometer config / data processors to detect that. As I am primarily collecting data via logging I cant just log all raw data and process it later (logs would fill up too fast).
This discussion has been closed.