3

I was trying to port Sebastian Madgwich's sensor fusion algorithm ( http://www.x-io.co.uk/node/8 ) to Android, but the first results seem not to be correct, and the resulting quaternion is moving everywhere when the phone is steady. One of the problem might be that I'm not able to sample at the same time the three sensors (gyro, accelerometer and magnetometer), but it looks like Android sensor manager doesn't allow to do so. Did anybody succeeded in porting the algorithm with more success? thanks in advance

blobnl
  • 31
  • 3

1 Answers1

2

I haven't implemented this in Android, but I have it working on an iPad 2 for an augmented reality application i'm working on for my MSc thesis. To get it working smoothly I found that it's best to set the update rate for the sensors inline with the frame rate (so, 30hz for me), but it's probably worth experimenting to see what's best for your device.

I'm not sure exactly what you mean by flying everywhere, but sensor drift will probably cause a noticeable amount of error - my objects slowly rotate randomly when the device is at rest. Very annoying, but something you have to accept when using IMUs.

Also, make sure you update the quaternion after you have a new reading from all of the sensors, instead of ofter each sensor gets a new reading separately.

Jake Rigby
  • 21
  • 2
  • Hi Jake Rigby, as your information, you already implemented Madgwick algorithm in Android successfully. Could you please to share some information about how to convert to Android-based euler coordination from Madgwick defined quaternion. Because, I tried the published code but it seems to be not correct because of different coordination usage. – Richard Le Nov 20 '14 at 09:00
  • http://stackoverflow.com/questions/17788043/madgwicks-sensor-fusion-algorithm-on-ios this post also mentions my problem – Richard Le Nov 20 '14 at 09:00