0
votes

I'm currently trying to implement a Headtracking and Movement System using Androids Gyroscope and Accelerometer. For the task I thought it would be the harder part: I managed to get the Headtracking to work using Androids Gyroscope. So I can freely look around in the Scene using the calculated rotation matrix. The second part that I wanted to implement is to use Androids Accelerometer to change the position in the scene. My aim is to achieve a motion tracking like the HTC Vive does (Or to start with, to track if a player moves, e.g. on one axis).

So I implemented the high and low pass filter to get rid of the gravity influence as described here: See paragraph "Using the Accelerometer". Additionally, after performing this filter I included a second step, to get rid of the remaining jitter of the sensor. Its just something like: if(sensorData <= EPSILON) sensorData = 0;

With these preparations, if my phone rests on the table and i perform a minor movement towards the positive X-Axis, I observe something like this:

X-Acc: 0.46105415
X-Acc: 2.031945
X-Acc: 1.5450834
X-Acc: 1.1939144
X-Acc: -0.18298185
X-Acc: -2.796235
X-Acc: -4.160668
X-Acc: -2.663677
X-Acc: 1.1761014
X-Acc: 0.8469965
X-Acc: 0.46683544
X-Acc: 0.4156207

So, initially, the acceleration increases and afterwards the phone experiences a negative acceleration because of friction. The point I'm struggling with is, why the an increase afterwards? In fact the data is telling me that the phone moved to the right, stopped, moved a little to the left, stopped, and again to the right?

I'm glad for every hint on this topic. Are there better approaches? Am I interpreting the sensor data in a wrong way? I think i have to use the accelerometer to get an idea of the movement, gps is not sensitive enough.

1

1 Answers

0
votes

in order to move to the right, your phone needs to:

-be pushed (force on x axis: 2)

-move for a while (force on x axis: 0)

-be stopped (force on x axis: -2)

acceleration is a change of velocity, not velocity itself :-)

This topic is harder than you think.