0

I'm currently in the process of creating an Android application that tracks templates using template matching, and then stores coordinates in a file. The next step is to also draw trajectories of this object. However, because the device is free-moving, object trajectories are difficult in this sense.

To counteract this problem, I've been trying to access the position of the device over time, using the accelerometer. I'm currently in the position where I need to isolate the gravitational forces, and a lot of posts on StackOverflow relate to times where the LINEAR_ACCELERATION or GRAVITY sensor wasn't a thing.

My question is then, what would be the best way to isolate the gravitational forces of the accelerometer:

  • Simply use LINEAR_ACCELEROMETER sensor
  • Use the ACCELEROMETER sensor, and GRAVITY sensor, and create a filter by applying result - ACCELEROMETER readings - GRAVITY readings
  • Create my own low-pass filter?

Secondly, after obtaining the linear acceleration, what would be the next steps in obtaining positions? I understand that I'd need to integrate twice, and this leaves room for a lot of error.

Any help is appreciated.

  • I think you're going to find this problem unsolvable with these tools. The accelerometer is a very noisy sensor, you're going to see it jumping all over the place. – Gabe Sechan Feb 25 '17 at 16:39
  • @GabeSechan - how would you recommend I tackle this problem? –  Feb 25 '17 at 16:52
  • Positions? Gps for open world. For more exact positions in a closed space, Bluetooth beacons – Gabe Sechan Feb 25 '17 at 16:53
  • Okay thanks. Is there any sources you can point me to about exactly why the accelerometer (or an IMU on an Android device, in general) is not a good approach? –  Feb 25 '17 at 17:22
  • Just error in general You have a noisy input that doesn't directly measure what you want. You then have to subtract another input (gravity, which is actually not a constant all over earth) and double integrate it with respect for time. Each of those magnifies the error. It doesn't take long for the error to dominate the signal. There's techniques like Kalman filters you can use to control for it, but you're still going to be less accurate than just measuring position directly via GPS or via beacons. Also, the sensors in most Android devices are cheap ones. – Gabe Sechan Feb 25 '17 at 17:27
  • Okay, appreciate the input. Thanks for that. Finally, is there any simple way I can actually measure the error? This is part of a writeup and it would be nice to include some evaluation metrics, but ultimately I don't have access to much of the equipment needed for a professional evaluation. –  Feb 25 '17 at 17:29
  • Put the device on a flat surface in a room with no vibration (because even someone walking around the room will cause vibrations that will be picked up by the accelerometer) and write an app that tracks changes in the sensor over a few minutes. That would give you a decent measure of the baseline error. Error in movements would need a way of providing it a constant acceleration to test it with.You'd need a test rig for that. – Gabe Sechan Feb 25 '17 at 17:32
  • Okay I think thst approach makes sense - I could essentially plot the readings of the 3 axis' sensor changes over time, one graph for each axis. The delta would ultimately correspond to the sensor noise (assuming no external factors such as your mentioned vibrations from movement, affect the readings). This sounds like a nice and simple test assuming such an environment is easy to obtain. –  Feb 25 '17 at 17:37

0 Answers0