Closed decamun closed 1 year ago
Hi Devin,
Drifting quaternions is not unexpected. The IMU gyros especially drift over time.
I don't have a full answer for you. The DMP is still a mystery in many ways. There is background information here that may be useful. If you look through the open and closed issues in the 20948 Library repo, you'll find similar issues being discussed.
All I can suggest is: try the actual Invensense code (try one of the 'wrappers' mentioned in the DMP.md doc.). If you see the same thing, you know it's the DMP drifiting. If it is better behaved, then that may provide clues about something that is not quite right with the DMP configuration in our Library.
Good luck! Paul
Hi Devin (@decamun),
I'm closing this as I really don't think there is any way I can (reasonably) correct this. It's either a 'feature' of the DMP itself, or we haven't quite got the DMP configured correctly in our library. Debugging the latter is not something I can take on anytime soon. Debugging the former is essentially impossible... Please re-open if you do manage to make any progress with this.
Best wishes, Paul
Subject of the issue
It seems that the DMP quaternions are drifting, even though the absolute acceleration reading is not.
Your workbench
Steps to reproduce
Here is a test script I put together to visualize the quaternions in real time.:
Here is my settings file:
Expected behavior
The absolute accel vector remains aligned with the absolute Z axis in the visualization in a robust way. No matter how I move the board in real space, it keeps track of which way is down.
I would expect that when I use this script, the 'yaw axis' of the transformed coordinate system in the visualization should be roughly the same as the absolute accel vector. In other words, when I spin the board in real space, the rotated coordinate system in the visualization should roughly spin about the absolute accel vector in the visualization.
Actual behavior
Manually spinning the board and watching the visualization, it is possible to see that initially the "yaw" axis of the board is aligned with the absolute acceleration vector as expected. Unfortunately over time it drifts such that spinning the board in real space causes it to rotate in other ways in the visualization.
As I mentioned, the absolute accel vector remains stable throughout this motion. (The absolute acceleration remains aligned with the absolute Z axis in the visualization, even if the board is rotated around in real space)
My conclusion is that the DMP does know which way is down, even when the quaternions have forgotten. In other words, it seems as if the Quat6 and Quat9 values are subject to drift over time that the DMP as a whole is not.
Another possibility is that my code is just broken.
Any thoughts?