I've searched everywhere on the web but could not find a solution of my problem;
I'm trying Madgwick MadgwickAHRSupdateIMU algorithm (The one with 6 parameters - 3 output of gyro and 3 output of accelerometer) using my iPhone; but could not get a stable pitch/roll/yaw angle;
Below is the link of Madgwick algorithm -
http://www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/
Below is the link of the source code I'm using -
http://www.x-io.co.uk/res/sw/madgwick_algorithm_c.zip
So my first question is I'm wondering what convention should I use when feeding into Madgwick's MadgwickAHRSupdateIMU function. I'm pretty sure coordination of my iPhone is ENU - x positive points to East, y positive points to North, z positive points to observer. I have tried different combinations of swapping and inverting axis; none of them works perfect. (gy, gx, -gz, ay, ax, -az) gives the best result, though it's still very unstable;
The second question is what QuaternionToEuler convention should I use, I'm not very familiar with this topic but I guess different QuaternionToEuler convention is according to different coordination system. Madgwick gives QuaternionToEuler function in his paper but it did not work for me. I think it probably happen to be a wrong coordination system in my case.
Hope I've clearly explained my questions; and I really appreciate for any input;
thanks,
Dihan