Inaccurate heading

Hello everyone,
I am trying to find the plane’s heading. When I look at the AHRS module (AP_AHRS) I get inaccurate and extremely drifting values. Also when I connect the Pixhawk to the Mission Planner and display “yaw” I get the same results.
I tried looking at MAVLink’s two outputs:

For some reason I get completely different values (plots attached, ignore the x-scale, it is percentage of the trajectory).
It looks like the attitude source is the “real” one, it’s also fits the real trajectory.
Where does this variable come from? How do I use it? what should I include?

I have NO experience with dealing with MAVLink, sorry about that…

If someone can write just short “program” that takes that variable from wherever it is and put it to a local variable it will be VERY helpful!

Thank you for the help!

I guess you are not moving!

I guess you’re wrong because the top one fits the trajectory I had…

The second graph looks like you are not moving, since it’s spinning around. (unless the pane was in a flat spin :slight_smile: ) Post a log of your flight as it’s much easier to analyze when you do.

The first graph and the second graph were taken from the same flight (different variables).
From the second graph it looks like the plane doe’s circles (it also has a velocity, you cannot conclude from these graphs if it moves), which is not true. The second graph shows its heading accurately, although I don’t know how to take this variable and use it.
Can you help me with that?

I can, please post a log to analyze it much easier then

Sent from my iPad using Tapatalk

Log file: … .tlog?dl=0