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

Heading estimation in tilt.py wrong #92

Open
davidradakovits opened this issue Feb 7, 2023 · 0 comments
Open

Heading estimation in tilt.py wrong #92

davidradakovits opened this issue Feb 7, 2023 · 0 comments

Comments

@davidradakovits
Copy link

The calculation of the tilt-compensated heading, which is probably taken from NXP's AN4248 is incorrect. since the rotation matrices of the negative angles phi (roll) and theta (pitch) need to be computed, but the positive angles are fed. This error was carried over from the NXP application note.

Basically, while the rotation was defined correctly as b = R_y(-theta) * R_x(-phi) * m, the following steps where taken with positive angles.
Therefore

b_x should be m_x * cos(theta) + m_y * sin(theta) * sin(phi) - m_z*sin(theta)*cos(phi)
b_y should be m_y * cos(phi) + m_z * sin(phi)
b_z should be m_x * sin(phi) - m_y * cos(theta) * sin(phi) + m_z * cos(theta) * cos(phi)

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