Why doesn't the EKF use the compass?

Firmware/software/electronics/mechanics
Post Reply
japreiss
Beginner
Posts: 12
Joined: Thu Mar 24, 2016 1:17 am

Why doesn't the EKF use the compass?

Post by japreiss »

Some Crazyflie users are using a motion capture system with a single marker. In this mode we get an accurate position measurement but no attitude (like GPS).

If we hover in one place, the yaw estimate drifts over time due to gyro error. The only way to avoid this is by moving the Crazyflie around, which makes the yaw observable by the EKF.

Shouldn't we be able to use the IMU compass to help with this? I know the compass is generally not well-aligned with the Earth's magnetic field, but is its error stable over time? If so, I believe it could help. It might require some other nontrivial effort, like adding an EKF state for the rotation from the motion capture coordinate system to the compass coordinate system.

Just wondering if this has been considered before. Couldn't find much in these forums or Github issues.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Why doesn't the EKF use the compass?

Post by kimberly »

Hi!

It is a good question and I believe that the papers that are listed in kalman_core.c don't mention this specially.

But what I can imagine can be the reason, is that a magnetometer/compass indoors performs notoriously bad (can fluctuate +/- 50 deg ), which can change from area to area due to electrical interference, so that is why nobody wants to touch that at all since it is so unreliable.

Having said that, I don't think this has been tried been tried with our current IMU, so it would be good to know how big these fluctuations are.
Post Reply