[Fixed-wing] Yaw estimate changes proportionally to roll

I did the sensor calibration. Pitch and roll estimates are satisfactory, but the yaw estimate is acting strangely; it moves basically proportionally with roll. E.g. if I invert the aircraft, the yaw rotates by 180 degrees. It’s almost as though the yaw estimate thinks the sensor orientation is set to 90 degrees (it’s not, and if it were, I would think the pitch and roll estimates would be wrong as well).

Also, I get a large yaw offset, even after setting the magnetic declination. As large as 90-180 degrees.

I’m having the same problem whether I use the Q Estimator or EKF2, neither of which have I touched.

Any ideas?

Do you have an external compass/gps module? Can you verify the mounting relative to the autopilot?

Yes, a GTPA010 GPS sits about a half an inch to the right of the pixhawk (looking downward from above the aircraft)

Mainly wondering about the mag, I only mentioned GPS because many of the common modules also have an external mag (https://store.mrobotics.io/mRo-GPS-u-Blox-Neo-M8N-HMC5983-Compass-p/gps002-mr.htm).

If you share more about your setup someone might be able to spot the problem. Which autopilot, PX4 version, how is it mounted, any external compass, etc. Share a log (http://logs.uaventure.com/) if you have one.

You’re right, the GPS has an external mag. Turns out I hadn’t noticed the person who mounted the GPS didn’t get the orientation right :p.