Android accelerometer accuracy (Inertial navigation)
You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice.
Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video.
It is not the accelerometer noise that causes the problem but the gyro white noise, see subsection 6.2.3 Propagation of Errors. (By the way, you will need the gyroscopes too.)
As for indoor positioning, I have found these useful:
RSSI-Based Indoor Localization and Tracking Using Sigma-Point Kalman Smoothers
Pedestrian Tracking with Shoe-Mounted Inertial Sensors
Enhancing the Performance of Pedometers Using a Single Accelerometer
I have no idea how these methods would perform in real-life applications or how to turn them into a nice Android app.
A similar question is this.
UPDATE:
Apparently there is a newer version than the above Oliver J. Woodman, "An introduction to inertial navigation", his PhD thesis:
Pedestrian Localisation for Indoor Environments
Accuracy of Accelerometer sensor provided by Android
No, the accelerometer is not accurate enough, see my previous answer at Android accelerometer accuracy (Inertial navigation).
This question pops up surprisingly often, see for example Distance moved by Accelerometer for a collection of similar questions.
Phone accelerometer accuracy
Just a guess, but could it be that you simply just added up the 3 values of the axes, instead of doing the maths ;) for reference look up "Parallelogram of force". The wikipedia page for that should help.
Greets from Germany
What is the real world accuracy of phone accelerometers when used for positioning?
If you integrate the accelerometer values twice you get position but the error is horrible. It is useless in practice.
Here is an explanation why (Google Tech Talk) at 23:20.
I answered a similar question.
Accelerometer accuracy in android
If you really have to use they accelerometer, you could make a naive estimate looking at the amount of activity (peaks) in the data.
- Little or no peaks = no movement
- Some and diverse peaks = walking speed
- Many peaks = running speed
This could be done by simply saving a window of accelerometer data and count the number of values exceeding a given threshold.
Alternatively an more advanced, you could do Fast Fourier Transformation on the data to determine the frequency of the data, low frequency: low activity and vica versa.
The idea could be further improved using Machine Learning and possibly fusing with more sensors such as gyroscope, or compass. This will help more accurately determine the activity but is a rather big topic and will require a lot of time and effort.
Android can detect some user activities but is not that fine grained: http://developer.android.com/training/location/activity-recognition.html
The link can though help to determine when it makes sense to turn on the accelerometer as it is able to determine when the user is on foot:
public class ActivityRecognitionIntentService extends IntentService {
...
/**
* Map detected activity types to strings
*@param activityType The detected activity type
*@return A user-readable name for the type
*/
private String getNameFromType(int activityType) {
switch(activityType) {
case DetectedActivity.IN_VEHICLE:
return "in_vehicle";
case DetectedActivity.ON_BICYCLE:
return "on_bicycle";
case DetectedActivity.ON_FOOT:
return "on_foot";
case DetectedActivity.STILL:
return "still";
case DetectedActivity.UNKNOWN:
return "unknown";
case DetectedActivity.TILTING:
return "tilting";
}
return "unknown";
}
...
}
Indoor Positioning System based on Gyroscope and Accelerometer
Gyros and accelerometers are not enough.
You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice.
Here is an explanation by (Google Tech Talk) at 23:20. I highly recommend this video.
As for indoor positioning, I have found these useful:
- RSSI-Based Indoor Localization and Tracking Using Sigma-Point Kalman Smoothers
- Pedestrian Tracking with Shoe-Mounted Inertial Sensors
- Enhancing the Performance of Pedometers Using a Single Accelerometer
I have no idea how these methods would perform in real-life applications or how to turn them into a nice Android app.
A similar question is Calculating distance within a building.
Related Topics
Android: Install .Apk Programmatically
Standard Android Button With a Different Color
How to Change Fontfamily of Textview in Android
How to Get Zoom Functionality For Images
Determine If the Device Is a Smartphone or Tablet
How to Display a Toast from a Background Thread on Android
How to Create a Circular Imageview in Android
Android Take Screenshot of Surface View Shows Black Screen
Getviewtypecount and Getitemviewtype Methods of Arrayadapter
What Does Android:Layout_Weight Mean
How to Correctly Save Instance State of Fragments in Back Stack
How to Detect When an Android App Goes to the Background and Come Back to the Foreground
Best Practice For Storing and Protecting Private API Keys in Applications
Android Action_Image_Capture Intent
Android: How to Get String from Resources Using Its Name
Android Studio Adds Unwanted Permission After Running Application on Real Device