Reorienting Accelerometer data according to gravity

Hello all,
I have three 26531x1 doubles vectors in matlab, one for the X, Y and Z-axis of accelerometer readings of about 5 minutes at 50Hz. From these accelerometer readings I want to calculate the relative slope. I want to use a 10s long (moving) median of all three axis (which I can calculate already) to determine the gravity component of the accelerometer.
The part I am stuck at however, is how to use the median vectors for X, Y and Z (same length) to reorient the original X,Y and Z values.
so basically I have xraw, yraw and zraw, together with xmed, ymed and zmed and I want to get to xreoriented, yreoriented and zreoriented. I want to end up with the angle between the median vectors (direction of gravity) and the gravity direction of the raw values.
I hope I made my question clear enough, if not please tell me and I'll fix it.
//edit: It just occurred to me that it might be suitable to go from three to two axis first (since I only need the resultant vector of the horizontal plane), then get the median, calculate both angles and substract them to get the difference... though I'm not certain...

댓글 수: 3

Strictly speaking, accelerometers measure sensed acceleration, not gravity. If you have accelerometers just sitting stationary on the ground, for instance, they will measure the reaction force of the earth on the sensor package, which will be the opposite of gravity plus the acceleration due to the rotation of the earth.
Is that the setup you have? An accelerometer package sitting stationary on the ground? Were you planning on accounting for the acceleration due to the rotation of the earth before you deduced gravity from the readings?
Far from stationary, it is moving accelerometer on a vehicle carried by a user (think smartphone), and I want to compare the short term direction of gravity towards the longterm median in order to see if the car is tilted (forwards/sideways).
I know it has been a while - have you found a solution ? I am stuck at the same point.
Thanks in advance!

댓글을 달려면 로그인하십시오.

답변 (1개)

Thomas Koelen
Thomas Koelen 2015년 5월 13일

0 개 추천

This website explains it very well, also shows some example coding, it's matlab however:

댓글 수: 1

It is something different then removing the gravity component, I actually want to know the angle between the long term (averaged or median) orientation and short term (to get relative angular movement basically).

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

제품

질문:

2015년 5월 13일

댓글:

2019년 3월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by