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.