Mayitzin / ahrs

Attitude and Heading Reference Systems in Python

Home Page:https://ahrs.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Magnetometer in Complementary filter really optional?

KomaGR opened this issue · comments

The table in the documentation seems to suggest that the magnetometer is optional for using the complementary filter but I'm having trouble getting it to work that way.

Even looking through the code, it seems to me that the update function of the complementary filter calls am_estimation to get the acc-mag heading estimate (as far as I understand). Then ecompass will raise a ValueError if mag measurement is not there.

Am I missing something?

You're right. It wasn't optional in its Implementation, although it could.

I changed with commit 0368775 so that it is now really optional. And you can use it as it was described.

However, now I'm further changing it, because the comparison in the filter is happening linearly between quaternions, which is a big NO, because it loses a lot of accuracy. Basically a LERP.

A new implementation using Euler Angles is on the works, and I hope to get it as soon as possible.