Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kalman + quaternion processing #108

Open
jerabaul29 opened this issue Dec 9, 2022 · 0 comments
Open

Kalman + quaternion processing #108

jerabaul29 opened this issue Dec 9, 2022 · 0 comments

Comments

@jerabaul29
Copy link
Collaborator

The workflow is:

  • the accel and gyro gets measured
  • the AHRS Kalman filter "more or less":
    • keep track internally of the quaternion orientation and uncertainties in it and the measurements
    • uses gyro measurements to integrate in time the orientation quaternion
    • uses the accel measurements, compared with the expected value (on average, in the Earth frame of reference, ie after rotation by the quaternion, should point downwards at 1g), to correct for the orientation drift due to integration
    • this results in a quaternion orientation estimate that is both quick / accurate to react (thanks to integrating the gyro), and should not have drift over long time regarding the position of the vertical (thanks to comparing the average acceleration over some time with the expected gravity acceleration)

The typical output, the orientation quaternion, is a rotation on the unit sphere S3 defined as a quaternion, and is non dimensional. See for some quaternion introduction: https://jerabaul29.github.io/jekyll/update/2021/01/17/Integrating-Quaternions.html and https://jerabaul29.github.io/assets/quaternions/quaternions.pdf .

The tricky thing is what to feed to the Kalman filter (unit convention, orientation / sign orientation), and what rotation is outputed (quaternion that describes the rotation from the chip frame of reference to the Earth frame of reference, or the inverse of it? in practice, this is easy to convert back and forth, as for unit quaternions, q-1 = q*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant