- #1
ericrijnb
- 1
- 0
Hi all,
We're working on a project where we try to calculate the distance traveled by a mobile phone which is thrown in the air (only vertical movement, not horizontal).
We use the accelerometer to get the acceleration in the x-, y-, and z-axis. Now we try to fix the error caused by the flipping and spinning of a phone.
I found out that we can get the actual acceleration by taking the azimuth, pitch and roll of the phone, en by using the rotation matrix like this: http://upload.wikimedia.org/wikipedia/en/math/5/2/5/525d9c773a2ed0d6a41c48d9a3ea4291.png, we should get the real acceleration in the three axes.
But, something's going wrong. If I hold my phone still, everything's ok. If I rotate my phone over, say, the x-axis, the value of the z-axis of the 'real' acceleration also changes, which is wrong.
What should I do to get the actual acceleration of the phone in the three axes, using the accelerometer and magnetic-field sensor? I searched the forum, but couldn't find a solution which fits this situation.
Looking forward to any replies.
Greetz,
Eric
We're working on a project where we try to calculate the distance traveled by a mobile phone which is thrown in the air (only vertical movement, not horizontal).
We use the accelerometer to get the acceleration in the x-, y-, and z-axis. Now we try to fix the error caused by the flipping and spinning of a phone.
I found out that we can get the actual acceleration by taking the azimuth, pitch and roll of the phone, en by using the rotation matrix like this: http://upload.wikimedia.org/wikipedia/en/math/5/2/5/525d9c773a2ed0d6a41c48d9a3ea4291.png, we should get the real acceleration in the three axes.
But, something's going wrong. If I hold my phone still, everything's ok. If I rotate my phone over, say, the x-axis, the value of the z-axis of the 'real' acceleration also changes, which is wrong.
What should I do to get the actual acceleration of the phone in the three axes, using the accelerometer and magnetic-field sensor? I searched the forum, but couldn't find a solution which fits this situation.
Looking forward to any replies.
Greetz,
Eric