The current complementary filter for fusing the gyroscope / accelerometer data seems to work ok, but from everything I've heard, a Kalman filter would deliver much better results. It would be easy enough to just copy this code from somewhere on the web, but I'd like to take the time to properly understand the underlaying math.
The current complementary filter for fusing the gyroscope / accelerometer data seems to work ok, but from everything I've heard, a Kalman filter would deliver much better results. It would be easy enough to just copy this code from somewhere on the web, but I'd like to take the time to properly understand the underlaying math.