CPRO NoMotion Detection
I try to received a message from CPRO when the sensor is fixed.I would like to check if the person wear the sensor is motionless for 5 seconds.
For this reason i would like to set a very low accelerometer sensibility, but i never receive NoMotion detection message.
I use this code :
It's possible detect NoMotion and stream fromYAxis or fromAxies (for this the code is in http://community.mbientlab.com/discussion/comment/2464#Comment_2464) at the same time ?
For this reason i would like to set a very low accelerometer sensibility, but i never receive NoMotion detection message.
I use this code :
accelModule.enableMotionDetection(Bmi160Accelerometer.MotionType.NO_MOTION);I wrong same think to detect NoMotion ?
//accelModule.configureNoMotionDetection().setThreshold(0.3f).setDuration(500);
accelModule.configureNoMotionDetection().setDuration(5000);
accelModule.routeData().fromMotion().stream("noMotion").commit().onComplete(new CompletionHandler<RouteManager>() {
@Override
public void success(RouteManager result) {
super.success(result);
result.subscribe("noMotion", new RouteManager.MessageHandler() {
@Override
public void process(Message msg) {
Bmi160MotionMessage motionMsg = (Bmi160MotionMessage) msg;
Log.d("test","No Motion detected "+motionMsg.toString());
}
});
}
@Override
public void failure(Throwable error) {
super.failure(error);
Toast.makeText(MainActivity.this, "Motion failure"+error.getMessage(), Toast.LENGTH_LONG).show();
}
});
accelModule.start();
It's possible detect NoMotion and stream fromYAxis or fromAxies (for this the code is in http://community.mbientlab.com/discussion/comment/2464#Comment_2464) at the same time ?
This discussion has been closed.
Comments
The process method is never invoke.
I try to commit the configuration and resetDevice before next run, but without good news.
I forgot somethink to do ?
your source work fine.
I try together the NoMotion, and fromYAxis with success too.
Thank you very much for you important support.
Bye Roberto