I want to track the movement of a person in a 2D plane using a 9-axis IMU. The size of the plane in which the movement is not bigger than 6 by 6 meter.

The IMU is mounted on the head of the person and there is unfortunately no possibility to add other sensors or change the sensor location. The IMU provides acceleration with removed gravity, the rotation rate and the current attitude in Euler angles. The sample rate of the IMU is about 25 Hz

My first approach was to simply do a double integration on the acceleration with the acceleration being transformed to the global coordinate system using the Euler angles.

Since that gave me no useful result, I tried the Kalman Filter. At the moment I am ignoring the attitude and rotation rate. To the system dynamics matrix I added that the velocity is the acceleration integrated and the position is the velocity integrated and the acceleration integrated twice.

That didn't work either and the position I got when walking 6 steps in a straight line was approximately where I started with the value of the calculated position not deviating more than .6 m from the start at any time.

My next idea would be to take the attitude into account, but I don't really know how to approach this. Should I use the raw attitude to apply that to the raw acceleration to transform the acceleration to the global space or do it in another way?

In addition, I don't really know how to do the math to convert the attitude to a rotation matrix and apply that to the acceleration while still using matrix operations.

Do you have any tips on how I can move forward in this project? Is there a better approach than using a Kalman Filter? Is it even reasonable to think that this might be achievable with my current setup?

Any help and pushes in the right direction are greatly appreciated. Thanks in advance.

  • $\begingroup$ "The IMU provides acceleration with removed gravity" -- what? Do you mean the IMU provides acceleration with gravity subtracted out? How? You can't subtract out gravity unless you have a lot more information available than just the typical "inside Einstein's elevator" information you get from just an IMU. $\endgroup$
    – TimWescott
    Dec 10, 2022 at 15:34
  • $\begingroup$ The data I get is from headphones which provide motion data via an API. The data from the API doesn't contain the total acceleration, but instead the user acceleration and the gravitation in different datasets. I have access to both, but don't need to subtract the gravity myself $\endgroup$
    – Colmear
    Dec 11, 2022 at 13:54
  • $\begingroup$ That means that the IMU is doing some unknown processing itself, to separate the two. And because it physically cannot be perfect, it is imperfect. You're basically getting the headphone company's opinion of truth. Assuming that you do figure out how to get position information, that opinion of truth may well turn out to be worse than just getting the raw IMU output -- because you know what the raw IMU output means. $\endgroup$
    – TimWescott
    Dec 11, 2022 at 16:48

1 Answer 1


Assuming your IMU really is just an inertial device + compass, you can't get there from here.

A Kalman filter won't save you -- Kalman filters are impressive things, but they're basically a filter designed using a method that's a really nice formal way to extract the optimal solution if there's enough information available and if you know exactly how your system behaves.

If you properly describe your system as it is (IMU but no position measurement), and properly construct a Kalman filter from that, you will end up with a double integration of position, and be no better than you were with your first attempt.

If you take a model of the system you have, then the available information you have on motion are noisy versions of acceleration and the angular velocity. When you double-integrate the acceleration, you also double-integrate the noise. Your velocity will be a random walk, with the variance increasing linearly with time. Your position will have variance increasing with the cube of time.

Bottom line: you need a position measurement of some sort. It needs to give some information on position in both x and y, but beyond that you have a lot of freedom. It can be really noisy, as long as it is unbiased. It can be intermittent, as long as it is unbiased. Assuming that you could be sure that your test subject would wander around enough, it could be as simple as dividing the room into grid squares (even just four of them!) and notifying the Kalman filter what square the test subject is in at any given time -- each time the test subject passes from one square to another, that will provide a firm measurement in either the x or y direction, and that can be used in a correction step in the Kalman.

  • $\begingroup$ This is not exactly the answer I was hoping for, but what you described definitely seems like a problem. As the IMU is inside my headphones, I don't have access to x and y coordinates, but I might be able to get the distance between the phone and the headphones via the BLE signal strength.Since I want to do a reaction test and I know where the person should be heading, would it be possible that those information are sufficient? $\endgroup$
    – Colmear
    Dec 16, 2022 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.