-
Notifications
You must be signed in to change notification settings - Fork 9
Basic Steps
GaitAnalysis mGaitAnalysis = new GaitAnalysis();
or
GaitAnalysis mGaitAnalysis = new GaitAnalysis(myCadenceDetector, myGaitClassifier);
where the second constructor call allows passing in customized algorithms. If only one of cadence estimation and gait classification requires customized algorithm, use the second constructor call and pass in null for the other parameter.
Call registerListener(); for each type of sensor to allow SignalListener to receive sensor data.
SensorManager sensorManager;
SignalListener signalListener;
sensorManager.registerListener(signalListener,
sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
SensorManager.SENSOR_DELAY_FASTEST);
Create an IGaitUpdateListener and register it with GaitAnalysis.
IGaitUpdateListener listener =
new IGaitUpdateListener() {
public void onGaitUpdated(GaitData data) {
// define actions
}
}
};
mGaitAnalysis.registerGaitUpdateListener(listener);
mGaitAnalysis.startGaitAnalysis(2000, 1000); begins collecting sensor data and sending out result through gait update events. Default window size and sampling interval can be overridden by passing in their value as parameters: mGaitAnalysis.startGaitAnalysis(2000, 1000);.