arduino-libraries / MadgwickAHRS

Arduino implementation of the MadgwickAHRS algorithm
464 stars 193 forks source link

2x missing x2 #50

Open jisa opened 7 months ago

jisa commented 7 months ago

Hello, thanks for making Madgwick filter so easily available on Arduinos!

Are you aware of the analysis in https://github.com/RideBeeline/madgwick-investigation?

It reveals that the code here is missing two multiplications by two. What is called two bx and two bz here is in fact bx and bz.

It can be fixed by, for example, adding these two lines.

After reading the original paper (pdf) and a Python implementation, I support the conclusion of the analysis.